Prefer explicit route to default
This commit is contained in:
@@ -250,7 +250,7 @@ public class ContextFunctionCatalogAutoConfiguration {
|
||||
if (stages.length == 0 && source.size() == 1) {
|
||||
stages = new String[] { source.keySet().iterator().next() };
|
||||
}
|
||||
Object function = lookup(stages[0], source);
|
||||
Object function = stages.length>0 ? lookup(stages[0], source) : null;
|
||||
if (function == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,13 @@ public class BeanFactoryFunctionCatalogTests {
|
||||
assertThat(foos.apply(Flux.just(2)).blockFirst()).isEqualTo("4");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void lookupNonExistentConsumerWithEmptyName() {
|
||||
processor.register(new FunctionRegistration<>(new Foos()).names("foos"));
|
||||
Consumer<Flux<String>> foos = processor.lookupConsumer("");
|
||||
assertThat(foos).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void composeFunction() {
|
||||
processor.register(new FunctionRegistration<>(new Foos()).names("foos"));
|
||||
|
||||
Reference in New Issue
Block a user