Tighten up multi-valued inputs to "lite" HTTP endpoint
If the user function is single valued but the input is an array, we should output an array (just like the full webflux version).
This commit is contained in:
@@ -44,11 +44,17 @@ public class PojoTests {
|
||||
private WebTestClient client;
|
||||
|
||||
@Test
|
||||
public void words() throws Exception {
|
||||
public void single() throws Exception {
|
||||
client.post().uri("/").body(Mono.just("{\"value\":\"foo\"}"), String.class).exchange()
|
||||
.expectStatus().isOk().expectBody(String.class).isEqualTo("{\"value\":\"FOO\"}");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void multiple() throws Exception {
|
||||
client.post().uri("/").body(Mono.just("[{\"value\":\"foo\"},{\"value\":\"bar\"}]"), String.class).exchange()
|
||||
.expectStatus().isOk().expectBody(String.class).isEqualTo("[{\"value\":\"FOO\"},{\"value\":\"BAR\"}]");
|
||||
}
|
||||
|
||||
@SpringBootConfiguration
|
||||
protected static class TestConfiguration implements Function<Foo, Foo> {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user