private Set<String> containerNamesForGroup(LayerGroupInfo lg) { Collection<LayerGroupSummary> summaries = cc.getContainerGroupsFor(lg); return summaries.stream().map(gs -> gs.prefixedName()).collect(Collectors.toSet()); }
private Set<String> containerNamesForResource(QName name) { Collection<LayerGroupSummary> summaries = cc.getContainerGroupsFor(getResource(name)); return summaries.stream().map(gs -> gs.prefixedName()).collect(Collectors.toSet()); }
groupsCache.getContainerGroupsFor(layerGroup); if (directContainers.isEmpty()) { allowAccess = true;
Collection<LayerGroupSummary> containers = groupsCache.getContainerGroupsFor(resource); if (containers.isEmpty()) { return rulesAllowAccess;
@Test public void testInitialSetup() throws Exception { // nature Collection<LayerGroupSummary> natureContainers = cc.getContainerGroupsFor(nature); assertEquals(1, natureContainers.size()); assertThat(natureContainers, contains(new LayerGroupSummary(container))); LayerGroupSummary summary = natureContainers.iterator().next(); assertNull(summary.getWorkspace()); assertEquals(CONTAINER_GROUP, summary.getName()); assertThat(summary.getContainerGroups(), empty()); // container has no contaning groups assertThat(cc.getContainerGroupsFor(container), empty()); // now check the groups containing the layers (nature being SINGLE, not a container) assertThat(containerNamesForResource(MockData.LAKES), equalTo(set(CONTAINER_GROUP))); assertThat(containerNamesForResource(MockData.FORESTS), equalTo(set(CONTAINER_GROUP))); assertThat( containerNamesForResource(MockData.ROAD_SEGMENTS), equalTo(set(CONTAINER_GROUP))); }