### Question:
ArcGISTileEnvoy extends XYZTileEnvoy { @Override protected String buildImageUrlString(DataModelCategory category, ZYXImageKey key) { String urlString = null; ArcGISDataGroupInfo group = myProvider.getDataGroup(category); if (group != null) { TileUrlBuilder builder = TileUrlBuilderFactory.getInstance().createBuilder(group.getLayer()); urlString = builder.buildUrl(category, key); } else { LOGGER.error("Unable to find data group for category " + category); } return urlString; } ArcGISTileEnvoy(Toolbox toolbox); @Override boolean providesDataFor(DataModelCategory category);  }### Answer:
@Test public void testBuildImageUrlExport() { EasyMockSupport support = new EasyMockSupport(); DataGroupController controller = support.createMock(DataGroupController.class); Toolbox toolbox = createToolbox(support, controller); ArcGISDataGroupInfo exportGroup = createExport(toolbox); addControllerMock(controller, exportGroup); support.replayAll(); ArcGISTileEnvoy envoy = new ArcGISTileEnvoy(toolbox); DataModelCategory yes = new DataModelCategory("arcgis", XYZTileUtils.TILES_FAMILY, exportGroup.getURL()); ZYXImageKey key = new ZYXImageKey(0, 1, 2, new GeographicBoundingBox(LatLonAlt.createFromDegrees(0, 0), LatLonAlt.createFromDegrees(1, 1))); String urlString = envoy.buildImageUrlString(yes, key); assertTrue(urlString.contains("/export?")); support.verifyAll(); }
@Test public void testBuildImageUrlXYZ() { EasyMockSupport support = new EasyMockSupport(); DataGroupController controller = support.createMock(DataGroupController.class); Toolbox toolbox = createToolbox(support, controller); ArcGISDataGroupInfo xyzGroup = createXYZ(toolbox); addControllerMock(controller, xyzGroup); support.replayAll(); ArcGISTileEnvoy envoy = new ArcGISTileEnvoy(toolbox); DataModelCategory yes = new DataModelCategory("arcgis", XYZTileUtils.TILES_FAMILY, xyzGroup.getURL()); ZYXImageKey key = new ZYXImageKey(0, 1, 2, null); String urlString = envoy.buildImageUrlString(yes, key); assertTrue(urlString.endsWith("/tile/0/1/2")); support.verifyAll(); }