### Question:
ArcGISTileEnvoy extends XYZTileEnvoy { @Override protected Date getExpirationTime(DataModelCategory category) { ArcGISDataGroupInfo group = myProvider.getDataGroup(category); Date expiration = super.getExpirationTime(category); if (group != null && !group.getLayer().isSingleFusedMapCache()) { expiration = CacheDeposit.SESSION_END; } return expiration; } ArcGISTileEnvoy(Toolbox toolbox); @Override boolean providesDataFor(DataModelCategory category);  }### Answer:
@Test public void testGetExpirationTimeExport() { 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, "export"); Date expirationTime = envoy.getExpirationTime(yes); assertEquals(CacheDeposit.SESSION_END, expirationTime); support.verifyAll(); }
@Test public void testGetExpirationTimeXYZ() { 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, "xyz"); Date expirationTime = envoy.getExpirationTime(yes); assertTrue(expirationTime.getTime() > new Date().getTime()); assertTrue(expirationTime != CacheDeposit.SESSION_END); support.verifyAll(); }