test_class.file: core/src/test/java/net/adamcin/oakpal/core/checks/ExpectPathsTest.java
test_class.identifier: ExpectPathsTest
test_case.body: @Test
      public void testSuppressAfterExtractViolationIfExpectationSatisfiedAfterSlingInstall_multipleViolators()
              throws Exception {
          final String foo1 = "/foo1";
          final String foo2 = "/foo2";
  
          final PackageId container = PackageId.fromString("container");
          final PackageId embed1 = PackageId.fromString("embed1");
          SlingInstallable installable1 = mock(SlingInstallable.class);
          when(installable1.getParentId()).thenReturn(embed1);
          EmbeddedPackageInstallable epInstallable1 = new EmbeddedPackageInstallable(container, "", embed1);
          final PackageId embed2 = PackageId.fromString("embed2");
          SlingInstallable installable2 = mock(SlingInstallable.class);
          when(installable2.getParentId()).thenReturn(embed2);
          EmbeddedPackageInstallable epInstallable2 = new EmbeddedPackageInstallable(container, "", embed2);
          final PackageId embed3 = PackageId.fromString("embed3");
          SlingInstallable installable3 = mock(SlingInstallable.class);
          when(installable3.getParentId()).thenReturn(embed3);
          EmbeddedPackageInstallable epInstallable3 = new EmbeddedPackageInstallable(container, "", embed3);
  
          final ExpectPaths.Check check1 = checkFor(obj()
                  .key("expectedPaths", arr(foo1, foo2))
                  .key(ExpectPaths.keys().afterPackageIdRules(), arr()
                          .val(new Rule(RuleType.EXCLUDE, Pattern.compile(":container"))))
                  .get());
          new OakpalPlan.Builder(null, null)
                  .withRepoInits(Collections.singletonList(String.format("create path %s", foo1)))
                  .build().toOakMachineBuilder(null, getClass().getClassLoader()).build()
                  .adminInitAndInspect(session -> {
                      check1.startedScan();
                      check1.identifyPackage(container, null);
                      check1.afterExtract(container, session);
                      check1.beforeSlingInstall(container, epInstallable1, session);
                      check1.identifyEmbeddedPackage(embed1, container, epInstallable1);
                      check1.afterExtract(embed1, session);
                      check1.beforeSlingInstall(container, epInstallable2, session);
                      check1.identifyEmbeddedPackage(embed2, container, epInstallable2);
                      check1.afterExtract(embed2, session);
                      check1.beforeSlingInstall(container, epInstallable3, session);
                      check1.identifyEmbeddedPackage(embed3, container, epInstallable3);
                      check1.afterExtract(embed3, session);
                      check1.beforeSlingInstall(container, installable1, session);
                      check1.beforeSlingInstall(container, installable2, session);
                      check1.beforeSlingInstall(container, installable3, session);
                      check1.afterScanPackage(container, session);
                      check1.finishedScan();
                  });
  
          assertEquals("expect 1 expected violation", 1, check1.getReportedViolations().stream().count());
          final Violation exViolation1 = check1.getReportedViolations().stream().findFirst().get();
          assertTrue("starts with expected: " + exViolation1.getDescription(), exViolation1.getDescription().startsWith("expected"));
          assertTrue("ends with /foo2: " + exViolation1.getDescription(), exViolation1.getDescription().endsWith(foo2));
          assertEquals("expected violators",
                  Stream.of(embed1, container).collect(Collectors.toSet()),
                  new HashSet<>(exViolation1.getPackages()));
  
          new OakpalPlan.Builder(null, null)
                  .withRepoInits(Collections.singletonList(String.format("create path %s", foo1)))
                  .build().toOakMachineBuilder(null, getClass().getClassLoader()).build()
                  .adminInitAndInspect(session -> {
                      check1.startedScan();
                      check1.identifyPackage(container, null);
                      check1.afterExtract(container, session);
                      check1.beforeSlingInstall(container, epInstallable1, session);
                      check1.identifyEmbeddedPackage(embed1, container, epInstallable1);
                      JcrUtils.getOrCreateByPath(foo2, "nt:folder", session);
                      check1.afterExtract(embed1, session);
                      check1.beforeSlingInstall(container, epInstallable2, session);
                      check1.identifyEmbeddedPackage(embed2, container, epInstallable2);
                      check1.afterExtract(embed2, session);
                      check1.beforeSlingInstall(container, epInstallable3, session);
                      check1.identifyEmbeddedPackage(embed3, container, epInstallable3);
                      session.getNode(foo2).remove();
                      check1.afterExtract(embed3, session);
                      check1.beforeSlingInstall(container, installable1, session);
                      check1.beforeSlingInstall(container, installable2, session);
                      check1.beforeSlingInstall(container, installable3, session);
                      check1.afterScanPackage(container, session);
                      check1.finishedScan();
                  });
  
          assertEquals("expect 1 expected violation", 1, check1.getReportedViolations().stream().count());
          final Violation exViolation2 = check1.getReportedViolations().stream().findFirst().get();
          assertTrue("starts with expected: " + exViolation2.getDescription(), exViolation2.getDescription().startsWith("expected"));
          assertTrue("ends with /foo2: " + exViolation2.getDescription(), exViolation2.getDescription().endsWith(foo2));
          assertEquals("expected violators",
                  Stream.of(container, embed3).collect(Collectors.toSet()),
                  new HashSet<>(exViolation2.getPackages()));
  
          final ExpectPaths.Check check2 = checkFor(obj()
                  .key("notExpectedPaths", arr(foo1, foo2))
                  //.key(ExpectPaths.keys().afterPackageIdRules(), arr()
                  //        .val(new Rule(RuleType.EXCLUDE, Pattern.compile(":container"))))
                  .get());
          new OakpalPlan.Builder(null, null)
                  .withRepoInits(Collections.singletonList(String.format("create path %s", foo1)))
                  .build().toOakMachineBuilder(null, getClass().getClassLoader()).build()
                  .adminInitAndInspect(session -> {
                      check2.startedScan();
                      check2.identifyPackage(container, null);
                      check2.afterExtract(container, session);
                      check2.beforeSlingInstall(embed1, epInstallable1, session);
                      check2.identifyEmbeddedPackage(embed1, container, epInstallable1);
                      check2.afterExtract(embed1, session);
                      check2.beforeSlingInstall(embed2, epInstallable2, session);
                      check2.identifyEmbeddedPackage(embed2, container, epInstallable2);
                      check2.afterExtract(embed2, session);
                      check2.beforeSlingInstall(embed3, epInstallable3, session);
                      check2.identifyEmbeddedPackage(embed3, container, epInstallable3);
                      check2.afterExtract(embed3, session);
                      check2.beforeSlingInstall(container, installable1, session);
                      check2.beforeSlingInstall(container, installable2, session);
                      check2.beforeSlingInstall(container, installable3, session);
                      check2.afterScanPackage(container, session);
                      check2.finishedScan();
                  });
  
          assertEquals("expect 1 unexpected violation", 1, check2.getReportedViolations().stream().count());
          final Violation unViolation1 = check2.getReportedViolations().stream().findFirst().get();
          assertTrue("starts with unexpected: " + unViolation1.getDescription(), unViolation1.getDescription().startsWith("unexpected"));
          assertTrue("ends with /foo1: " + unViolation1.getDescription(), unViolation1.getDescription().endsWith(foo1));
          assertEquals("expected violators",
                  Stream.of(container).collect(Collectors.toSet()),
                  new HashSet<>(unViolation1.getPackages()));
  
          new OakpalPlan.Builder(null, null)
                  .withRepoInits(Collections.singletonList(String.format("create path %s", foo1)))
                  .build().toOakMachineBuilder(null, getClass().getClassLoader()).build()
                  .adminInitAndInspect(session -> {
                      check2.startedScan();
                      check2.identifyPackage(container, null);
                      session.getNode(foo1).remove();
                      check2.afterExtract(container, session);
                      check2.beforeSlingInstall(embed1, epInstallable1, session);
                      check2.identifyEmbeddedPackage(embed1, container, epInstallable1);
                      JcrUtils.getOrCreateByPath(foo1, "nt:folder", session);
                      check2.afterExtract(embed1, session);
                      check2.beforeSlingInstall(embed2, epInstallable2, session);
                      check2.identifyEmbeddedPackage(embed2, container, epInstallable2);
                      check2.afterExtract(embed2, session);
                      check2.beforeSlingInstall(embed3, epInstallable3, session);
                      check2.identifyEmbeddedPackage(embed3, container, epInstallable3);
                      session.getNode(foo1).remove();
                      check2.afterExtract(embed3, session);
                      check2.beforeSlingInstall(container, installable1, session);
                      check2.beforeSlingInstall(container, installable2, session);
                      JcrUtils.getOrCreateByPath(foo2, "nt:folder", session);
                      check2.appliedRepoInitScripts(container, Collections.emptyList(), installable2, session);
                      check2.beforeSlingInstall(container, installable3, session);
                      check2.afterScanPackage(container, session);
                      check2.finishedScan();
                  });
          assertEquals("expect 2 unexpected violations", 2, check2.getReportedViolations().size());
          final Collection<Violation> unViolations = check2.getReportedViolations();
          assertTrue("all start with unexpected " + unViolations, unViolations.stream()
                  .allMatch(vio -> vio.getDescription().startsWith("unexpected")));
          assertEquals("one ends with /foo1: " + unViolations, 1, unViolations.stream()
                  .filter(vio -> vio.getDescription().endsWith("/foo1")).count());
          assertEquals("one ends with /foo2: " + unViolations, 1, unViolations.stream()
                  .filter(vio -> vio.getDescription().endsWith("/foo2")).count());
          assertEquals("expected violators of /foo1",
                  Stream.of(embed1).collect(Collectors.toSet()), unViolations.stream()
                          .filter(vio -> vio.getDescription().endsWith("/foo1"))
                          .flatMap(Fun.compose1(Violation::getPackages, Collection::stream))
                          .collect(Collectors.toSet()));
          assertEquals("expected violators of /foo2",
                  Stream.of(embed2, container).collect(Collectors.toSet()), unViolations.stream()
                          .filter(vio -> vio.getDescription().endsWith("/foo2"))
                          .flatMap(Fun.compose1(Violation::getPackages, Collection::stream))
                          .collect(Collectors.toSet()));
  
      }
