GH-198 added multi-function validation test

Added test to validate that the behavior described in GH-198 is intentional and useful especially in light og GH-208
Resolves #198
This commit is contained in:
Oleg Zhurakousky
2018-10-14 19:43:36 -04:00
parent ec68f6453c
commit 8c2fdfd193

View File

@@ -179,6 +179,20 @@ public class BeanFactoryFunctionCatalogTests {
processor.lookup("supplier|consumer|z");
}
@Test
public void composeSupplierAndMultipleFunctions() {
Supplier<String> s = () -> "hello";
processor.register(new FunctionRegistration<>(s, "supplier"));
Function<String, String> uppercase = x -> x.toUpperCase();
processor.register(new FunctionRegistration<>(uppercase, "uppercase"));
Function<String, String> concat = x -> x + x;
processor.register(new FunctionRegistration<>(concat, "concat"));
Supplier<Flux<String>> f = processor.lookup("supplier|uppercase|concat");
assertThat(f.get().blockFirst()).isEqualTo("HELLOHELLO");
}
protected static class Source implements Supplier<Integer> {
@Override