Ensure a function is inspectable as itself and its wrapper
Since a function is wrapper in a FluxWrapper (and possibly also an Isolated), the link is lost between the bean and the type metadata without this change.
This commit is contained in:
@@ -331,6 +331,20 @@ public class ContextFunctionCatalogAutoConfigurationTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void simpleFunction() {
|
||||
create(SimpleConfiguration.class);
|
||||
Object bean = context.getBean("function");
|
||||
assertThat(bean).isInstanceOf(Function.class);
|
||||
Function<Flux<String>, Flux<String>> function = catalog.lookup(Function.class,
|
||||
"function");
|
||||
assertThat(function.apply(Flux.just("foo")).blockFirst()).isEqualTo("FOO");
|
||||
assertThat(bean).isNotSameAs(function);
|
||||
assertThat(inspector.getRegistration(bean)).isNotNull();
|
||||
assertThat(inspector.getRegistration(bean).getType())
|
||||
.isEqualTo(inspector.getRegistration(function).getType());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void simpleSupplier() {
|
||||
create(SimpleConfiguration.class);
|
||||
|
||||
Reference in New Issue
Block a user