From 362e504362608fb12e9bef02504955e7be9eece7 Mon Sep 17 00:00:00 2001 From: Walter Medvedeo Date: Mon, 2 Sep 2024 14:09:31 +0200 Subject: [PATCH] Update jobs-service/jobs-service-common/src/test/java/org/kie/kogito/jobs/service/management/JobServiceLeaderLivenessHealthCheckTest.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gonzalo Muñoz --- .../JobServiceLeaderLivenessHealthCheckTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jobs-service/jobs-service-common/src/test/java/org/kie/kogito/jobs/service/management/JobServiceLeaderLivenessHealthCheckTest.java b/jobs-service/jobs-service-common/src/test/java/org/kie/kogito/jobs/service/management/JobServiceLeaderLivenessHealthCheckTest.java index 156e27b6c5..bcf618c45c 100644 --- a/jobs-service/jobs-service-common/src/test/java/org/kie/kogito/jobs/service/management/JobServiceLeaderLivenessHealthCheckTest.java +++ b/jobs-service/jobs-service-common/src/test/java/org/kie/kogito/jobs/service/management/JobServiceLeaderLivenessHealthCheckTest.java @@ -64,4 +64,14 @@ void timeoutSetAndReached() { .isNotNull() .isEqualTo(HealthCheckResponse.Status.DOWN); } + + @Test + void statusChanged() { + healthCheck.onMessagingStatusChange(new MessagingChangeEvent(true)); + doReturn(START_TIME + 1000 * 10).when(healthCheck).getCurrentTimeMillis(); + HealthCheckResponse response = healthCheck.call(); + assertThat(response.getStatus()) + .isNotNull() + .isEqualTo(HealthCheckResponse.Status.UP); + } }