I created a simple DELTE action with a Rest interface:
@DELETE @Path("/systemuser/{organisation}/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Deletes the given system user from the organisation indicated by shortname.") @ApiResponses(value = {@ApiResponse(code = 204, message = "System User is deleted"), @ApiResponse(code = 400, message = "No valid system user data provided"), @ApiResponse(code = 401, message = "Not authenticated")}) public Response deleteSystemUser(@PathParam("organisationShortName") String organisation, @javax.validation.constraints.NotNull List<Users> users) { return LogInfo.logDuration(log, "deleteSystemUser", () -> { log.info("Deleted users {}", users); return handleExceptions(() -> { accountsService.deleteSystemUser(organisationShortName, users); return Response.status(204) // .build(); }); }); }
And I try to test this with a simple JersyTest to see if all is well. But it seems that the Grizzly container is a bit strict on this implemenation and ignores the HTTP body. And seeing I dont want the list of ussers in query parameters I now have to put a test on ignore.
I created a simple DELTE action with a Rest interface:
@DELETE @Path("/systemuser/{organisation}/") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Deletes the given system user from the organisation indicated by shortname.") @ApiResponses(value = {@ApiResponse(code = 204, message = "System User is deleted"), @ApiResponse(code = 400, message = "No valid system user data provided"), @ApiResponse(code = 401, message = "Not authenticated")}) public Response deleteSystemUser(@PathParam("organisationShortName") String organisation, @javax.validation.constraints.NotNull List<Users> users) { return LogInfo.logDuration(log, "deleteSystemUser", () -> { log.info("Deleted users {}", users); return handleExceptions(() -> { accountsService.deleteSystemUser(organisationShortName, users); return Response.status(204) // .build(); }); }); }
And I try to test this with a simple JersyTest to see if all is well. But it seems that the Grizzly container is a bit strict on this implemenation and ignores the HTTP body. And seeing I dont want the list of ussers in query parameters I now have to put a test on ignore.