AppDetailsController { @Path("config/{id}") @GET @Produces(MediaType.APPLICATION_JSON) public AppEntry getDetails(@PathParam("id") String id) { AppCatalogSolrClient sc = new AppCatalogSolrClient(); return sc.findAppEntry(id); } AppDetailsController(); @Path("config/{id}") @GET @Produces(MediaType.APPLICATION_JSON) AppEntry getDetails(@PathParam("id") String id); @Path("status/{id}") @GET @Produces(MediaType.APPLICATION_JSON) AppEntry getStatus(@PathParam("id") String id); @Path("stop/{id}") @POST @Produces(MediaType.APPLICATION_JSON) Response stopApp(@PathParam("id") String id); @Path("restart/{id}") @POST @Produces(MediaType.APPLICATION_JSON) Response restartApp(@PathParam("id") String id); @Path("upgrade/{id}") @PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response upgradeApp(@PathParam("id") String id, Service app);  }
@Test public void testGetDetails() throws Exception { String id = "application 1"; AppDetailsController ac = Mockito.mock(AppDetailsController.class); AppEntry actual = new AppEntry(); actual.setName(id); when(ac.getDetails(id)).thenReturn(actual); final AppEntry result = ac.getDetails(id); assertEquals(result, actual); }