groupWriter.addLayer("topp:cities");
assertTrue(publisher.createLayerGroup("topp", groupName, groupWriter));
// Test exists
assertTrue(reader.existsLayerGroup("topp", groupName));
try {
RESTLayerGroup groupReader = reader.getLayerGroup("topp", groupName);
assertEquals("topp", groupReader.getWorkspace());
assertEquals(groupName, groupReader.getName());
RESTPublishedList publishedList = groupReader.getPublishedList();
if (publishedList != null) {
// GeoServer >= 2.3
assertEquals(2, publishedList.size());
for (RESTPublished published : publishedList) {
assertEquals("layer", published.getType());
assertTrue("boundaries".equals(published.getName()) || "cities".equals(published.getName()));
}
} else {
RESTLayerList layerList = groupReader.getLayerList();
assertEquals(2, layerList.size());
for (NameLinkElem layer : layerList) {
assertTrue("boundaries".equals(layer.getName()) || "cities".equals(layer.getName()));
}
}