Java Code Examples for org.eclipse.microprofile.health.Liveness

The following examples show how to use org.eclipse.microprofile.health.Liveness. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: quarkus   Source File: ExpectedBeansUnitTest.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Test metadata on HealthCheck procedure beans
 */
@Test
public void testHealthCheckMetadata() {
    Instance<HealthCheck> selects;

    selects = checks.select(Liveness.Literal.INSTANCE);
    Assertions.assertTrue(isUnique(selects));

    selects = checks.select(Readiness.Literal.INSTANCE);
    Assertions.assertTrue(isUnique(selects));

    selects = checks.select(HealthGroup.Literal.of("group1"));
    Assertions.assertTrue(isUnique(selects));

    selects = checks.select(HealthGroup.Literal.of("group2"));
    Assertions.assertTrue(isUnique(selects));

    selects = checks.select(Liveness.Literal.INSTANCE,
            Readiness.Literal.INSTANCE,
            HealthGroup.Literal.of("group1"),
            HealthGroup.Literal.of("group2"));
    Assertions.assertTrue(isUnique(selects));

    Assertions.assertTrue(checks.select(HealthGroup.Literal.of("group3")).isUnsatisfied());

}
 
Example 2
@Produces
@Liveness
HealthCheck serverCheck() {
    return () -> KEYCLOAK_SERVER_HEALTH_CHECK.up().build();
}
 
Example 3
Source Project: quarkus   Source File: HealthCheckTestCase.java    License: Apache License 2.0 4 votes vote down vote up
public HealthCheckTestCase(@Liveness SimpleHealthCheck simpleHealthCheck) {
    this.simpleHealthCheck = simpleHealthCheck;
}
 
Example 4
@Produces
@Liveness
HealthCheck cdiProducedLivenessCheck() {
    return () -> HealthCheckResponse.up("cdi-produced-successful-check");
}