From 3fd0f60618e99599c3b278233668e86ae137b966 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Thu, 10 Sep 2015 17:44:06 +0200 Subject: [PATCH] Polish integration tests --- .../RequestMappingIntegrationTests.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/spring-web-reactive/src/test/java/org/springframework/reactive/web/dispatch/method/annotation/RequestMappingIntegrationTests.java b/spring-web-reactive/src/test/java/org/springframework/reactive/web/dispatch/method/annotation/RequestMappingIntegrationTests.java index 053fcc716b..00f5c8a698 100644 --- a/spring-web-reactive/src/test/java/org/springframework/reactive/web/dispatch/method/annotation/RequestMappingIntegrationTests.java +++ b/spring-web-reactive/src/test/java/org/springframework/reactive/web/dispatch/method/annotation/RequestMappingIntegrationTests.java @@ -150,10 +150,10 @@ public class RequestMappingIntegrationTests extends AbstractHttpHandlerIntegrati } @Test - public void echo() throws Exception { + public void capitalize() throws Exception { RestTemplate restTemplate = new RestTemplate(); - URI url = new URI("http://localhost:" + port + "/echo"); + URI url = new URI("http://localhost:" + port + "/capitalize"); List persons = Arrays.asList(new Person("Robert"), new Person("Marie")); RequestEntity> request = RequestEntity .post(url) @@ -163,8 +163,8 @@ public class RequestMappingIntegrationTests extends AbstractHttpHandlerIntegrati List results = restTemplate.exchange(request, new ParameterizedTypeReference>(){}).getBody(); assertEquals(2, results.size()); - assertEquals("Robert", results.get(0).getName()); - assertEquals("Marie", results.get(1).getName()); + assertEquals("ROBERT", results.get(0).getName()); + assertEquals("MARIE", results.get(1).getName()); } @@ -208,10 +208,13 @@ public class RequestMappingIntegrationTests extends AbstractHttpHandlerIntegrati return Streams.just(new Person("Robert"), new Person("Marie")); } - @RequestMapping("/echo") + @RequestMapping("/capitalize") @ResponseBody - public Publisher echo(@RequestBody Publisher persons) { - return persons; + public Observable capitalize(@RequestBody Observable persons) { + return persons.map(person -> { + person.setName(person.getName().toUpperCase()); + return person; + }); } }