@Test
public void originalSelectionChained() {
EntityDescriptor entityDescriptor = TestdataChainedEntity.buildEntityDescriptor();
GenuineVariableDescriptor variableDescriptor = entityDescriptor.getGenuineVariableDescriptor("chainedObject");
TestdataChainedAnchor a0 = new TestdataChainedAnchor("a0");
TestdataChainedEntity a1 = new TestdataChainedEntity("a1");
TestdataChainedEntity a2 = new TestdataChainedEntity("a2");
ValueSelector childValueSelector = SelectorTestUtils.mockValueSelector(variableDescriptor,
a0, a1, a2);
ValueSelector valueSelector = new InitializedValueSelector(childValueSelector);
verify(childValueSelector, times(1)).isNeverEnding();
DefaultSolverScope solverScope = mock(DefaultSolverScope.class);
valueSelector.solvingStarted(solverScope);
AbstractPhaseScope phaseScopeA = mock(AbstractPhaseScope.class);
when(phaseScopeA.getSolverScope()).thenReturn(solverScope);
valueSelector.phaseStarted(phaseScopeA);
AbstractStepScope stepScopeA1 = mock(AbstractStepScope.class);
when(stepScopeA1.getPhaseScope()).thenReturn(phaseScopeA);
valueSelector.stepStarted(stepScopeA1);
assertAllCodesOfValueSelectorForEntity(valueSelector, a1, PlannerAssert.DO_NOT_ASSERT_SIZE, "a0");
a1.setChainedObject(a0);
valueSelector.stepEnded(stepScopeA1);
AbstractStepScope stepScopeA2 = mock(AbstractStepScope.class);
when(stepScopeA2.getPhaseScope()).thenReturn(phaseScopeA);
valueSelector.stepStarted(stepScopeA2);
assertAllCodesOfValueSelectorForEntity(valueSelector, a2, PlannerAssert.DO_NOT_ASSERT_SIZE, "a0", "a1");
a2.setChainedObject(a1);
valueSelector.stepEnded(stepScopeA2);
valueSelector.phaseEnded(phaseScopeA);
AbstractPhaseScope phaseScopeB = mock(AbstractPhaseScope.class);