GH-727 Fix Azure's Supplier<Publisher> logic to avoid NPE
Resolves #727
This commit is contained in:
@@ -134,6 +134,16 @@ public class FunctionInvokerTests {
|
||||
assertThat(result.toString()).isEqualTo("[foo1, foo2]");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void supplierPublisherBean() {
|
||||
FunctionInvoker<Void, ?> handler = handler(ReactiveSupplierConfig.class);
|
||||
Foo resultSingle = (Foo) handler.handleRequest(new TestExecutionContext("suppliermono"));
|
||||
assertThat(resultSingle.getValue()).isEqualTo("hello");
|
||||
|
||||
List<Foo> resultList = (List<Foo>) handler.handleRequest(new TestExecutionContext("supplierflux"));
|
||||
assertThat(resultList.size()).isEqualTo(2);
|
||||
}
|
||||
|
||||
private static String consumerResult;
|
||||
|
||||
@Test
|
||||
@@ -209,6 +219,22 @@ public class FunctionInvokerTests {
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
// @EnableAutoConfiguration
|
||||
protected static class ReactiveSupplierConfig {
|
||||
|
||||
@Bean
|
||||
public Supplier<Mono<Foo>> suppliermono() {
|
||||
return () -> Mono.just(new Foo("hello"));
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Supplier<Flux<Foo>> supplierflux() {
|
||||
return () -> Flux.just(new Foo("hello"), new Foo("bye"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Configuration
|
||||
protected static class BareConfig {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user