AppListController { @DELETE @Path("{id}/{name}") @Produces(MediaType.APPLICATION_JSON) public Response delete(@PathParam("id") String id, @PathParam("name") String name) { AppCatalogSolrClient sc = new AppCatalogSolrClient(); sc.deleteApp(id); YarnServiceClient yc = new YarnServiceClient(); yc.deleteApp(name); return Response.status(Status.ACCEPTED).build(); } AppListController(); @GET @Produces(MediaType.APPLICATION_JSON) List<AppEntry> getList(); @DELETE @Path("{id}/{name}") @Produces(MediaType.APPLICATION_JSON) Response delete(@PathParam("id") String id,
      @PathParam("name") String name); @POST @Path("{id}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response deploy(@PathParam("id") String id, Service service);  }
@Test public void testDelete() throws Exception { String id = "application 1"; AppListController ac = Mockito.mock(AppListController.class); Response expected = Response.ok().build(); when(ac.delete(id, id)).thenReturn(Response.ok().build()); final Response actual = ac.delete(id, id); assertEquals(expected.getStatus(), actual.getStatus()); }