test_class.declarator: resolver = new DefaultNamePathResolver(JsonCnd.BUILTIN_MAPPINGS)
test_class.modifier: private final
test_class.original_string: private final NamePathResolver resolver = new DefaultNamePathResolver(JsonCnd.BUILTIN_MAPPINGS);
test_class.type: NamePathResolver
test_class.var_name: resolver
test_class.declarator: emptyPrivileges = new Privilege[0]
test_class.modifier: static final
test_class.original_string: static final Privilege[] emptyPrivileges = new Privilege[0];
test_class.type: Privilege[]
test_class.var_name: emptyPrivileges
test_class.file: core/src/test/java/net/adamcin/oakpal/core/checks/ExpectAcesTest.java
test_class.identifier: ExpectAcesTest
test_case.body: @Test
      public void testCheck_startedScan() throws Exception {
          ExpectAces.Check check = checkFor(obj()
                  .key(ExpectAces.keys().principal(), "nouser")
                  .key(ExpectAces.keys().expectedAces(), arr()
                          .val("type=allow;path=/foo1;privileges=jcr:read")
                          .val("type=allow;path=/foo1;privileges=rep:write")
                  )
                  .key(ExpectAces.keys().notExpectedAces(), arr()
                          .val("type=allow;path=/foo2;privileges=jcr:read")
                          .val("type=allow;path=/foo2;privileges=rep:write")
                          // foo3 is not created. a non-existent path should satisfy not-expected aces
                          .val("type=allow;path=/foo3;privileges=rep:write")
                  )
                  .get());
  
          final Principal principal = new PrincipalImpl("nouser");
          new OakMachine.Builder().build().adminInitAndInspect(session -> {
              final JackrabbitAccessControlManager accessControlManager =
                      (JackrabbitAccessControlManager) session.getAccessControlManager();
              final PrivilegeManager privilegeManager = ((JackrabbitWorkspace) session.getWorkspace()).getPrivilegeManager();
              final Privilege jcrRead = privilegeManager.getPrivilege("jcr:read");
  
              final Node foo1 = session.getRootNode().addNode("foo1", resolver.getJCRName(NameConstants.NT_FOLDER));
              foo1.addMixin("rep:AccessControllable");
              final Node foo2 = session.getRootNode().addNode("foo2", resolver.getJCRName(NameConstants.NT_FOLDER));
              foo2.addMixin("rep:AccessControllable");
              session.save();
  
              for (String path : new String[]{"/foo1", "/foo2"}) {
                  for (AccessControlPolicyIterator policyIt = accessControlManager.getApplicablePolicies(path); policyIt.hasNext(); ) {
                      AccessControlPolicy policy = policyIt.nextAccessControlPolicy();
                      if (policy instanceof JackrabbitAccessControlList) {
                          JackrabbitAccessControlList acl = (JackrabbitAccessControlList) policy;
                          acl.addEntry(principal, new Privilege[]{jcrRead}, true);
                          accessControlManager.setPolicy(path, acl);
                      }
                  }
              }
  
              check.afterExtract(PackageId.fromString("foo"), session);
              check.startedScan();
              check.afterExtract(PackageId.fromString("foo"), session);
              check.afterExtract(PackageId.fromString("foo"), session);
              check.finishedScan();
          });
  
          Assert.assertEquals("expected violation count", 1, check.getReportedViolations().stream().filter(viol -> viol.getDescription().startsWith("expected: ")).count());
          Assert.assertEquals("expected violated spec ends with rep:write", 1,
                  check.getReportedViolations().stream()
                          .filter(viol -> viol.getDescription().startsWith("expected: ")
                                  && viol.getDescription().endsWith("rep:write")).count());
          Assert.assertEquals("unexpected violation count", 1, check.getReportedViolations().stream().filter(viol -> viol.getDescription().startsWith("unexpected: ")).count());
          Assert.assertEquals("unexpected violated spec ends with jcr:read", 1,
                  check.getReportedViolations().stream()
                          .filter(viol -> viol.getDescription().startsWith("unexpected: ")
                                  && viol.getDescription().endsWith("jcr:read")).count());
      }
