/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
* (c) 2014 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
*/
package org.geoserver.rest.security;
import java.util.HashMap;
import java.util.Map;
import org.custommonkey.xmlunit.SimpleNamespaceContext;
import org.custommonkey.xmlunit.XMLUnit;
import org.custommonkey.xmlunit.XpathEngine;
import org.geoserver.data.test.SystemTestData;
import org.geoserver.test.GeoServerSystemTestSupport;
import org.junit.Before;
public abstract class SecurityRESTTestSupport extends GeoServerSystemTestSupport {
protected static XpathEngine xp;
@Override
protected void onSetUp(SystemTestData testData) throws Exception {
super.onSetUp(testData);
Map<String, String> namespaces = new HashMap<>();
namespaces.put("html", "http://www.w3.org/1999/xhtml");
namespaces.put("sld", "http://www.opengis.net/sld");
namespaces.put("ogc", "http://www.opengis.net/ogc");
namespaces.put("atom", "http://www.w3.org/2005/Atom");
XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));
xp = XMLUnit.newXpathEngine();
}
@Before
public void login() throws Exception {
login("admin", "geoserver", "ROLE_ADMINISTRATOR");
}
}