Sequoia extends AbstractResource { @GET @Produces(MediaType.APPLICATION_JSON) @Path("/graph/{name}/{version}") public Response getModuleGraph(@PathParam("name") final String moduleName, @PathParam("version") final String moduleVersion, @Context final UriInfo uriInfo){ LOG.info("Dependency Checker got a get module graph export request."); if(moduleName == null || moduleVersion == null){ return Response.serverError().status(HttpStatus.NOT_ACCEPTABLE_406).build(); } final FiltersHolder filters = new FiltersHolder(); filters.init(uriInfo.getQueryParameters()); final String moduleId = DbModule.generateID(moduleName, moduleVersion); final AbstractGraph moduleGraph = getGraphsHandler(filters).getModuleGraph(moduleId); return Response.ok(moduleGraph).build(); } Sequoia(final RepositoryHandler repoHandler, final GrapesServerConfig dmConfig); @GET @Produces(MediaType.APPLICATION_JSON) @Path("/graph/{name}/{version}") Response getModuleGraph(@PathParam("name") final String moduleName,
                                   @PathParam("version") final String moduleVersion,
                                   @Context final UriInfo uriInfo); @GET @Produces(MediaType.APPLICATION_JSON) @Path("/tree/{name}/{version}") Response getModuleTree(@PathParam("name") final String moduleName,
                                   @PathParam("version") final String moduleVersion,
                                   @Context final UriInfo uriInfo);  }
@Test public void getModuleGraph() throws UnknownHostException { when(repositoryHandler.getModule(anyString())).thenReturn(new DbModule()); WebResource resource = client().resource("/" + ServerAPI.SEQUOIA_RESOURCE + "/graph/module/1"); ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class); assertNotNull(response); assertEquals(HttpStatus.OK_200, response.getStatus()); AbstractGraph graph = response.getEntity(ModuleGraph.class); assertNotNull(graph); }