GH-620 Add BeanResolver support for RoutingFunction

Resolves #620

polish
This commit is contained in:
Oleg Zhurakousky
2021-01-22 14:36:34 +01:00
parent 75112076f7
commit 3d4bd14926
3 changed files with 25 additions and 4 deletions

View File

@@ -134,6 +134,17 @@ public class RoutingFunctionTests {
assertThat(function.apply(message)).isEqualTo("olleh");
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void testInvocationWithRoutingBeanExpression() {
System.setProperty(FunctionProperties.PREFIX + ".routing-expression", "@reverse.apply(#root.getHeaders().get('func'))");
FunctionCatalog functionCatalog = this.configureCatalog();
Function function = functionCatalog.lookup(RoutingFunction.FUNCTION_NAME);
assertThat(function).isNotNull();
Message<String> message = MessageBuilder.withPayload("hello").setHeader("func", "esacreppu").build();
assertThat(function.apply(message)).isEqualTo("HELLO");
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void testOtherExpectedFailures() {