Esempio n. 1
0
 @Test
 public void testWithDefaultMappings() {
   PrefixMapping pm = new PrefixMappingImpl();
   pm.setNsPrefix("example", "http://example.com");
   try {
     // make sure that it must update
     securedMapping.withDefaultMappings(pm);
     if (!securityEvaluator.evaluate(Action.Update, securedMapping.getModelNode())) {
       Assert.fail("Should have thrown AccessDenied Exception");
     }
   } catch (final AccessDeniedException e) {
     if (securityEvaluator.evaluate(Action.Update, securedMapping.getModelNode())) {
       Assert.fail(
           String.format(
               "Should not have thrown AccessDenied Exception: %s - %s", e, e.getTriple()));
     }
   }
 }