test_case.class_method_signature: ExpectPathsTest.testSuppressAfterExtractViolationIfExpectationSatisfiedAfterSlingInstall_multipleViolators()
test_case.full_signature: @Test public void testSuppressAfterExtractViolationIfExpectationSatisfiedAfterSlingInstall_multipleViolators()
test_case.identifier: testSuppressAfterExtractViolationIfExpectationSatisfiedAfterSlingInstall_multipleViolators
test_case.invocations: fromString fromString mock thenReturn when getParentId fromString mock thenReturn when getParentId fromString mock thenReturn when getParentId checkFor get key key obj arr afterPackageIdRules keys val arr compile adminInitAndInspect build toOakMachineBuilder build withRepoInits singletonList format getClassLoader getClass startedScan identifyPackage afterExtract beforeSlingInstall identifyEmbeddedPackage afterExtract beforeSlingInstall identifyEmbeddedPackage afterExtract beforeSlingInstall identifyEmbeddedPackage afterExtract beforeSlingInstall beforeSlingInstall beforeSlingInstall afterScanPackage finishedScan assertEquals count stream getReportedViolations get findFirst stream getReportedViolations assertTrue getDescription startsWith getDescription assertTrue getDescription endsWith getDescription assertEquals collect of toSet getPackages adminInitAndInspect build toOakMachineBuilder build withRepoInits singletonList format getClassLoader getClass startedScan identifyPackage afterExtract beforeSlingInstall identifyEmbeddedPackage getOrCreateByPath afterExtract beforeSlingInstall identifyEmbeddedPackage afterExtract beforeSlingInstall identifyEmbeddedPackage remove getNode afterExtract beforeSlingInstall beforeSlingInstall beforeSlingInstall afterScanPackage finishedScan assertEquals count stream getReportedViolations get findFirst stream getReportedViolations assertTrue getDescription startsWith getDescription assertTrue getDescription endsWith getDescription assertEquals collect of toSet getPackages checkFor get key obj arr adminInitAndInspect build toOakMachineBuilder build withRepoInits singletonList format getClassLoader getClass startedScan identifyPackage afterExtract beforeSlingInstall identifyEmbeddedPackage afterExtract beforeSlingInstall identifyEmbeddedPackage afterExtract beforeSlingInstall identifyEmbeddedPackage afterExtract beforeSlingInstall beforeSlingInstall beforeSlingInstall afterScanPackage finishedScan assertEquals count stream getReportedViolations get findFirst stream getReportedViolations assertTrue getDescription startsWith getDescription assertTrue getDescription endsWith getDescription assertEquals collect of toSet getPackages adminInitAndInspect build toOakMachineBuilder build withRepoInits singletonList format getClassLoader getClass startedScan identifyPackage remove getNode afterExtract beforeSlingInstall identifyEmbeddedPackage getOrCreateByPath afterExtract beforeSlingInstall identifyEmbeddedPackage afterExtract beforeSlingInstall identifyEmbeddedPackage remove getNode afterExtract beforeSlingInstall beforeSlingInstall getOrCreateByPath appliedRepoInitScripts emptyList beforeSlingInstall afterScanPackage finishedScan assertEquals size getReportedViolations getReportedViolations assertTrue allMatch stream startsWith getDescription assertEquals count filter stream endsWith getDescription assertEquals count filter stream endsWith getDescription assertEquals collect of toSet collect flatMap filter stream endsWith getDescription compose1 toSet assertEquals collect of toSet collect flatMap filter stream endsWith getDescription compose1 toSet
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSuppressAfterExtractViolationIfExpectationSatisfiedAfterSlingInstall_multipleViolators()
focal_class.declarator: KEYS = new JsonKeys() {
          @Override
          public String expectedPaths() {
              return "expectedPaths";
          }
  
          @Override
          public String notExpectedPaths() {
              return "notExpectedPaths";
          }
  
          @Override
          public String afterPackageIdRules() {
              return "afterPackageIdRules";
          }
  
          @Override
          public String severity() {
              return "severity";
          }
      }
