+ }
+
+ @Test
+ public void testMethods() throws ServletException, IOException, PAPException {
+ XACMLPapServlet servlet = new XACMLPapServlet();
+
+ ObjectMapper mapper = new ObjectMapper();
+ HttpServletResponse response = new MockHttpServletResponse();
+ assertThatCode(() -> XACMLPapServlet.mapperWriteValue(mapper, response, "hello")).doesNotThrowAnyException();
+ assertThatCode(() -> XACMLPapServlet.mapperWriteValue(null, null, null)).doesNotThrowAnyException();
+ assertNull(XACMLPapServlet.getPapUrl());
+
+ HttpServletRequest request = new MockHttpServletRequest();
+ assertThatThrownBy(() -> servlet.doDelete(request, response)).isInstanceOf(NullPointerException.class);
+
+ StringBuffer urlPath = new StringBuffer("http://foo");
+ Properties policies = new Properties();
+ servlet.populatePolicyURL(urlPath, policies);
+ assertNull(policies.getProperty("foo.url"));
+
+ policies.setProperty(XACMLProperties.PROP_ROOTPOLICIES, "foo");
+ policies.setProperty(XACMLProperties.PROP_REFERENCEDPOLICIES, "bar");
+ servlet.populatePolicyURL(urlPath, policies);
+ assertEquals("http://foo?id=foo", policies.getProperty("foo.url"));
+ }