ExecutionElResolver implements VariableScopeItemELResolver { @Override public boolean canResolve(String property, VariableScope variableScope) { return EXECUTION_KEY.equals(property) && (variableScope instanceof ExecutionEntity || variableScope instanceof TaskEntity); }  @Override boolean canResolve(String property, VariableScope variableScope); @Override Object resolve(String property, VariableScope variableScope);  }
@Test public void canResolve_should_returnTrueWhenItsExecutionEntityAndPropertyIsExecution() { boolean canResolve = resolver.canResolve(EXECUTION_KEY, new ExecutionEntityImpl()); assertThat(canResolve).isTrue(); }
@Test public void canResolve_should_returnTrueWhenItsTaskEntityAndPropertyIsExecution() { boolean canResolve = resolver.canResolve(EXECUTION_KEY, new TaskEntityImpl()); assertThat(canResolve).isTrue(); }
@Test public void canResolve_should_returnFalseWhenItsExecutionEntityAndPropertyIsNotExecution() { boolean canResolve = resolver.canResolve("anyOtherProperty", new ExecutionEntityImpl()); assertThat(canResolve).isFalse(); }
@Test public void canResolve_should_returnFalseWhenItsNotExecutionOrTaskEntityAndPropertyIsExecution() { boolean canResolve = resolver.canResolve(EXECUTION_KEY, mock(VariableScope.class)); assertThat(canResolve).isFalse(); }