### Question:
RecommendEnsureOakIndex implements ProgressCheckFactory { @Override public ProgressCheck newInstance(final JsonObject config) { final Severity severity = Severity.valueOf(config.getString(CONFIG_SEVERITY, Severity.MINOR.name()).toUpperCase()); final String recommendation = config.getString(CONFIG_RECOMMENDATION, DEFAULT_RECOMMENDATION); final List<Rule> scopePaths = Rules.fromJsonArray(arrayOrEmpty(config, CONFIG_SCOPE_PATHS)); return new Check(severity, recommendation, scopePaths); }  @Override ProgressCheck newInstance(final JsonObject config); static final String NN_OAK_INDEX; static final String CONFIG_SEVERITY; static final String CONFIG_RECOMMENDATION; static final String CONFIG_SCOPE_PATHS; static final String DEFAULT_RECOMMENDATION; }### Answer:
@Test public void testCheckNone() throws Exception { ProgressCheck check = new RecommendEnsureOakIndex() .newInstance(key("scopePaths", arr(Rules.DEFAULT_DENY)).get()); CheckReport reportValid = scanWithCheck(check, pack); assertEquals("No violations when deny all oak:index children.", 0, reportValid.getViolations().size()); }
@Test public void testCheckAll() throws Exception { ProgressCheck check = new RecommendEnsureOakIndex().newInstance(obj().get()); CheckReport reportValid = scanWithCheck(check, pack); assertEquals("3 violations when allow all oak:index children.", 3, reportValid.getViolations().size()); }