assertThat(chosenTimer, equalTo(t2));
}
@Test
public void allAreVisitedWithExceptionAndLastExceptionIsReturned() {
FluentExecutionStopped boo = new FluentExecutionStopped("boo", null);
FluentExecutionStopped boo2 = new FluentExecutionStopped("boo2", null);
WebElement we = mock(WebElement.class);
Monitor m1 = mock(Monitor.class);
when(m1.exceptionDuringExecution(boo, we)).thenReturn(boo);
Monitor m2 = mock(Monitor.class);
when(m2.exceptionDuringExecution(boo, we)).thenReturn(boo);
Monitor m3 = mock(Monitor.class);
when(m3.exceptionDuringExecution(boo, we)).thenReturn(boo2);
CompositeMonitor monitor = new CompositeMonitor(m1, m2, m3);
FluentExecutionStopped newException = monitor.exceptionDuringExecution(boo, we);
assertThat(newException, equalTo(boo2));
verify(m1).exceptionDuringExecution(boo, we);
verify(m2).exceptionDuringExecution(boo, we);