verifyNoMoreInteractions(first);
verifyNoMoreInteractions(second);
}
@Test
public void testFailBoth() throws IOException {
Or or = new Or();
PathData pathData = mock(PathData.class);
Expression first = mock(Expression.class);
when(first.apply(pathData)).thenReturn(Result.FAIL);
Expression second = mock(Expression.class);
when(second.apply(pathData)).thenReturn(Result.FAIL);
Deque<Expression> children = new LinkedList<Expression>();
children.add(second);
children.add(first);
or.addChildren(children);
assertEquals(Result.FAIL, or.apply(pathData));
verify(first).apply(pathData);
verify(second).apply(pathData);
verifyNoMoreInteractions(first);
verifyNoMoreInteractions(second);
}