use of org.sdase.commons.server.kafka.dropwizard.KafkaTestApplication in project sda-dropwizard-commons by SDA-SE.
the class KafkaBundleWithSaslScramIT method shouldReceiveEntries.
@Test
public void shouldReceiveEntries() {
Set<String> results = new HashSet<>();
DW.<KafkaTestApplication>getApplication().kafkaBundle().createMessageListener(MessageListenerRegistration.builder().withDefaultListenerConfig().forTopic("my-topic").withDefaultConsumer().withKeyDeserializer(new StringDeserializer()).withValueDeserializer(new StringDeserializer()).withListenerStrategy(new SyncCommitMLS<>(r -> results.add(r.value()), null)).build());
Map<byte[], byte[]> records = new HashMap<>();
records.put("key".getBytes(StandardCharsets.UTF_8), "My Message".getBytes(StandardCharsets.UTF_8));
KAFKA.getKafkaTestUtils().produceRecords(records, "my-topic", 0);
await().atMost(KafkaBundleConsts.N_MAX_WAIT_MS, MILLISECONDS).untilAsserted(() -> assertThat(results).containsOnly("My Message"));
}
use of org.sdase.commons.server.kafka.dropwizard.KafkaTestApplication in project sda-dropwizard-commons by SDA-SE.
the class KafkaPrometheusMonitoringIT method before.
@Before
public void before() {
KafkaTestApplication app = DROPWIZARD_APP_RULE.getApplication();
kafkaBundle = app.kafkaBundle();
resultsLong.clear();
}
use of org.sdase.commons.server.kafka.dropwizard.KafkaTestApplication in project sda-dropwizard-commons by SDA-SE.
the class KafkaTopicIT method setup.
@BeforeEach
public void setup() {
results.clear();
KafkaTestApplication app = DW.getApplication();
bundle = app.kafkaBundle();
}
use of org.sdase.commons.server.kafka.dropwizard.KafkaTestApplication in project sda-dropwizard-commons by SDA-SE.
the class KafkaBundleWithConfigIT method healthCheckShouldBeAdded.
@Test
public void healthCheckShouldBeAdded() {
KafkaTestApplication app = DROPWIZARD_APP_RULE.getApplication();
assertThat(app.healthCheckRegistry().getHealthCheck("kafkaConnection")).isNotNull();
}
use of org.sdase.commons.server.kafka.dropwizard.KafkaTestApplication in project sda-dropwizard-commons by SDA-SE.
the class AppWithoutKafkaServerIT method before.
@Before
public void before() {
KafkaTestApplication app = DW.getApplication();
bundle = app.kafkaBundle();
results.clear();
}
Aggregations