HttpAlerter extends Alerter { @Override public void alert(AlertArguments alertArguments) { httpClient.send(HttpRequestBuilder.<Integer>jsonRequest("POST", alertArguments.getSubscription().getTarget(), alertArguments.getIncident()).build()); } HttpAlerter(); @Override void alert(AlertArguments alertArguments); @Override String getAlerterType(); @Override String getTargetLabel();  }
@Test public void testAlert() throws Exception { Subscription subscription = abstractAlerterTest.createSubscription(httpAlerter); subscription.setTarget(elasticsearchUrl + "/stagemonitor/alerts"); Incident incident = alertSender.sendTestAlert(subscription, CheckResult.Status.ERROR); refresh(); Collection<Incident> allIncidents = elasticsearchClient.getAll("/stagemonitor/alerts", 10, Incident.class); Assert.assertEquals(1, allIncidents.size()); Assert.assertEquals(incident, allIncidents.iterator().next()); }