ThreadScopeContextHolder.clear();
}
@Test
public void testRasterizeFromCache() throws Exception {
InternalTile tile;
// create metadata
GetVectorTileRequest metadata = new GetVectorTileRequest();
metadata.setCode(new TileCode(4, 8, 8));
metadata.setCrs("EPSG:4326");
metadata.setLayerId(layerBeans.getId());
metadata.setPanOrigin(new Coordinate(0, 0));
metadata.setScale(16);
metadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
metadata.setStyleInfo(layerBeansStyleInfo);
metadata.setPaintLabels(false);
metadata.setPaintGeometries(true);
// get tile
recorder.clear();
tile = vectorLayerService.getTile(metadata);
Assert.assertEquals("", recorder.matches(CacheCategory.RASTER));
// find the key
String url = tile.getFeatureContent();
Assert.assertTrue(url.startsWith("http://test/rasterizing/layer/beans/"));
Assert.assertTrue(url.contains("?"));
String key = url.substring("http://test/rasterizing/layer/beans/".length(), url.indexOf(".png"));
Object o = cacheManager.get(layerBeans, CacheCategory.REBUILD, key);
Assert.assertNotNull("Missing rebuild data in cache", o);