InviteService extends Service { @DELETE @Path("/{domain}") @ApiOperation(value = "Remove invite") @ApiResponses({ @ApiResponse(code = 204, message = "The invitation successfully removed"), @ApiResponse(code = 400, message = "Missed required parameters, parameters are not valid"), @ApiResponse(code = 500, message = "Internal server error occurred") }) public void remove( @ApiParam("Domain id") @PathParam("domain") String domain, @ApiParam(value = "Instance id", required = true) @QueryParam("instance") String instance, @ApiParam(value = "User email", required = true) @QueryParam("email") String email) throws BadRequestException, ServerException { checkArgument(!isNullOrEmpty(instance), "Instance id required"); checkArgument(!isNullOrEmpty(email), "User email required"); inviteManager.remove(domain, instance, email); } @Inject  InviteService(EmailValidator emailValidator, InviteManager inviteManager); @POST @Consumes(APPLICATION_JSON) @ApiOperation( value = "Invite unregistered user by email " + "or update permissions for already invited user", notes = "Invited user will receive email notification only on invitation creation" ) @ApiResponses({ @ApiResponse(code = 204, message = "The invitation successfully created/updated"), @ApiResponse(code = 400, message = "Missed required parameters, parameters are not valid"), @ApiResponse(code = 409, message = "User with specified email is already registered"), @ApiResponse(code = 500, message = "Internal server error occurred") }) void invite(@ApiParam(value = "The invite to store", required = true) InviteDto inviteDto); @GET @Path("/{domain}") @Produces(APPLICATION_JSON) @ApiOperation( value = "Get invites by instance", response = InviteDto.class, responseContainer = "list" ) @ApiResponses({ @ApiResponse(code = 200, message = "The invitations successfully fetched"), @ApiResponse(code = 400, message = "Missed required parameters, parameters are not valid"), @ApiResponse(code = 500, message = "Internal server error occurred") }) Response getInvites(
      @ApiParam(value = "Domain id") @PathParam("domain") String domain,
      @ApiParam(value = "Instance id", required = true) @QueryParam("instance") String instance,
      @ApiParam("Skip count") @QueryParam("skipCount") @DefaultValue("0") long skipCount,
      @ApiParam("Max items") @QueryParam("maxItems") @DefaultValue("30") int maxItems); @DELETE @Path("/{domain}") @ApiOperation(value = "Remove invite") @ApiResponses({ @ApiResponse(code = 204, message = "The invitation successfully removed"), @ApiResponse(code = 400, message = "Missed required parameters, parameters are not valid"), @ApiResponse(code = 500, message = "Internal server error occurred") }) void remove(
      @ApiParam("Domain id") @PathParam("domain") String domain,
      @ApiParam(value = "Instance id", required = true) @QueryParam("instance") String instance,
      @ApiParam(value = "User email", required = true) @QueryParam("email") String email);  }
@Test public void shouldRemoveInvite() throws Exception { given() .auth() .basic(ADMIN_USER_NAME, ADMIN_USER_PASSWORD) .when() .expect() .statusCode(204) .delete(SECURE_PATH + "/invite/organization?instance=org123&email=user@test.com"); verify(inviteManager).remove("organization", "org123", "user@test.com"); }