Initiale Version eines Gateways für die SumUp-Services
[demos/kafka/training] / src / test / java / de / juplo / kafka / ApplicationTests.java
index 646a335..b7d3e7f 100644 (file)
@@ -8,6 +8,7 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.TestConfiguration;
 import org.springframework.context.annotation.Bean;
+import org.springframework.http.MediaType;
 import org.springframework.kafka.annotation.KafkaListener;
 import org.springframework.kafka.test.context.EmbeddedKafka;
 import org.springframework.test.web.servlet.MockMvc;
@@ -26,8 +27,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
 @SpringBootTest(
                properties = {
                                "spring.kafka.consumer.bootstrap-servers=${spring.embedded.kafka.brokers}",
-                               "producer.bootstrap-server=${spring.embedded.kafka.brokers}",
-                               "producer.topic=" + TOPIC})
+                               "sumup.gateway.bootstrap-server=${spring.embedded.kafka.brokers}",
+                               "sumup.gateway.topic=" + TOPIC})
 @AutoConfigureMockMvc
 @EmbeddedKafka(topics = TOPIC, partitions = PARTITIONS)
 @Slf4j
@@ -53,7 +54,9 @@ public class ApplicationTests
        void testSendMessage() throws Exception
        {
                mockMvc
-                               .perform(post("/peter").content("Hallo Welt!"))
+                               .perform(post("/peter")
+                                               .content("66")
+                                               .contentType(MediaType.APPLICATION_JSON))
                                .andExpect(status().isOk());
                await("Message was send")
                                .atMost(Duration.ofSeconds(5))