VariableElResolver implements VariableScopeItemELResolver { @Override public boolean canResolve(String property, VariableScope variableScope) { return variableScope.hasVariable(property); } VariableElResolver(ObjectMapper objectMapper); @Override boolean canResolve(String property, VariableScope variableScope); @Override Object resolve(String property, VariableScope variableScope);  }
@Test public void canResolve_should_returnTrueWhenVariableScopeHasVariableForProperty() { VariableScope variableScope = mock(VariableScope.class); given(variableScope.hasVariable("myVar")).willReturn(true); boolean canResolve = resolver.canResolve("myVar", variableScope); assertThat(canResolve).isTrue(); }
@Test public void canResolve_should_returnFalseWhenVariableScopeDoesNotHaveVariableForProperty() { VariableScope variableScope = mock(VariableScope.class); given(variableScope.hasVariable("myVar")).willReturn(false); boolean canResolve = resolver.canResolve("myVar", variableScope); assertThat(canResolve).isFalse(); }