@Test public void shouldReturnFalseIfPullerInitiallyInactiveNonStrict() throws Exception { // GIVEN Condition condition = mock(Condition.class); updatePuller.pause(); // WHEN boolean result = updatePuller.await(condition, false); // THEN assertFalse(result); verifyNoMoreInteractions(condition); }
@Test public void shouldThrowIfPullerInitiallyInactiveStrict() throws Exception { // GIVEN Condition condition = mock(Condition.class); updatePuller.pause(); // WHEN try { updatePuller.await(condition, true); fail("Should have thrown"); } catch (IllegalStateException e) { // THEN Good verifyNoMoreInteractions(condition); } }