SpreadsheetImportHealthChecker implements HealthChecker<SpreadsheetImportActivity> { public VisitReport visit(SpreadsheetImportActivity activity, List<Object> ancestors) { Processor p = (Processor) VisitReport.findAncestor(ancestors, Processor.class); if (p == null) { return null; } JsonNode configuration = activity.getConfiguration(); if (configuration == null) { return new VisitReport(HealthCheck.getInstance(), p, "Spreadsheet import has not been configured", HealthCheck.NO_CONFIGURATION, Status.SEVERE); } return new VisitReport(HealthCheck.getInstance(), p, "Spreadsheet OK", HealthCheck.NO_PROBLEM, Status.OK); }  boolean canVisit(Object subject); VisitReport visit(SpreadsheetImportActivity activity, List<Object> ancestors); boolean isTimeConsuming();  }
@Test public void testCheckHealth() throws Exception { assertEquals(Status.SEVERE, healthChecker.visit(activity, ancestors).getStatus()); ObjectNode configuration = JsonNodeFactory.instance.objectNode(); configuration.put("columnRange", configuration.objectNode().put("start", 0).put("end", 1)); configuration.put("rowRange", configuration.objectNode().put("start", 0).put("end", -1)); configuration.put("emptyCellValue", ""); configuration.put("allRows", true); configuration.put("excludeFirstRow", false); configuration.put("ignoreBlankRows", false); configuration.put("emptyCellPolicy", "EMPTY_STRING"); configuration.put("outputFormat", "PORT_PER_COLUMN"); configuration.put("csvDelimiter", ","); activity.configure(configuration); assertEquals(Status.OK, healthChecker.visit(activity, ancestors).getStatus()); }