ClientElbResource { @POST @Path("/delete") @Timed public Response deleteClientElb(@QueryParam("clientId") String clientId) { if(clientId == null) { return Response.status(Response.Status.BAD_REQUEST.getStatusCode()).entity( "ClientId cannot be null").build(); } try { clientElbPersistenceService.deleteClientElb(clientId); } catch(Exception ex) { logger.error("Deletion failed for input: "+ clientId + " {} {} ", ex.getMessage(), ex.getStackTrace()); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } return Response.status(Response.Status.ACCEPTED).build(); } @Inject  ClientElbResource(ClientElbPersistenceService clientElbPersistenceService
    ); @POST @Path("/create") @Timed @Produces(MediaType.APPLICATION_JSON) Response createClientElb(@QueryParam("clientId") String clientId,
                                @QueryParam("clientElbUrl") String clientElbUrl); @GET @Path("/findById") @Timed @Produces(MediaType.APPLICATION_JSON) Response findByIdClientElb(@QueryParam("clientId") String clientId); @POST @Path("/update") @Timed Response updateClientElb(@QueryParam("clientId") String clientId,
                                    @QueryParam("clientElbUrl") String clientElbUrl); @POST @Path("/delete") @Timed Response deleteClientElb(@QueryParam("clientId") String clientId);  }
@Test public void testDeleteClientElb() { Response response_1 = clientElbResource.deleteClientElb(null); Assertions.assertThat(response_1.getStatus()).isEqualTo(Response.Status.BAD_REQUEST.getStatusCode()); doNothing().when(clientElbPersistenceService).deleteClientElb("magic_id"); Response response_2 = clientElbResource.deleteClientElb("magic_id"); Assertions.assertThat(response_2.getStatus()).isEqualTo(Response.Status.ACCEPTED.getStatusCode()); verify(clientElbPersistenceService, times(1)).deleteClientElb( "magic_id"); verifyNoMoreInteractions(clientElbPersistenceService); }