test_case.class_method_signature: ExpectAcesTest.testCheck_startedScan()
test_case.full_signature: @Test public void testCheck_startedScan()
test_case.identifier: testCheck_startedScan
test_case.invocations: checkFor get key key key obj principal keys expectedAces keys val val arr notExpectedAces keys val val val arr adminInitAndInspect build getAccessControlManager getPrivilegeManager getWorkspace getPrivilege addNode getRootNode getJCRName addMixin addNode getRootNode getJCRName addMixin save getApplicablePolicies hasNext nextAccessControlPolicy addEntry setPolicy afterExtract fromString startedScan afterExtract fromString afterExtract fromString finishedScan assertEquals count filter stream getReportedViolations startsWith getDescription assertEquals count filter stream getReportedViolations startsWith getDescription endsWith getDescription assertEquals count filter stream getReportedViolations startsWith getDescription assertEquals count filter stream getReportedViolations startsWith getDescription endsWith getDescription
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCheck_startedScan()
focal_class.declarator: KEYS = new JsonKeys() {
          @Override
          public String principal() {
              return "principal";
          }
  
          @Override
          public String principals() {
              return "principals";
          }
  
          @Override
          public String expectedAces() {
              return "expectedAces";
          }
  
          @Override
          public String notExpectedAces() {
              return "notExpectedAces";
          }
  
          @Override
          public String afterPackageIdRules() {
              return "afterPackageIdRules";
          }
  
          @Override
          public String severity() {
              return "severity";
          }
  
          @Override
          public String type() {
              return "type";
          }
  
          @Override
          public String privileges() {
              return "privileges";
          }
  
          @Override
          public String path() {
              return "path";
          }
      }
focal_class.modifier: private static final
focal_class.original_string: private static final JsonKeys KEYS = new JsonKeys() {
          @Override
          public String principal() {
              return "principal";
          }
  
          @Override
          public String principals() {
              return "principals";
          }
  
          @Override
          public String expectedAces() {
              return "expectedAces";
          }
  
          @Override
          public String notExpectedAces() {
              return "notExpectedAces";
          }
  
          @Override
          public String afterPackageIdRules() {
              return "afterPackageIdRules";
          }
  
          @Override
          public String severity() {
              return "severity";
          }
  
          @Override
          public String type() {
              return "type";
          }
  
          @Override
          public String privileges() {
              return "privileges";
          }
  
          @Override
          public String path() {
              return "path";
          }
      };
