@Test(expected = InvalidParameterValueException.class) public void testExecuteWithUnknownApikey() { userAccount = null; when(accountService.getUserByApiKey(null)).thenReturn(userAccount); getUserCmd.execute(); }
@Override public void execute() { final UserAccount result = _accountService.getUserByApiKey(getApiKey()); if (result != null) { final UserResponse response = _responseGenerator.createUserResponse(result); if (StringUtils.isNotBlank(response.getSecretKey())) { response.setSecretKey("SecretKey only visible when generating a new key"); } response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new InvalidParameterValueException("User with specified API key does not exist"); } }
GetUserCmd extends BaseCmd { @Override public void execute() { final UserAccount result = _accountService.getUserByApiKey(getApiKey()); if (result != null) { final UserResponse response = _responseGenerator.createUserResponse(result); if (StringUtils.isNotBlank(response.getSecretKey())) { response.setSecretKey("SecretKey only visible when generating a new key"); } response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new InvalidParameterValueException("User with specified API key does not exist"); } } }
GetUserCmd extends BaseCmd { @Override public void execute() { final UserAccount result = _accountService.getUserByApiKey(getApiKey()); if (result != null) { final UserResponse response = _responseGenerator.createUserResponse(result); if (StringUtils.isNotBlank(response.getSecretKey())) { response.setSecretKey("SecretKey only visible when generating a new key"); } response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new InvalidParameterValueException("User with specified API key does not exist"); } }  }
GetUserCmd extends BaseCmd { @Override public void execute() { final UserAccount result = _accountService.getUserByApiKey(getApiKey()); if (result != null) { final UserResponse response = _responseGenerator.createUserResponse(result); if (StringUtils.isNotBlank(response.getSecretKey())) { response.setSecretKey("SecretKey only visible when generating a new key"); } response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new InvalidParameterValueException("User with specified API key does not exist"); } }  @Override void execute(); String getApiKey(); @Override String getCommandName(); @Override long getEntityOwnerId(); }
GetUserCmd extends BaseCmd { @Override public void execute() { final UserAccount result = _accountService.getUserByApiKey(getApiKey()); if (result != null) { final UserResponse response = _responseGenerator.createUserResponse(result); if (StringUtils.isNotBlank(response.getSecretKey())) { response.setSecretKey("SecretKey only visible when generating a new key"); } response.setResponseName(getCommandName()); this.setResponseObject(response); } else { throw new InvalidParameterValueException("User with specified API key does not exist"); } }  @Override void execute(); String getApiKey(); @Override String getCommandName(); @Override long getEntityOwnerId(); static final Logger s_logger; }