GH-620 Add BeanResolver support for RoutingFunction
Resolves #620 polish
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user