use of org.springframework.cloud.gateway.support.ShortcutConfigurable in project spring-cloud-gateway by spring-cloud.
the class RouteDefinitionRouteLocatorTests method testGetTupleWithSpel.
@Test
public void testGetTupleWithSpel() {
parser = new SpelExpressionParser();
ShortcutConfigurable shortcutConfigurable = new ShortcutConfigurable() {
@Override
public List<String> shortcutFieldOrder() {
return Arrays.asList("bean", "arg1");
}
};
Map<String, String> args = new HashMap<>();
args.put("bean", "#{@foo}");
args.put("arg1", "val1");
Tuple tuple = RouteDefinitionRouteLocator.getTuple(shortcutConfigurable, args, parser, this.beanFactory);
assertThat(tuple).isNotNull();
assertThat(tuple.getValue("bean", Integer.class)).isEqualTo(42);
assertThat(tuple.getString("arg1")).isEqualTo("val1");
}
Aggregations