From 39d3193862385257f522f8f710383140b2bc3c5e Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 5 May 2024 13:42:07 +0200 Subject: [PATCH] WIP --- .../juplo/kafka/wordcount/recorder/ApplicationTests.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/java/de/juplo/kafka/wordcount/recorder/ApplicationTests.java b/src/test/java/de/juplo/kafka/wordcount/recorder/ApplicationTests.java index fe51d21..42729d1 100644 --- a/src/test/java/de/juplo/kafka/wordcount/recorder/ApplicationTests.java +++ b/src/test/java/de/juplo/kafka/wordcount/recorder/ApplicationTests.java @@ -6,19 +6,17 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.context.annotation.Bean; -import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.kafka.annotation.KafkaListener; import org.springframework.kafka.test.context.EmbeddedKafka; -import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MimeType; -import org.springframework.util.MimeTypeUtils; import org.springframework.util.MultiValueMap; import static de.juplo.kafka.wordcount.recorder.ApplicationTests.PARTITIONS; import static de.juplo.kafka.wordcount.recorder.ApplicationTests.TOPIC_OUT; +import static org.assertj.core.api.Assertions.assertThat; @SpringBootTest( @@ -34,7 +32,7 @@ class ApplicationTests static final int PARTITIONS = 2; @Autowired - WebTestClient client; + private TestRestTemplate restTemplate; @Test void contextLoads() @@ -44,6 +42,7 @@ class ApplicationTests @Test void userEventsAreSent() { + assertThat(restTemplate.postForObject("peter", "Hällö Wählt?*$@¢!", RecordingResult.class)).contains("Hello, World"); client .post() .uri("peter") -- 2.20.1