org.eclipse.microprofile.health.Liveness Java Examples

The following examples show how to use org.eclipse.microprofile.health.Liveness. 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 File: ExpectedBeansUnitTest.java    From quarkus with 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
Source File: KeycloakHealthChecks.java    From keycloak-extension-playground with Apache License 2.0 4 votes vote down vote up
@Produces
@Liveness
HealthCheck serverCheck() {
    return () -> KEYCLOAK_SERVER_HEALTH_CHECK.up().build();
}
 
Example #3
Source File: HealthCheckTestCase.java    From quarkus with Apache License 2.0 4 votes vote down vote up
public HealthCheckTestCase(@Liveness SimpleHealthCheck simpleHealthCheck) {
    this.simpleHealthCheck = simpleHealthCheck;
}
 
Example #4
Source File: CDIProducedProcedureCheck.java    From microprofile-health with Apache License 2.0 4 votes vote down vote up
@Produces
@Liveness
HealthCheck cdiProducedLivenessCheck() {
    return () -> HealthCheckResponse.up("cdi-produced-successful-check");
}