use of javax.el.ELContext in project Activiti by Activiti.
the class ExpressionManager method getElContext.
public ELContext getElContext(VariableScope variableScope) {
ELContext elContext = null;
if (variableScope instanceof VariableScopeImpl) {
VariableScopeImpl variableScopeImpl = (VariableScopeImpl) variableScope;
elContext = variableScopeImpl.getCachedElContext();
}
if (elContext == null) {
elContext = createElContext(variableScope);
if (variableScope instanceof VariableScopeImpl) {
((VariableScopeImpl) variableScope).setCachedElContext(elContext);
}
}
return elContext;
}
use of javax.el.ELContext in project Activiti by Activiti.
the class VariableScopeElResolverTest method getValue_should_returnNullWhenNoneOfItemResolversCanResolveTheProperty.
@Test
public void getValue_should_returnNullWhenNoneOfItemResolversCanResolveTheProperty() {
// given
String property = "myVar";
ELContext elContext = mock(ELContext.class);
given(firstItemResolver.canResolve(property, variableScope)).willReturn(false);
given(secondItemResolver.canResolve(property, variableScope)).willReturn(false);
given(secondItemResolver.canResolve(property, variableScope)).willReturn(false);
// when
Object result = variableScopeElResolver.getValue(elContext, null, property);
// then
assertThat(result).isNull();
verifyZeroInteractions(elContext);
}
Aggregations