@Test
public void testNoAlertWhenFailureRecovers() throws Exception {

	Check check = createCheckCheckingMean(2, 6);
	when(alertingPlugin.getChecks()).thenReturn(Collections.singletonMap(check.getId(), check));
	// violation
	checkMetrics(7, 0, 0);
	verify(alerter, times(0)).alert(any(Alerter.AlertArguments.class));
	final Incident incident = incidentRepository.getIncidentByCheckId(check.getId());
	assertNotNull(incident);
	assertEquals(CheckResult.Status.OK, incident.getOldStatus());
	assertEquals(CheckResult.Status.WARN, incident.getNewStatus());
	assertNotNull(incident.getFirstFailureAt());
	assertNull(incident.getResolvedAt());
	assertEquals(1, incident.getConsecutiveFailures());
	System.out.println(incident);
	// back to ok
	checkMetrics(1, 0, 0);
	verify(alerter, times(0)).alert(any(Alerter.AlertArguments.class));
	assertNull(incidentRepository.getIncidentByCheckId(check.getId()));
}