@Test public void testExecuteWithEmptySecretKey() { ListResponse<UserResponse> responseList = new ListResponse<>(); UserResponse response = new UserResponse(); responseList.setResponses(Arrays.asList(response)); when(queryService.searchForUsers(listUsersCmd)).thenReturn(responseList); listUsersCmd.execute(); responseList = (ListResponse)listUsersCmd.getResponseObject(); response = responseList.getResponses().get(0); assertFalse("Empty SecretKey should be left empty", StringUtils.isNotBlank(response.getSecretKey())); }
@Override public void execute() { final ListResponse<UserResponse> response = _queryService.searchForUsers(this); response.setResponseName(getCommandName()); List<UserResponse> responseList = response.getResponses(); if (responseList != null && responseList.size() > 0) { for (UserResponse userResponse : responseList) { if (StringUtils.isNotBlank(userResponse.getSecretKey())) { userResponse.setSecretKey("SecretKey only visible when generating a new key"); } } } this.setResponseObject(response); }
ListUsersCmd extends BaseListAccountResourcesCmd { @Override public void execute() { final ListResponse<UserResponse> response = _queryService.searchForUsers(this); response.setResponseName(getCommandName()); List<UserResponse> responseList = response.getResponses(); if (responseList != null && responseList.size() > 0) { for (UserResponse userResponse : responseList) { if (StringUtils.isNotBlank(userResponse.getSecretKey())) { userResponse.setSecretKey("SecretKey only visible when generating a new key"); } } } this.setResponseObject(response); } }
ListUsersCmd extends BaseListAccountResourcesCmd { @Override public void execute() { final ListResponse<UserResponse> response = _queryService.searchForUsers(this); response.setResponseName(getCommandName()); List<UserResponse> responseList = response.getResponses(); if (responseList != null && responseList.size() > 0) { for (UserResponse userResponse : responseList) { if (StringUtils.isNotBlank(userResponse.getSecretKey())) { userResponse.setSecretKey("SecretKey only visible when generating a new key"); } } } this.setResponseObject(response); }  }
ListUsersCmd extends BaseListAccountResourcesCmd { @Override public void execute() { final ListResponse<UserResponse> response = _queryService.searchForUsers(this); response.setResponseName(getCommandName()); List<UserResponse> responseList = response.getResponses(); if (responseList != null && responseList.size() > 0) { for (UserResponse userResponse : responseList) { if (StringUtils.isNotBlank(userResponse.getSecretKey())) { userResponse.setSecretKey("SecretKey only visible when generating a new key"); } } } this.setResponseObject(response); }  Long getAccountType(); Long getId(); String getState(); String getUsername(); @Override void execute(); @Override String getCommandName(); }
ListUsersCmd extends BaseListAccountResourcesCmd { @Override public void execute() { final ListResponse<UserResponse> response = _queryService.searchForUsers(this); response.setResponseName(getCommandName()); List<UserResponse> responseList = response.getResponses(); if (responseList != null && responseList.size() > 0) { for (UserResponse userResponse : responseList) { if (StringUtils.isNotBlank(userResponse.getSecretKey())) { userResponse.setSecretKey("SecretKey only visible when generating a new key"); } } } this.setResponseObject(response); }  Long getAccountType(); Long getId(); String getState(); String getUsername(); @Override void execute(); @Override String getCommandName(); static final Logger s_logger; }