focal_class.type: JsonKeys
focal_class.var_name: KEYS
focal_class.declarator: CONFIG_PRINCIPAL = keys().principal()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_PRINCIPAL = keys().principal();
focal_class.type: String
focal_class.var_name: CONFIG_PRINCIPAL
focal_class.declarator: CONFIG_PRINCIPALS = keys().principals()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_PRINCIPALS = keys().principals();
focal_class.type: String
focal_class.var_name: CONFIG_PRINCIPALS
focal_class.declarator: CONFIG_EXPECTED_ACES = keys().expectedAces()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_EXPECTED_ACES = keys().expectedAces();
focal_class.type: String
focal_class.var_name: CONFIG_EXPECTED_ACES
focal_class.declarator: CONFIG_NOT_EXPECTED_ACES = keys().notExpectedAces()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_NOT_EXPECTED_ACES = keys().notExpectedAces();
focal_class.type: String
focal_class.var_name: CONFIG_NOT_EXPECTED_ACES
focal_class.declarator: CONFIG_AFTER_PACKAGE_ID_RULES = keys().afterPackageIdRules()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_AFTER_PACKAGE_ID_RULES = keys().afterPackageIdRules();
focal_class.type: String
focal_class.var_name: CONFIG_AFTER_PACKAGE_ID_RULES
focal_class.declarator: ACE_PARAM_TYPE = keys().type()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String ACE_PARAM_TYPE = keys().type();
focal_class.type: String
focal_class.var_name: ACE_PARAM_TYPE
focal_class.declarator: ACE_PARAM_PRIVILEGES = keys().privileges()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String ACE_PARAM_PRIVILEGES = keys().privileges();
focal_class.type: String
focal_class.var_name: ACE_PARAM_PRIVILEGES
focal_class.declarator: ACE_PARAM_PATH = keys().path()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String ACE_PARAM_PATH = keys().path();
focal_class.type: String
focal_class.var_name: ACE_PARAM_PATH
focal_class.declarator: LOGGER = LoggerFactory.getLogger(ExpectAces.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(ExpectAces.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: DEFAULT_SEVERITY = Severity.MAJOR
focal_class.modifier: static final
focal_class.original_string: static final Severity DEFAULT_SEVERITY = Severity.MAJOR;
focal_class.type: Severity
focal_class.var_name: DEFAULT_SEVERITY
focal_class.declarator: DELIM_PARAM = ";"
focal_class.modifier: public static final
focal_class.original_string: public static final String DELIM_PARAM = ";";
focal_class.type: String
focal_class.var_name: DELIM_PARAM
focal_class.declarator: DELIM_VALUE = "="
focal_class.modifier: public static final
focal_class.original_string: public static final String DELIM_VALUE = "=";
focal_class.type: String
focal_class.var_name: DELIM_VALUE
focal_class.declarator: DELIM_LIST = ","
focal_class.modifier: public static final
focal_class.original_string: public static final String DELIM_LIST = ",";
focal_class.type: String
focal_class.var_name: DELIM_LIST
focal_class.file: core/src/main/java/net/adamcin/oakpal/core/checks/ExpectAces.java
focal_class.identifier: ExpectAces
focal_class.interfaces: implements ProgressCheckFactory
focal_class.class_method_signature: ExpectAces.keys()
focal_class.full_signature: @NotNull public static JsonKeys keys()
focal_class.identifier: keys
focal_class.modifiers: @NotNull public static
focal_class.parameters: ()
focal_class.return: JsonKeys
focal_class.signature: JsonKeys keys()
focal_class.class_method_signature: ExpectAces.newInstance(final JsonObject config)
focal_class.full_signature: @Override public ProgressCheck newInstance(final JsonObject config)
focal_class.identifier: newInstance
focal_class.modifiers: @Override public
focal_class.parameters: (final JsonObject config)
focal_class.return: ProgressCheck
focal_class.signature: ProgressCheck newInstance(final JsonObject config)
focal_class.class_method_signature: ExpectAces.isPrincipalSpec(final @NotNull String spec)
focal_class.full_signature: static boolean isPrincipalSpec(final @NotNull String spec)
focal_class.identifier: isPrincipalSpec
focal_class.modifiers: static
focal_class.parameters: (final @NotNull String spec)
focal_class.return: boolean
focal_class.signature: boolean isPrincipalSpec(final @NotNull String spec)
focal_class.class_method_signature: ExpectAces.isGeneralSpec(final @NotNull String spec)
focal_class.full_signature: static boolean isGeneralSpec(final @NotNull String spec)
focal_class.identifier: isGeneralSpec
focal_class.modifiers: static
focal_class.parameters: (final @NotNull String spec)
focal_class.return: boolean
focal_class.signature: boolean isGeneralSpec(final @NotNull String spec)
focal_class.class_method_signature: ExpectAces.parseAceCriteria(final @NotNull JsonObject config,
                                                final @NotNull String[] principals,
                                                final @NotNull String key)
focal_class.full_signature: static List<AceCriteria> parseAceCriteria(final @NotNull JsonObject config,
                                                final @NotNull String[] principals,
                                                final @NotNull String key)
focal_class.identifier: parseAceCriteria
focal_class.modifiers: static
focal_class.parameters: (final @NotNull JsonObject config,
                                                final @NotNull String[] principals,
                                                final @NotNull String key)
focal_class.return: List<AceCriteria>
focal_class.signature: List<AceCriteria> parseAceCriteria(final @NotNull JsonObject config,
                                                final @NotNull String[] principals,
                                                final @NotNull String key)
focal_class.class_method_signature: ExpectAces.restrictionMatcher(final @NotNull JackrabbitAccessControlList acl,
                         final @NotNull RestrictionCriteria[] restrictionCriterias)
focal_class.full_signature: static Predicate<JackrabbitAccessControlEntry> restrictionMatcher(final @NotNull JackrabbitAccessControlList acl,
                         final @NotNull RestrictionCriteria[] restrictionCriterias)
focal_class.identifier: restrictionMatcher
focal_class.modifiers: static
focal_class.parameters: (final @NotNull JackrabbitAccessControlList acl,
                         final @NotNull RestrictionCriteria[] restrictionCriterias)
focal_class.return: Predicate<JackrabbitAccessControlEntry>
focal_class.signature: Predicate<JackrabbitAccessControlEntry> restrictionMatcher(final @NotNull JackrabbitAccessControlList acl,
                         final @NotNull RestrictionCriteria[] restrictionCriterias)
focal_method.body: @NotNull
      public static JsonKeys keys() {
          return KEYS;
      }
focal_method.class_method_signature: ExpectAces.keys()
focal_method.full_signature: @NotNull public static JsonKeys keys()
focal_method.identifier: keys
focal_method.modifiers: @NotNull public static
focal_method.parameters: ()
focal_method.return: JsonKeys
focal_method.signature: JsonKeys keys()