Document doc = getAsDOM("wms?service=WMS&request=getCapabilities&version=1.3.0", true);
assertXpathEvaluatesTo("0", "count(//wms:Attribution)", doc);
// Add attribution to one of the layers
LayerInfo points = getCatalog().getLayerByName(MockData.POINTS.getLocalPart());
AttributionInfo attr = points.getAttribution();
attr.setTitle("Point Provider");
getCatalog().save(points);
doc = getAsDOM("wms?service=WMS&request=getCapabilities&version=1.3.0", true);
assertXpathEvaluatesTo("1", "count(//wms:Attribution)", doc);
assertXpathEvaluatesTo("1", "count(//wms:Attribution/wms:Title)", doc);
// Add href to same layer
attr = points.getAttribution();
attr.setHref("http://example.com/points/provider");
getCatalog().save(points);
doc = getAsDOM("wms?service=WMS&request=getCapabilities&version=1.3.0", true);
// print(doc);
assertXpathEvaluatesTo("1", "count(//wms:Attribution)", doc);
assertXpathEvaluatesTo("1", "count(//wms:Attribution/wms:Title)", doc);
assertXpathEvaluatesTo("1", "count(//wms:Attribution/wms:OnlineResource)", doc);
// Add logo to same layer
attr = points.getAttribution();
attr.setLogoURL("http://example.com/points/logo");
attr.setLogoType("image/logo");
attr.setLogoHeight(50);
attr.setLogoWidth(50);
getCatalog().save(points);
doc = getAsDOM("wms?service=WMS&request=getCapabilities&version=1.3.0", true);
// print(doc);
assertXpathEvaluatesTo("1", "count(//wms:Attribution)", doc);