Für PUT anstelle von POST wird eine `FooMessage` als `foo` verschickt
[demos/kafka/training] / src / test / java / de / juplo / kafka / ApplicationTests.java
index cf70c81..cd7d928 100644 (file)
@@ -51,7 +51,7 @@ public class ApplicationTests
 
 
        @Test
-       void testSendMessage() throws Exception
+       void testSendClientMessage() throws Exception
        {
                mockMvc
                                .perform(post("/peter").content("Hallo Welt!"))
@@ -61,6 +61,28 @@ public class ApplicationTests
                                .until(() -> consumer.received.size() == 1);
        }
 
+       @Test
+       void testSendFooMessage() throws Exception
+       {
+               mockMvc
+                               .perform(put("/peter"))
+                               .andExpect(status().isOk());
+               await("Message was send")
+                               .atMost(Duration.ofSeconds(5))
+                               .until(() -> consumer.received.size() == 1);
+       }
+
+       @Test
+       void testSendGreeting() throws Exception
+       {
+               mockMvc
+                               .perform(post("/").content("peter"))
+                               .andExpect(status().isOk());
+               await("Message was send")
+                               .atMost(Duration.ofSeconds(5))
+                               .until(() -> consumer.received.size() == 1);
+       }
+
 
        static class Consumer
        {