private void assertUpAndRunningEventually(Entity entity) {
try {
EntityAsserts.assertAttributeEventually(entity, Attributes.SERVICE_NOT_UP_INDICATORS, CollectionFunctionals.<String>mapEmptyOrNull());
EntityAsserts.assertAttributeEventually(entity, ServiceStateLogic.SERVICE_PROBLEMS, CollectionFunctionals.<String>mapEmptyOrNull());
EntityAsserts.assertAttributeEqualsEventually(entity, Attributes.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING);
EntityAsserts.assertAttributeEqualsEventually(entity, Attributes.SERVICE_UP, true);
} catch (Throwable t) {
Entities.dumpInfo(entity);
String err = "(Dumped entity info - see log); entity=" + entity + "; " +
"state=" + entity.sensors().get(Attributes.SERVICE_STATE_ACTUAL) + "; " +
"up="+entity.sensors().get(Attributes.SERVICE_UP) + "; " +
"notUpIndicators="+entity.sensors().get(Attributes.SERVICE_NOT_UP_INDICATORS) + "; " +
"serviceProblems="+entity.sensors().get(Attributes.SERVICE_PROBLEMS);
throw new AssertionError(err, t);
}
}