ExecutionElResolver implements VariableScopeItemELResolver { @Override public Object resolve(String property, VariableScope variableScope) { if (variableScope instanceof TaskEntity) { return ((TaskEntity) variableScope).getExecution(); } return variableScope; }  @Override boolean canResolve(String property, VariableScope variableScope); @Override Object resolve(String property, VariableScope variableScope);  }
@Test public void resolve_should_returnVariableScopeWhenItsExecutionEntity() { ExecutionEntity variableScope = new ExecutionEntityImpl(); Object result = resolver.resolve(EXECUTION_KEY, variableScope); assertThat(result).isEqualTo(variableScope); }
@Test public void resolve_should_returnVariableScopeExecutionWhenItsTaskEntity() { ExecutionEntityImpl execution = new ExecutionEntityImpl(); TaskEntityImpl variableScope = new TaskEntityImpl(); variableScope.setExecution(execution); Object result = resolver.resolve(EXECUTION_KEY, variableScope); assertThat(result).isEqualTo(execution); }