@Test public void testEmptyConfig() throws Exception { AcHandling.Check check = (AcHandling.Check) new AcHandling().newInstance(obj().get()); assertNotNull("check should not be null", check); Assert.assertEquals("default levelSet should be " + AcHandling.DEFAULT_LEVEL_SET, check.levelSet, AcHandling.DEFAULT_LEVEL_SET); assertTrue("default allowedModes should be empty: " + check.allowedModes, check.allowedModes.isEmpty()); }
@Override public ProgressCheck newInstance(final JsonObject config) { if (hasNonNull(config, keys().allowedModes())) { List<AccessControlHandling> allowedModes = mapArrayOfStrings(arrayOrEmpty(config, keys().allowedModes()), compose1(String::toUpperCase, AccessControlHandling::valueOf), true); return new Check(ACHandlingLevelSet.EXPLICIT, allowedModes); } else if (hasNonNull(config, keys().levelSet())) { ACHandlingLevelSet levelSet = ACHandlingLevelSet.valueOf(config.getString(keys().levelSet()).toUpperCase()); return new Check(levelSet, Collections.emptyList()); } else { return new Check(DEFAULT_LEVEL_SET, Collections.emptyList()); } }
AcHandling implements ProgressCheckFactory { @Override public ProgressCheck newInstance(final JsonObject config) { if (hasNonNull(config, keys().allowedModes())) { List<AccessControlHandling> allowedModes = mapArrayOfStrings(arrayOrEmpty(config, keys().allowedModes()), compose1(String::toUpperCase, AccessControlHandling::valueOf), true); return new Check(ACHandlingLevelSet.EXPLICIT, allowedModes); } else if (hasNonNull(config, keys().levelSet())) { ACHandlingLevelSet levelSet = ACHandlingLevelSet.valueOf(config.getString(keys().levelSet()).toUpperCase()); return new Check(levelSet, Collections.emptyList()); } else { return new Check(DEFAULT_LEVEL_SET, Collections.emptyList()); } } }
AcHandling implements ProgressCheckFactory { @Override public ProgressCheck newInstance(final JsonObject config) { if (hasNonNull(config, keys().allowedModes())) { List<AccessControlHandling> allowedModes = mapArrayOfStrings(arrayOrEmpty(config, keys().allowedModes()), compose1(String::toUpperCase, AccessControlHandling::valueOf), true); return new Check(ACHandlingLevelSet.EXPLICIT, allowedModes); } else if (hasNonNull(config, keys().levelSet())) { ACHandlingLevelSet levelSet = ACHandlingLevelSet.valueOf(config.getString(keys().levelSet()).toUpperCase()); return new Check(levelSet, Collections.emptyList()); } else { return new Check(DEFAULT_LEVEL_SET, Collections.emptyList()); } }  }
AcHandling implements ProgressCheckFactory { @Override public ProgressCheck newInstance(final JsonObject config) { if (hasNonNull(config, keys().allowedModes())) { List<AccessControlHandling> allowedModes = mapArrayOfStrings(arrayOrEmpty(config, keys().allowedModes()), compose1(String::toUpperCase, AccessControlHandling::valueOf), true); return new Check(ACHandlingLevelSet.EXPLICIT, allowedModes); } else if (hasNonNull(config, keys().levelSet())) { ACHandlingLevelSet levelSet = ACHandlingLevelSet.valueOf(config.getString(keys().levelSet()).toUpperCase()); return new Check(levelSet, Collections.emptyList()); } else { return new Check(DEFAULT_LEVEL_SET, Collections.emptyList()); } }  static JsonKeys keys(); @Override ProgressCheck newInstance(final JsonObject config); }
AcHandling implements ProgressCheckFactory { @Override public ProgressCheck newInstance(final JsonObject config) { if (hasNonNull(config, keys().allowedModes())) { List<AccessControlHandling> allowedModes = mapArrayOfStrings(arrayOrEmpty(config, keys().allowedModes()), compose1(String::toUpperCase, AccessControlHandling::valueOf), true); return new Check(ACHandlingLevelSet.EXPLICIT, allowedModes); } else if (hasNonNull(config, keys().levelSet())) { ACHandlingLevelSet levelSet = ACHandlingLevelSet.valueOf(config.getString(keys().levelSet()).toUpperCase()); return new Check(levelSet, Collections.emptyList()); } else { return new Check(DEFAULT_LEVEL_SET, Collections.emptyList()); } }  static JsonKeys keys(); @Override ProgressCheck newInstance(final JsonObject config); @Deprecated
    static final String CONFIG_ALLOWED_MODES; @Deprecated
    static final String CONFIG_LEVEL_SET; }