/** * Deletes the Account specified by the "accountId" path parameter. * * @param scopeId * The ScopeId of the requested {@link Account}. * @param accountId * The id of the Account to be deleted. * @return HTTP 200 if operation has completed successfully. * @throws Exception * Whenever something bad happens. See specific {@link KapuaService} exceptions. * @since 1.0.0 */ @ApiOperation(nickname = "accountDelete", value = "Delete an Account", // notes = "Deletes the Account specified by the \"accountId\" path parameter.") @DELETE @Path("{accountId}") public Response deleteAccount( @ApiParam(value = "The ScopeId of the Account to delete.", required = true, defaultValue = DEFAULT_SCOPE_ID) @PathParam("scopeId") ScopeId scopeId, // @ApiParam(value = "The id of the Account to be deleted", required = true) @PathParam("accountId") EntityId accountId) throws Exception { accountService.delete(scopeId, accountId); return returnOk(); }
@When("^I try to delete account \"(.*)\"$") public void deleteAccount(String accountName) throws KapuaException { Account accountToDelete; accountToDelete = accountService.findByName(accountName); if (accountToDelete != null) { accountService.delete(accountToDelete.getScopeId(), accountToDelete.getId()); } }