Search in sources :

Example 16 with HealthReport

use of io.smallrye.reactive.messaging.health.HealthReport in project smallrye-reactive-messaging by smallrye.

the class NoKafkaTest method testOutgoingWithoutKafkaCluster.

@Test
public void testOutgoingWithoutKafkaCluster() {
    runApplication(myKafkaSinkConfigWithoutBlockLimit(topic), MyOutgoingBean.class);
    await().until(() -> {
        HealthReport readiness = getHealth().getReadiness();
        return !readiness.isOk();
    });
    await().until(() -> {
        // liveness is ok, as we don't check the connection with the broker
        HealthReport liveness = getHealth().getLiveness();
        return liveness.isOk();
    });
    enableProxy();
    await().until(this::isReady);
    await().until(this::isAlive);
    assertThat(companion.consumeStrings().fromTopics(topic, 3, Duration.ofMinutes(3)).awaitCompletion().count()).isEqualTo(3);
}
Also used : HealthReport(io.smallrye.reactive.messaging.health.HealthReport) Test(org.junit.jupiter.api.Test)

Aggregations

HealthReport (io.smallrye.reactive.messaging.health.HealthReport)16 Test (org.junit.jupiter.api.Test)16 MapBasedConfig (io.smallrye.reactive.messaging.test.common.config.MapBasedConfig)7 Message (org.eclipse.microprofile.reactive.messaging.Message)6 KafkaMapBasedConfig (io.smallrye.reactive.messaging.kafka.base.KafkaMapBasedConfig)5 TopicPartition (org.apache.kafka.common.TopicPartition)4 KafkaConnectorIncomingConfiguration (io.smallrye.reactive.messaging.kafka.KafkaConnectorIncomingConfiguration)2 IncomingKafkaRecordMetadata (io.smallrye.reactive.messaging.kafka.api.IncomingKafkaRecordMetadata)2 KafkaSource (io.smallrye.reactive.messaging.kafka.impl.KafkaSource)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 UnsatisfiedResolutionException (javax.enterprise.inject.UnsatisfiedResolutionException)2 RepeatedTest (org.junit.jupiter.api.RepeatedTest)2 Identifier (io.smallrye.common.annotation.Identifier)1 io.smallrye.reactive.messaging.kafka (io.smallrye.reactive.messaging.kafka)1 IncomingKafkaRecordBatchMetadata (io.smallrye.reactive.messaging.kafka.api.IncomingKafkaRecordBatchMetadata)1 MockKafkaUtils.injectMockConsumer (io.smallrye.reactive.messaging.kafka.base.MockKafkaUtils.injectMockConsumer)1 WeldTestBase (io.smallrye.reactive.messaging.kafka.base.WeldTestBase)1 ProducerTask (io.smallrye.reactive.messaging.kafka.companion.ProducerTask)1 Vertx (io.vertx.mutiny.core.Vertx)1