test_class.file: core/src/test/java/net/adamcin/oakpal/core/checks/FilterSetsTest.java
test_class.identifier: FilterSetsTest
test_class.superclass: extends ProgressCheckTestBase
test_case.body: @Test
      public void testRootImport() throws Exception {
          TestUtil.testBlock(() -> {
              ProgressCheck handler = new FilterSets().newInstance(obj().get());
              CheckReport report = scanWithCheck(handler, "testrootimport.zip");
              Assert.assertEquals("one violation", 1, report.getViolations().size());
              assertTrue("all violations have packageIds", report.getViolations().stream()
                      .allMatch(viol -> !viol.getPackages().isEmpty()));
          });
  
          TestUtil.testBlock(() -> {
              ProgressCheck handler = new FilterSets().newInstance(key("allowRootFilter", true).get());
  
              CheckReport report = scanWithCheck(handler, "testrootimport.zip");
              Assert.assertEquals("no violations", 0, report.getViolations().size());
              assertTrue("all violations have packageIds", report.getViolations().stream()
                      .allMatch(viol -> !viol.getPackages().isEmpty()));
          });
      }
test_case.class_method_signature: FilterSetsTest.testRootImport()
test_case.full_signature: @Test public void testRootImport()
test_case.identifier: testRootImport
test_case.invocations: testBlock newInstance get obj scanWithCheck assertEquals size getViolations assertTrue allMatch stream getViolations isEmpty getPackages testBlock newInstance get key scanWithCheck 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 testRootImport()
focal_class.declarator: KEYS = new JsonKeys() {
          @Override
          public String importModeSeverity() {
              return "importModeSeverity";
          }
  
          @Override
          public String allowEmptyFilter() {
              return "allowEmptyFilter";
          }
  
          @Override
          public String allowRootFilter() {
              return "allowRootFilter";
          }
      }
focal_class.modifier: private static final
focal_class.original_string: private static final JsonKeys KEYS = new JsonKeys() {
          @Override
          public String importModeSeverity() {
              return "importModeSeverity";
          }
  
          @Override
          public String allowEmptyFilter() {
              return "allowEmptyFilter";
          }
  
          @Override
          public String allowRootFilter() {
              return "allowRootFilter";
          }
      };
focal_class.type: JsonKeys
focal_class.var_name: KEYS
focal_class.declarator: CONFIG_IMPORT_MODE_SEVERITY = keys().importModeSeverity()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_IMPORT_MODE_SEVERITY = keys().importModeSeverity();
focal_class.type: String
focal_class.var_name: CONFIG_IMPORT_MODE_SEVERITY
focal_class.declarator: CONFIG_ALLOW_EMPTY_FILTER = keys().allowEmptyFilter()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_ALLOW_EMPTY_FILTER = keys().allowEmptyFilter();
focal_class.type: String
focal_class.var_name: CONFIG_ALLOW_EMPTY_FILTER
focal_class.declarator: CONFIG_ALLOW_ROOT_FILTER = keys().allowRootFilter()
focal_class.modifier: @Deprecated
      public static final
focal_class.original_string: @Deprecated
      public static final String CONFIG_ALLOW_ROOT_FILTER = keys().allowRootFilter();
focal_class.type: String
focal_class.var_name: CONFIG_ALLOW_ROOT_FILTER
focal_class.declarator: DEFAULT_IMPORT_MODE_SEVERITY = Severity.MINOR
focal_class.modifier: public static final
focal_class.original_string: public static final Severity DEFAULT_IMPORT_MODE_SEVERITY = Severity.MINOR;
focal_class.type: Severity
focal_class.var_name: DEFAULT_IMPORT_MODE_SEVERITY
focal_class.file: core/src/main/java/net/adamcin/oakpal/core/checks/FilterSets.java
focal_class.identifier: FilterSets
focal_class.interfaces: implements ProgressCheckFactory
focal_class.class_method_signature: FilterSets.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: FilterSets.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) {
          final Severity importModeSeverity = Severity
                  .valueOf(config.getString(keys().importModeSeverity(), DEFAULT_IMPORT_MODE_SEVERITY.name())
                          .toUpperCase());
          final boolean allowEmptyFilter = hasNonNull(config, keys().allowEmptyFilter())
                  && config.getBoolean(keys().allowEmptyFilter());
          final boolean allowRootFilter = hasNonNull(config, keys().allowRootFilter())
                  && config.getBoolean(keys().allowRootFilter());
          return new Check(importModeSeverity, allowEmptyFilter, allowRootFilter);
      }
focal_method.class_method_signature: FilterSets.newInstance(final JsonObject config)
focal_method.full_signature: @Override public ProgressCheck newInstance(final JsonObject config)
focal_method.identifier: newInstance
focal_method.invocations: valueOf toUpperCase getString importModeSeverity keys name hasNonNull allowEmptyFilter keys getBoolean allowEmptyFilter keys hasNonNull allowRootFilter keys getBoolean allowRootFilter keys
focal_method.modifiers: @Override public
focal_method.parameters: (final JsonObject config)
focal_method.return: ProgressCheck
focal_method.signature: ProgressCheck newInstance(final JsonObject config)