/** * Helper method that get layer legends info by merging deprecated legends info objects with the * new ones. */ private Map<String, LegendInfo> getLegendsInfo(TileLayer layer) { Map<String, LegendInfo> legendsInfo = new HashMap<>(); for (Map.Entry<String, TileLayer.LegendInfo> entry : layer.getLegendsInfo().entrySet()) { // convert deprecated model to new model legendsInfo.put( entry.getKey(), new LegendInfoBuilder() .withWidth(entry.getValue().width) .withHeight(entry.getValue().height) .withFormat(entry.getValue().format) .withCompleteUrl(entry.getValue().legendUrl) .withStyleName(entry.getKey()) .build()); } // add the new legend info model objects legendsInfo.putAll(layer.getLayerLegendsInfo()); return legendsInfo; }
Map<String, LegendInfo> legendsInfo = layer.getLayerLegendsInfo(); for (String format : formats) { for (String style : styles) {
.withMaxScale(10000D) .build(); when(tileLayer.getLayerLegendsInfo()) .thenReturn(Collections.singletonMap("style-b", legendInfo2));
.withMaxScale(10000D) .build(); when(tileLayer.getLayerLegendsInfo()) .thenReturn(Collections.singletonMap("style-b", legendInfo2));