From eb8fa712987b8b595b986ad433caa774faff8e0f Mon Sep 17 00:00:00 2001 From: shijia Date: Tue, 2 Jun 2020 19:52:35 +0800 Subject: [PATCH 1/2] add new test --- .../src/test/java/com/example/SampleApplicationMvcTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-function-samples/function-sample/src/test/java/com/example/SampleApplicationMvcTests.java b/spring-cloud-function-samples/function-sample/src/test/java/com/example/SampleApplicationMvcTests.java index e41b79c81..ce20229fb 100644 --- a/spring-cloud-function-samples/function-sample/src/test/java/com/example/SampleApplicationMvcTests.java +++ b/spring-cloud-function-samples/function-sample/src/test/java/com/example/SampleApplicationMvcTests.java @@ -44,7 +44,7 @@ public class SampleApplicationMvcTests { @Test public void words() throws Exception { - MvcResult result = this.mockMvc.perform(get("/words")).andReturn(); + MvcResult result = this.mockMvc.perform(get("/words|uppercase")).andReturn(); mockMvc.perform(asyncDispatch(result)).andExpect(content().string("[\"foo\",\"bar\"]")); } From 25c002702765537d1949c131bbaf18f812705dd7 Mon Sep 17 00:00:00 2001 From: shijia Date: Tue, 2 Jun 2020 19:57:26 +0800 Subject: [PATCH 2/2] add new test --- .../test/java/com/example/SampleApplicationMvcTests.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spring-cloud-function-samples/function-sample/src/test/java/com/example/SampleApplicationMvcTests.java b/spring-cloud-function-samples/function-sample/src/test/java/com/example/SampleApplicationMvcTests.java index ce20229fb..70c994165 100644 --- a/spring-cloud-function-samples/function-sample/src/test/java/com/example/SampleApplicationMvcTests.java +++ b/spring-cloud-function-samples/function-sample/src/test/java/com/example/SampleApplicationMvcTests.java @@ -44,10 +44,17 @@ public class SampleApplicationMvcTests { @Test public void words() throws Exception { - MvcResult result = this.mockMvc.perform(get("/words|uppercase")).andReturn(); + MvcResult result = this.mockMvc.perform(get("/words")).andReturn(); mockMvc.perform(asyncDispatch(result)).andExpect(content().string("[\"foo\",\"bar\"]")); } + @Test + public void wordsUppercase() throws Exception { + MvcResult result = this.mockMvc.perform(get("/words|uppercase")).andReturn(); + mockMvc.perform(asyncDispatch(result)).andExpect(content().string("[\"FOO\",\"BAR\"]")); + } + + @Test public void uppercase() throws Exception { MvcResult result = this.mockMvc.perform(post("/uppercase").contentType(MediaType.TEXT_PLAIN).content("foo")).andReturn();