This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-3.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.x by this push: new 6702df2c487 (chores) camel-kafka: Avoid misreporting liveness checks (#9417) 6702df2c487 is described below commit 6702df2c487cce3610bb4cb17bd4959548603a0a Author: Otavio Rodolfo Piske <orpi...@users.noreply.github.com> AuthorDate: Mon Mar 6 07:16:28 2023 -0300 (chores) camel-kafka: Avoid misreporting liveness checks (#9417) --- .../kafka/integration/health/KafkaConsumerBadPortHealthCheckIT.java | 2 ++ .../health/KafkaConsumerBadPortSupervisingHealthCheckIT.java | 4 +++- .../integration/health/KafkaConsumerUnresolvableHealthCheckIT.java | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortHealthCheckIT.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortHealthCheckIT.java index c0e680cb0e7..38e4df2e14f 100644 --- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortHealthCheckIT.java +++ b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortHealthCheckIT.java @@ -155,6 +155,8 @@ public class KafkaConsumerBadPortHealthCheckIT extends CamelTestSupport { public void kafkaConsumerHealthCheck() throws InterruptedException { // health-check liveness should be UP Collection<HealthCheck.Result> res = HealthCheckHelper.invokeLiveness(context); + Assertions.assertFalse(res.isEmpty(), "there should be liveness results to assert"); + boolean up = res.stream().allMatch(r -> r.getState().equals(HealthCheck.State.UP)); Assertions.assertTrue(up, "liveness check"); diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortSupervisingHealthCheckIT.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortSupervisingHealthCheckIT.java index 052f81674e4..52836d4242c 100644 --- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortSupervisingHealthCheckIT.java +++ b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerBadPortSupervisingHealthCheckIT.java @@ -163,8 +163,10 @@ public class KafkaConsumerBadPortSupervisingHealthCheckIT extends CamelTestSuppo public void kafkaConsumerHealthCheck() throws InterruptedException { // health-check liveness should be UP Collection<HealthCheck.Result> res = HealthCheckHelper.invokeLiveness(context); + Assertions.assertFalse(res.isEmpty(), "there should be liveness results to assert"); + boolean up = res.stream().allMatch(r -> r.getState().equals(HealthCheck.State.UP)); - Assertions.assertTrue(up, "liveness check"); + Assertions.assertTrue(up, "liveness check should be UP"); // health-check readiness should be down await().atMost(20, TimeUnit.SECONDS).untilAsserted(() -> { diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerUnresolvableHealthCheckIT.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerUnresolvableHealthCheckIT.java index 5b6977e15bc..894932d89ef 100644 --- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerUnresolvableHealthCheckIT.java +++ b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerUnresolvableHealthCheckIT.java @@ -161,8 +161,10 @@ public class KafkaConsumerUnresolvableHealthCheckIT extends CamelTestSupport { public void kafkaConsumerHealthCheck() throws InterruptedException { // health-check liveness should be UP Collection<HealthCheck.Result> res = HealthCheckHelper.invokeLiveness(context); + Assertions.assertFalse(res.isEmpty(), "there should be liveness results to assert"); + boolean up = res.stream().allMatch(r -> r.getState().equals(HealthCheck.State.UP)); - Assertions.assertTrue(up, "liveness check"); + Assertions.assertTrue(up, "liveness check should be up"); // health-check readiness should be down await().atMost(20, TimeUnit.SECONDS).untilAsserted(() -> {