PublicAPIs { @GET @Path("/api/repository/{id}") @Produces({ "application/json", "application/xml" }) public VXRepository getRepository(@PathParam("id") Long id) { if(logger.isDebugEnabled()) { logger.debug("==> PublicAPIs.getRepository(" + id + ")"); } RangerService service = serviceREST.getService(id); VXRepository ret = serviceUtil.toVXRepository(service); if(logger.isDebugEnabled()) { logger.debug("<= PublicAPIs.getRepository(" + id + ")"); } return ret; }  @GET @Path("/api/repository/{id}") @Produces({ "application/json", "application/xml" }) VXRepository getRepository(@PathParam("id") Long id); @POST @Path("/api/repository/") @Produces({ "application/json", "application/xml" }) VXRepository createRepository(VXRepository vXRepository); @PUT @Path("/api/repository/{id}") @Produces({ "application/json", "application/xml" }) VXRepository updateRepository(VXRepository vXRepository,
			@PathParam("id") Long id); @DELETE @Path("/api/repository/{id}") @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") @RangerAnnotationClassName(class_name = VXAsset.class) void deleteRepository(@PathParam("id") Long id,
			@Context HttpServletRequest request); @GET @Path("/api/repository/") @Produces({ "application/json", "application/xml" }) VXRepositoryList searchRepositories(
			@Context HttpServletRequest request); @GET @Path("/api/repository/count") @Produces({ "application/json", "application/xml" }) VXLong countRepositories(@Context HttpServletRequest request); @GET @Path("/api/policy/{id}") @Produces({ "application/json", "application/xml" }) VXPolicy getPolicy(@PathParam("id") Long id); @POST @Path("/api/policy") @Produces({ "application/json", "application/xml" }) VXPolicy createPolicy(VXPolicy vXPolicy); @PUT @Path("/api/policy/{id}") @Produces({ "application/json", "application/xml" }) VXPolicy updatePolicy(VXPolicy vXPolicy, @PathParam("id") Long id); @DELETE @Path("/api/policy/{id}") @PreAuthorize("hasRole('ROLE_SYS_ADMIN')") @RangerAnnotationClassName(class_name = VXResource.class) void deletePolicy(@PathParam("id") Long id,
			@Context HttpServletRequest request); @GET @Path("/api/policy") @Produces({ "application/json", "application/xml" }) VXPolicyList searchPolicies(@Context HttpServletRequest request); @GET @Path("/api/policy/count") @Produces({ "application/xml", "application/json" }) VXLong countPolicies(@Context HttpServletRequest request);  }
@Test public void test1getRepository() throws Exception { RangerService rangerService = rangerService(); VXRepository vXRepository = vXRepository(rangerService); Mockito.when(serviceREST.getService(rangerService.getId())).thenReturn(rangerService); Mockito.when(serviceUtil.toVXRepository(rangerService)).thenReturn(vXRepository); VXRepository dbVXRepository = publicAPIs.getRepository(Id); Assert.assertNotNull(dbVXRepository); Assert.assertEquals(dbVXRepository, vXRepository); Assert.assertEquals(dbVXRepository.getId(), vXRepository.getId()); Assert.assertEquals(dbVXRepository.getName(), vXRepository.getName()); Mockito.verify(serviceREST).getService(Id); Mockito.verify(serviceUtil).toVXRepository(rangerService); }