Skip to content

Commit

Permalink
Restore CachingTileLayerCatalog.getLayerIds()
Browse files Browse the repository at this point in the history
  • Loading branch information
groldan committed Nov 4, 2024
1 parent 48b6d30 commit e4384e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ public void onTileLayerEvent(TileLayerEvent event) {
}
}

@Override
public Set<String> getLayerIds() {
return Set.copyOf(this.namesById.keySet());
}

@Override
public Set<String> getLayerNames() {
return Set.copyOf(this.namesById.values());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,26 @@ public void onEvent(String layerId, Type type) {
assertThat(caching.namesById.get("tl1")).isNull();
}

@Test
public void getLayerIds() {
add(catalog, "tl1");
add(catalog, "tl2");
assertThat(caching.getLayerIds()).isEmpty();
caching.initialize();
assertThat(caching.getLayerIds()).isEqualTo(catalog.getLayerIds());
add(caching, "tl3");
assertThat(caching.getLayerIds()).isEqualTo(catalog.getLayerIds());
}

@Test
public void getLayerNames() {
add(catalog, "tl1");
add(catalog, "tl2");
assertThat(caching.getLayerNames()).isEmpty();
caching.initialize();
assertThat(caching.getLayerNames()).isEqualTo(catalog.getLayerNames());
add(caching, "tl3");
assertThat(caching.getLayerNames()).isEqualTo(catalog.getLayerNames());
}

@Test
Expand Down

0 comments on commit e4384e3

Please sign in to comment.