test_class.file: core/src/test/java/net/adamcin/oakpal/core/checks/SubpackagesTest.java
test_class.identifier: SubpackagesTest
test_class.superclass: extends ProgressCheckTestBase
test_case.body: @Test
      public void testPatterns() throws Exception {
          TestUtil.testBlock(() -> {
              ProgressCheck check = new Subpackages().newInstance(key("rules", arr()).get());
              CheckReport report = scanWithCheck(check, "subtest_with_content.zip");
              logViolations("testPatterns:[]", report);
              Assert.assertEquals("no violations", 0, report.getViolations().size());
              assertTrue("all violations have packageIds", report.getViolations().stream()
                      .allMatch(viol -> !viol.getPackages().isEmpty()));
          });
          TestUtil.testBlock(() -> {
              ProgressCheck check = new Subpackages().newInstance(
                      key("rules", arr(key("type", "deny").key("pattern", "my_packages:sub_.*"))).get());
              CheckReport report = scanWithCheck(check, "subtest_with_content.zip");
              logViolations("testPatterns:sub_.*", report);
              Assert.assertEquals("two violations", 2, report.getViolations().size());
              assertTrue("all violations have packageIds", report.getViolations().stream()
                      .allMatch(viol -> !viol.getPackages().isEmpty()));
          });
          TestUtil.testBlock(() -> {
              ProgressCheck check = new Subpackages().newInstance(
                      key("rules", arr()
                              .val(key("type", "deny").key("pattern", "my_packages:sub_.*"))
                              .val(key("type", "allow").key("pattern", "my_packages:sub_a"))
                      ).get());
              CheckReport report = scanWithCheck(check, "subtest_with_content.zip");
              logViolations("testPatterns:sub_.* - sub_a", report);
              Assert.assertEquals("one violation", 1, report.getViolations().size());
              assertTrue("all violations have packageIds", report.getViolations().stream()
                      .allMatch(viol -> !viol.getPackages().isEmpty()));
          });
          TestUtil.testBlock(() -> {
              ProgressCheck check = new Subpackages().newInstance(
                      key("rules", arr(key("type", "deny").key("pattern", "my_packages:sub_a"))).get());
              CheckReport report = scanWithCheck(check, "subtest_with_content.zip");
              logViolations("testPatterns:sub_a", report);
              Assert.assertEquals("one violation", 1, report.getViolations().size());
              assertTrue("all violations have packageIds", report.getViolations().stream()
                      .allMatch(viol -> !viol.getPackages().isEmpty()));
          });
          TestUtil.testBlock(() -> {
              ProgressCheck check = new Subpackages().newInstance(
                      key("rules", arr(key("type", "deny").key("pattern", "my_packages:sub_b"))).get());
              CheckReport report = scanWithCheck(check, "subtest_with_content.zip");
              logViolations("testPatterns:sub_b", report);
              Assert.assertEquals("one violation", 1, report.getViolations().size());
              assertTrue("all violations have packageIds", report.getViolations().stream()
                      .allMatch(viol -> !viol.getPackages().isEmpty()));
          });
          TestUtil.testBlock(() -> {
              ProgressCheck check = new Subpackages().newInstance(
                      key("rules", arr(key("type", "deny").key("pattern", "my_packages:sub_c"))).get());
              CheckReport report = scanWithCheck(check, "subtest_with_content.zip");
              logViolations("testPatterns:sub_c", report);
              Assert.assertEquals("one violation", 0, report.getViolations().size());
              assertTrue("all violations have packageIds", report.getViolations().stream()
                      .allMatch(viol -> !viol.getPackages().isEmpty()));
          });
      }
test_case.class_method_signature: SubpackagesTest.testPatterns()
test_case.full_signature: @Test public void testPatterns()
test_case.identifier: testPatterns
test_case.invocations: testBlock newInstance get key arr scanWithCheck logViolations assertEquals size getViolations assertTrue allMatch stream getViolations isEmpty getPackages testBlock newInstance get key arr key key scanWithCheck logViolations assertEquals size getViolations assertTrue allMatch stream getViolations isEmpty getPackages testBlock newInstance get key val val arr key key key key scanWithCheck logViolations assertEquals size getViolations assertTrue allMatch stream getViolations isEmpty getPackages testBlock newInstance get key arr key key scanWithCheck logViolations assertEquals size getViolations assertTrue allMatch stream getViolations isEmpty getPackages testBlock newInstance get key arr key key scanWithCheck logViolations assertEquals size getViolations assertTrue allMatch stream getViolations isEmpty getPackages testBlock newInstance get key arr key key scanWithCheck logViolations assertEquals size getViolations assertTrue allMatch stream getViolations isEmpty getPackages
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPatterns()
focal_class.declarator: KEYS = new JsonKeys() {
          @Override
          public String rules() {
              return "rules";
          }
  
          @Override
          public String denyAll() {
              return "denyAll";
          }
      }
focal_class.modifier: private static final
focal_class.original_string: private static final JsonKeys KEYS = new JsonKeys() {
          @Override
          public String rules() {
              return "rules";
          }
  
          @Override
          public String denyAll() {
              return "denyAll";
          }
      };
focal_class.type: JsonKeys
focal_class.var_name: KEYS
focal_class.declarator: CONFIG_RULES = keys().rules()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_RULES = keys().rules();
focal_class.type: String
focal_class.var_name: CONFIG_RULES
focal_class.declarator: CONFIG_DENY_ALL = keys().denyAll()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_DENY_ALL = keys().denyAll();
focal_class.type: String
focal_class.var_name: CONFIG_DENY_ALL
focal_class.file: core/src/main/java/net/adamcin/oakpal/core/checks/Subpackages.java
focal_class.identifier: Subpackages
focal_class.interfaces: implements ProgressCheckFactory
focal_class.class_method_signature: Subpackages.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: Subpackages.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: @Override
      public ProgressCheck newInstance(final JsonObject config) {
          List<Rule> rules = Rules.fromJsonArray(arrayOrEmpty(config, keys().rules()));
  
          final boolean denyAll = hasNonNull(config, keys().denyAll()) && config.getBoolean(keys().denyAll());
  
          return new Check(rules, denyAll);
      }
focal_method.class_method_signature: Subpackages.newInstance(final JsonObject config)
focal_method.full_signature: @Override public ProgressCheck newInstance(final JsonObject config)
focal_method.identifier: newInstance
focal_method.invocations: fromJsonArray arrayOrEmpty rules keys hasNonNull denyAll keys getBoolean denyAll keys
focal_method.modifiers: @Override public
focal_method.parameters: (final JsonObject config)
focal_method.return: ProgressCheck
focal_method.signature: ProgressCheck newInstance(final JsonObject config)