Improve Object return type support in WebFlux

Issue: SPR-15731
This commit is contained in:
Rossen Stoyanchev
2017-07-04 08:18:51 -04:00
parent f63b0d720e
commit f7478446b7
2 changed files with 25 additions and 1 deletions

View File

@@ -137,6 +137,12 @@ public class RequestMappingMessageConversionIntegrationTests extends AbstractReq
assertEquals(expected, performGet("/person-response/mono", JSON, Person.class).getBody());
}
@Test
public void personResponseBodyWithMonoDeclaredAsObject() throws Exception {
Person expected = new Person("Robert");
assertEquals(expected, performGet("/person-response/mono-declared-as-object", JSON, Person.class).getBody());
}
@Test
public void personResponseBodyWithSingle() throws Exception {
Person expected = new Person("Robert");
@@ -442,6 +448,11 @@ public class RequestMappingMessageConversionIntegrationTests extends AbstractReq
return Mono.just(new Person("Robert"));
}
@GetMapping("/mono-declared-as-object")
public Object getMonoDeclaredAsObject() {
return Mono.just(new Person("Robert"));
}
@GetMapping("/single")
public Single<Person> getSingle() {
return Single.just(new Person("Robert"));