@Test @Category(UnitTest.class) public void testGetAll() throws Exception { List<String> retvals = new ArrayList<>(); retvals.add("/mrgeo/test-files/output/org.mrgeo.resources.raster.mrspyramid/ColorScaleResourceTest/rainbow-transparent.xml"); retvals.add("/mrgeo/test-files/output/org.mrgeo.resources.raster.mrspyramid/ColorScaleResourceTest/rainbow.xml"); retvals .add("/mrgeo/test-files/output/org.mrgeo.resources.raster.mrspyramid/ColorScaleResourceTest/dir1/brewer-green-log.xml"); retvals.add("/mrgeo/test-files/output/org.mrgeo.resources.raster.mrspyramid/ColorScaleResourceTest/dir1/Default.xml"); retvals.add("/mrgeo/test-files/output/org.mrgeo.resources.raster.mrspyramid/ColorScaleResourceTest/dir1/rainbow.xml"); Mockito.when(service.getColorScales()).thenReturn(retvals); ColorScaleList response = target("/colorscales").request().get(ColorScaleList.class); Assert.assertNotNull(response); List<String> fileNames = response.getFilePaths(); assertEquals(fileNames.size(), 5); assertTrue(fileNames.contains( "/mrgeo/test-files/output/org.mrgeo.resources.raster.mrspyramid/ColorScaleResourceTest/rainbow-transparent.xml")); assertTrue(fileNames.contains( "/mrgeo/test-files/output/org.mrgeo.resources.raster.mrspyramid/ColorScaleResourceTest/rainbow.xml")); assertTrue(fileNames.contains( "/mrgeo/test-files/output/org.mrgeo.resources.raster.mrspyramid/ColorScaleResourceTest/dir1/brewer-green-log.xml")); assertTrue(fileNames.contains( "/mrgeo/test-files/output/org.mrgeo.resources.raster.mrspyramid/ColorScaleResourceTest/dir1/Default.xml")); assertTrue(fileNames.contains( "/mrgeo/test-files/output/org.mrgeo.resources.raster.mrspyramid/ColorScaleResourceTest/dir1/rainbow.xml")); }
@GET @Produces(MediaType.APPLICATION_JSON) public ColorScaleList get() throws MrsPyramidServiceException { log.info("Retrieving color scales file list..."); getService(); List<String> files = service.getColorScales(); log.info("Color scales file list retrieved."); return new ColorScaleList(files); }
ColorScaleResource { @GET @Produces(MediaType.APPLICATION_JSON) public ColorScaleList get() throws MrsPyramidServiceException { log.info("Retrieving color scales file list..."); getService(); List<String> files = service.getColorScales(); log.info("Color scales file list retrieved."); return new ColorScaleList(files); } }
ColorScaleResource { @GET @Produces(MediaType.APPLICATION_JSON) public ColorScaleList get() throws MrsPyramidServiceException { log.info("Retrieving color scales file list..."); getService(); List<String> files = service.getColorScales(); log.info("Color scales file list retrieved."); return new ColorScaleList(files); }  }
ColorScaleResource { @GET @Produces(MediaType.APPLICATION_JSON) public ColorScaleList get() throws MrsPyramidServiceException { log.info("Retrieving color scales file list..."); getService(); List<String> files = service.getColorScales(); log.info("Color scales file list retrieved."); return new ColorScaleList(files); }  @GET @Produces(MediaType.APPLICATION_JSON) ColorScaleList get(); @SuppressFBWarnings(value = "JAXRS_ENDPOINT", justification = "verified") @GET @Produces("image/png") @Path("/{path: .*+}") Response getColorScaleSwatch(@PathParam("path") String colorScalePath,
    @DefaultValue("200") @QueryParam("width") int width,
    @DefaultValue("20") @QueryParam("height") int height
); @SuppressFBWarnings(value = "JAXRS_ENDPOINT", justification = "verified") @GET @Produces("text/html") @Path("/legend/{name: .*+}") Response getColorScaleLegend(@PathParam("name") String name,
    @DefaultValue("20") @QueryParam("width") int width,
    @DefaultValue("200") @QueryParam("height") int height,
    @DefaultValue("0") @QueryParam("min") Double min,
    @QueryParam("max") Double max,
    @DefaultValue("") @QueryParam("units") String units
); }
ColorScaleResource { @GET @Produces(MediaType.APPLICATION_JSON) public ColorScaleList get() throws MrsPyramidServiceException { log.info("Retrieving color scales file list..."); getService(); List<String> files = service.getColorScales(); log.info("Color scales file list retrieved."); return new ColorScaleList(files); }  @GET @Produces(MediaType.APPLICATION_JSON) ColorScaleList get(); @SuppressFBWarnings(value = "JAXRS_ENDPOINT", justification = "verified") @GET @Produces("image/png") @Path("/{path: .*+}") Response getColorScaleSwatch(@PathParam("path") String colorScalePath,
    @DefaultValue("200") @QueryParam("width") int width,
    @DefaultValue("20") @QueryParam("height") int height
); @SuppressFBWarnings(value = "JAXRS_ENDPOINT", justification = "verified") @GET @Produces("text/html") @Path("/legend/{name: .*+}") Response getColorScaleLegend(@PathParam("name") String name,
    @DefaultValue("20") @QueryParam("width") int width,
    @DefaultValue("200") @QueryParam("height") int height,
    @DefaultValue("0") @QueryParam("min") Double min,
    @QueryParam("max") Double max,
    @DefaultValue("") @QueryParam("units") String units
);  }