focal_class.modifier: private static final
focal_class.original_string: private static final JsonKeys KEYS = new JsonKeys() {
          @Override
          public String expectedPaths() {
              return "expectedPaths";
          }
  
          @Override
          public String notExpectedPaths() {
              return "notExpectedPaths";
          }
  
          @Override
          public String afterPackageIdRules() {
              return "afterPackageIdRules";
          }
  
          @Override
          public String severity() {
              return "severity";
          }
      };
focal_class.type: JsonKeys
focal_class.var_name: KEYS
focal_class.declarator: CONFIG_EXPECTED_PATHS = keys().expectedPaths()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_EXPECTED_PATHS = keys().expectedPaths();
focal_class.type: String
focal_class.var_name: CONFIG_EXPECTED_PATHS
focal_class.declarator: CONFIG_NOT_EXPECTED_PATHS = keys().notExpectedPaths()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_NOT_EXPECTED_PATHS = keys().notExpectedPaths();
focal_class.type: String
focal_class.var_name: CONFIG_NOT_EXPECTED_PATHS
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: CONFIG_SEVERITY = keys().severity()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_SEVERITY = keys().severity();
focal_class.type: String
focal_class.var_name: CONFIG_SEVERITY
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.file: core/src/main/java/net/adamcin/oakpal/core/checks/ExpectPaths.java
focal_class.identifier: ExpectPaths
focal_class.interfaces: implements ProgressCheckFactory
focal_class.class_method_signature: ExpectPaths.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: ExpectPaths.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_method.body: @NotNull
      public static JsonKeys keys() {
          return KEYS;
      }
focal_method.class_method_signature: ExpectPaths.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()