Align MVC handling between Spring 4 and Spring 5

A Spring Boot 2.0 app should behave the same as a Spering Boot 1.5
app with this change. The key thing was to change the return type
of the FunctionController and move the computation of single
valuedness for the output there (instead of trying to do it in the
return value handler, which isn't used in Spring 5).
This commit is contained in:
Dave Syer
2018-03-16 07:08:43 -04:00
parent 43e3cb4f27
commit 8ab4d61bb4
5 changed files with 66 additions and 39 deletions

View File

@@ -53,10 +53,9 @@ public class SampleApplicationTests {
@Test
public void single() {
// TODO: make this return a single value
assertThat(new TestRestTemplate().postForObject(
"http://localhost:" + port + "/uppercase", "{\"value\":\"foo\"}",
String.class)).isEqualTo("[{\"value\":\"FOO\"}]");
String.class)).isEqualTo("{\"value\":\"FOO\"}");
}
@Test