/** * Updates the Account based on the information provided in the Account parameter. * * @param scopeId * The ScopeId of the requested {@link Account}. * @param accountId * The id of the requested {@link Account} * @param account * The modified Account whose attributed need to be updated. * @return The updated account. * @throws Exception * Whenever something bad happens. See specific {@link KapuaService} exceptions. * @since 1.0.0 */ @ApiOperation(nickname = "accountUpdate", value = "Update an Account", // notes = "Updates a new Account based on the information provided in the Account parameter.", // response = Account.class) @PUT @Path("{accountId}") @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public Account update( @ApiParam(value = "The ScopeId of the requested Account.", required = true, defaultValue = DEFAULT_SCOPE_ID) @PathParam("scopeId") ScopeId scopeId, // @ApiParam(value = "The id of the requested Account", required = true) @PathParam("accountId") EntityId accountId, // @ApiParam(value = "The modified Account whose attributes needs to be updated", required = true) Account account) throws Exception { account.setScopeId(scopeId); account.setId(accountId); return accountService.update(account); }
@When("I change the current account expiration date to \"(.+)\"") public void changeCurrentAccountExpirationDate(String newExpiration) throws Exception { Account currAcc = (Account) stepData.get("LastAccount"); Date newDate = parseDateString(newExpiration); try { primeException(); currAcc.setExpirationDate(newDate); Account tmpAcc = accountService.update(currAcc); stepData.put("LastAccount", tmpAcc); } catch (KapuaException e) { verifyException(e); } }