TaskElResolver implements VariableScopeItemELResolver { @Override public boolean canResolve(String property, VariableScope variableScope) { return TASK_KEY.equals(property) && variableScope instanceof TaskEntity; }  @Override boolean canResolve(String property, VariableScope variableScope); @Override Object resolve(String property, VariableScope variableScope);  }
@Test public void canResolve_should_returnTrueWhenItsTaskEntityAndPropertyIsTask() { boolean canResolve = resolver.canResolve(TASK_KEY, new TaskEntityImpl()); assertThat(canResolve).isTrue(); }
@Test public void canResolve_should_returnFalseWhenItsTaskEntityAndPropertyIsNotTask() { boolean canResolve = resolver.canResolve("differentFromTask", new TaskEntityImpl()); assertThat(canResolve).isFalse(); }
@Test public void canResolve_should_returnFalseWhenItsNotTaskEntityEntityAndPropertyIsTask() { boolean canResolve = resolver.canResolve(TASK_KEY, mock(VariableScope.class)); assertThat(canResolve).isFalse(); }