use of org.mule.runtime.core.internal.el.mvel.MuleBaseVariableResolverFactory in project mule by mulesoft.
the class MVELExpressionLanguageContextTestCase method testGetVariableResolver.
@Test
public void testGetVariableResolver() {
MuleBaseVariableResolverFactory resoverFactory = new MVELExpressionLanguageContext(parserConfig, muleContext);
resoverFactory.addResolver("foo", new SimpleValueResolver("val"));
assertNotNull(resoverFactory.getVariableResolver("foo"));
assertEquals("val", resoverFactory.getVariableResolver("foo").getValue());
assertNull(resoverFactory.getVariableResolver("bar"));
}
use of org.mule.runtime.core.internal.el.mvel.MuleBaseVariableResolverFactory in project mule by mulesoft.
the class MVELExpressionLanguageContextTestCase method testGetVariableResolverNextFactory.
@Test
public void testGetVariableResolverNextFactory() {
parserConfig.addImport(String.class);
MuleBaseVariableResolverFactory resoverFactory = new MVELExpressionLanguageContext(parserConfig, muleContext);
resoverFactory.setNextFactory(new MapVariableResolverFactory(Collections.singletonMap("foo", "val")));
assertNotNull(resoverFactory.getVariableResolver("foo"));
assertEquals("val", resoverFactory.getVariableResolver("foo").getValue());
assertNull(resoverFactory.getVariableResolver("bar"));
}
Aggregations