Пример #1
0
  @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);
  }
Пример #2
0
  @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);
    }
  }