assertEquals(expectedResult, compute.get());
}
@Test
public void action_that_fails() throws Exception {
DataCollector collector = mock(DataCollector.class);
when(collector.collect())
.thenThrow(new Exception("Ahh!!"))
.thenThrow(new Exception("Another Ahh!!"));
Future compute = action.compute(collector);
assertNull(compute.get());
assertEquals("Another Ahh!!", action.getThrownException().getMessage());