From dac4556048bca9bfc505a0c348ec9a46313c8cf1 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 15 Apr 2022 11:51:08 +0200 Subject: [PATCH] =?utf8?q?Springify:=20GR=C3=9CN=20-=20`start()`/`stop()`?= =?utf8?q?=20werden=20im=20Test=20explizit=20aufgerufen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../java/de/juplo/kafka/ApplicationTests.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/test/java/de/juplo/kafka/ApplicationTests.java b/src/test/java/de/juplo/kafka/ApplicationTests.java index cbf215e..35d2b2e 100644 --- a/src/test/java/de/juplo/kafka/ApplicationTests.java +++ b/src/test/java/de/juplo/kafka/ApplicationTests.java @@ -67,6 +67,8 @@ class ApplicationTests @Autowired ApplicationProperties properties; @Autowired + EndlessConsumer endlessConsumer; + @Autowired RecordHandler recordHandler; Map oldOffsets; @@ -224,8 +226,22 @@ class ApplicationTests newOffsets.put( new TopicPartition(record.topic(), record.partition()), record.offset()); + + endlessConsumer.start(); } + @AfterEach + public void deinit() + { + try + { + endlessConsumer.stop(); + } + catch (Exception e) + { + log.info("Exception while stopping the consumer: {}", e.toString()); + } + } public static class RecordHandler implements Consumer> { -- 2.20.1