diff --git a/kouncil-backend/src/test/java/com/consdata/kouncil/topic/TopicServiceTest.java b/kouncil-backend/src/test/java/com/consdata/kouncil/topic/TopicServiceTest.java index 852768f4..ae0546ed 100644 --- a/kouncil-backend/src/test/java/com/consdata/kouncil/topic/TopicServiceTest.java +++ b/kouncil-backend/src/test/java/com/consdata/kouncil/topic/TopicServiceTest.java @@ -4,7 +4,6 @@ import com.consdata.kouncil.KafkaConnectionService; import java.util.stream.IntStream; -import org.junit.Ignore; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -14,8 +13,12 @@ @SpringBootTest @DirtiesContext -@EmbeddedKafka(partitions = 4, bootstrapServersProperty = - "spring.kafka.bootstrap-servers", brokerProperties = {"listeners=PLAINTEXT://localhost:59092", "port=59092"}, ports = 59092) +@EmbeddedKafka( + partitions = 4, + bootstrapServersProperty = "spring.kafka.bootstrap-servers", + brokerProperties = {"listeners=PLAINTEXT://localhost:59092", "port=59092"}, + ports = 59092 +) class TopicServiceTest { @Autowired @@ -30,22 +33,22 @@ class TopicServiceTest { private static final String BOOSTRAP_SERVER = "localhost_59092"; @Test - @Ignore void should_fetch_all_generated_messages() { IntStream.range(0, 100).forEach(index -> kafkaTemplate.send("embedded-test-topic", String.format("Msg no %s", index))); kafkaConnectionService.getAdminClient(BOOSTRAP_SERVER); - TopicMessagesDto topicMessages = topicService.getTopicMessages("embedded-test-topic", "all", "1", "100", null, null, null, BOOSTRAP_SERVER); + TopicMessagesDto topicMessages = topicService.getTopicMessages("embedded-test-topic", "all", "1", "100", + null, null, null, BOOSTRAP_SERVER); assertThat(topicMessages.getMessages()).hasSize(100); } @Test - @Ignore void should_fetch_all_generated_messages_small_amount() { IntStream.range(0, 2).forEach(index -> kafkaTemplate.send("embedded-test-topic-2", String.format("Msg no %s", index))); kafkaConnectionService.getAdminClient(BOOSTRAP_SERVER); - TopicMessagesDto topicMessages = topicService.getTopicMessages("embedded-test-topic-2", "all", "1", "10", null, null, null, BOOSTRAP_SERVER); + TopicMessagesDto topicMessages = topicService.getTopicMessages("embedded-test-topic-2", "all", "1", "10", + null, null, null, BOOSTRAP_SERVER); assertThat(topicMessages.getMessages()).hasSize(2); } }