diff --git a/spring-cloud-function-web/src/test/java/org/springframework/cloud/function/web/RestApplicationTests.java b/spring-cloud-function-web/src/test/java/org/springframework/cloud/function/web/RestApplicationTests.java index 0dcc3bfd1..a7a16a5dc 100644 --- a/spring-cloud-function-web/src/test/java/org/springframework/cloud/function/web/RestApplicationTests.java +++ b/spring-cloud-function-web/src/test/java/org/springframework/cloud/function/web/RestApplicationTests.java @@ -211,6 +211,11 @@ public class RestApplicationTests { assertThat(rest.getForObject("/wrap/123", String.class)).isEqualTo("..123.."); } + @Test + public void supplierFirst() { + assertThat(rest.getForObject("/not/a/function", String.class)).isEqualTo("hello"); + } + @Test public void convertGetJson() throws Exception { assertThat(rest @@ -232,14 +237,12 @@ public class RestApplicationTests { @Test public void uppercaseJsonStream() throws Exception { - assertThat( - rest.exchange( - RequestEntity.post(new URI("/maps")) - .contentType(MediaType.APPLICATION_JSON) - // TODO: make this work without newline separator - .body("{\"value\":\"foo\"}\n{\"value\":\"bar\"}"), - String.class).getBody()) - .isEqualTo("{\"value\":\"FOO\"}{\"value\":\"BAR\"}"); + assertThat(rest + .exchange(RequestEntity.post(new URI("/maps")) + .contentType(MediaType.APPLICATION_JSON) + // TODO: make this work without newline separator + .body("{\"value\":\"foo\"}\n{\"value\":\"bar\"}"), String.class) + .getBody()).isEqualTo("{\"value\":\"FOO\"}{\"value\":\"BAR\"}"); } @Test @@ -311,6 +314,16 @@ public class RestApplicationTests { return () -> Flux.fromIterable(Collections.emptyList()); } + @Bean("not/a/function") + public Supplier> supplier() { + return () -> Flux.just("hello"); + } + + @Bean("not/a") + public Function, Flux> function() { + return input -> Flux.just("bye"); + } + @Bean public Supplier> timeout() { return () -> Flux.create(emitter -> {