Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #1841 #1852

Merged
merged 2 commits into from
Jan 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public OpenItemDTO createItem(String appId, String env, String clusterName, Stri
checkNotEmpty(appId, "App id");
checkNotEmpty(env, "Env");
checkNotEmpty(itemDTO.getKey(), "Item key");
checkNotEmpty(itemDTO.getValue(), "Item value");
checkNotEmpty(itemDTO.getDataChangeCreatedBy(), "Item created by");

String path = String.format("envs/%s/apps/%s/clusters/%s/namespaces/%s/items",
Expand All @@ -80,7 +79,6 @@ public void updateItem(String appId, String env, String clusterName, String name
checkNotEmpty(appId, "App id");
checkNotEmpty(env, "Env");
checkNotEmpty(itemDTO.getKey(), "Item key");
checkNotEmpty(itemDTO.getValue(), "Item value");
checkNotEmpty(itemDTO.getDataChangeLastModifiedBy(), "Item modified by");

String path = String.format("envs/%s/apps/%s/clusters/%s/namespaces/%s/items/%s",
Expand All @@ -106,7 +104,6 @@ public void createOrUpdateItem(String appId, String env, String clusterName, Str
checkNotEmpty(appId, "App id");
checkNotEmpty(env, "Env");
checkNotEmpty(itemDTO.getKey(), "Item key");
checkNotEmpty(itemDTO.getValue(), "Item value");
checkNotEmpty(itemDTO.getDataChangeCreatedBy(), "Item created by");

if (Strings.isNullOrEmpty(itemDTO.getDataChangeLastModifiedBy())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public OpenItemDTO createItem(@PathVariable String appId, @PathVariable String e
@RequestBody OpenItemDTO item, HttpServletRequest request) {

RequestPrecondition.checkArguments(
!StringUtils.isContainEmpty(item.getKey(), item.getValue(), item.getDataChangeCreatedBy()),
"key, value and dataChangeCreatedBy should not be null or empty");
!StringUtils.isContainEmpty(item.getKey(), item.getDataChangeCreatedBy()),
"key and dataChangeCreatedBy should not be null or empty");

if (userService.findByUserId(item.getDataChangeCreatedBy()) == null) {
throw new BadRequestException("User " + item.getDataChangeCreatedBy() + " doesn't exist!");
Expand Down Expand Up @@ -82,8 +82,8 @@ public void updateItem(@PathVariable String appId, @PathVariable String env,
RequestPrecondition.checkArguments(item != null, "item payload can not be empty");

RequestPrecondition.checkArguments(
!StringUtils.isContainEmpty(item.getKey(), item.getValue(), item.getDataChangeLastModifiedBy()),
"key, value and dataChangeLastModifiedBy can not be empty");
!StringUtils.isContainEmpty(item.getKey(), item.getDataChangeLastModifiedBy()),
"key and dataChangeLastModifiedBy can not be empty");

RequestPrecondition.checkArguments(item.getKey().equals(key), "Key in path and payload is not consistent");

Expand Down