assertEquals(Status.DEGRADED, new NodeStatus(new ValidationResult[]{new ValidationResult(null, Status.DEGRADED, null), new ValidationResult(null, Status.OK, null)}, date).getStatus());
}
@Test
public void periodicNodeReporter() throws InterruptedException {
final PeriodicNodeStatusDataStore store = IoCs.processInstance(new PeriodicNodeStatusDataStore() {
@Override
protected int getPeriod(final String name) {
return 100;
}
});
Thread.sleep(200);
assertEquals(Status.OK, store.statuses().values().iterator().next().getStatus());
SpiTestImpl.status = new ValidationResult("", Status.KO, "");
Thread.sleep(200);
assertEquals(Status.KO, store.statuses().values().iterator().next().getStatus());
store.shutdown();
}