GrafanaClient { public void sendGrafanaDashboardAsync(final String classPathLocation) { if (!corePlugin.isReportToElasticsearch()) { return; } try { final ObjectNode dashboard = getGrafanaDashboard(classPathLocation); Map<String, Object> body = new HashMap<String, Object>(); body.put("dashboard", dashboard); body.put("overwrite", true); asyncGrafanaRequest("POST", "/api/dashboards/db", body); } catch (IOException e) { logger.warn(e.getMessage(), e); } } GrafanaClient(CorePlugin corePlugin);  GrafanaClient(CorePlugin corePlugin, HttpClient httpClient); void createElasticsearchDatasource(final URL elasticsearchUrl); void sendGrafanaDashboardAsync(final String classPathLocation); void close(); void waitForCompletion();  }
@Test public void sendGrafanaDashboardAsync() throws Exception { final JsonNode dashboard = grafanaClient.getGrafanaDashboard("grafana/ElasticsearchCustomMetricsDashboard.json"); boolean intervalFound = false; for (JsonNode template : dashboard.get("templating").get("list")) { if ("Interval".equals(template.get("name").textValue())) { intervalFound = true; assertEquals("60s", template.get("auto_min").textValue()); } } assertTrue(intervalFound); }