Skip to content

Commit

Permalink
fixed failing tests (#860) (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
id4us authored and iluwatar committed Jul 29, 2019
1 parent 3454941 commit 36e80c4
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions twin/src/test/java/com/iluwatar/twin/BallThreadTest.java
Expand Up @@ -30,11 +30,7 @@
import static org.junit.jupiter.api.Assertions.assertTimeout;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.*;

/**
* Date: 12/30/15 - 18:55 PM
Expand All @@ -55,9 +51,9 @@ public void testSuspend() throws Exception {
ballThread.setTwin(ballItem);

ballThread.start();

verify(ballItem, timeout(2000).atLeastOnce()).draw();
verify(ballItem, timeout(2000).atLeastOnce()).move();
sleep(200);
verify(ballItem, atLeastOnce()).draw();
verify(ballItem, atLeastOnce()).move();
ballThread.suspendMe();

sleep(1000);
Expand Down Expand Up @@ -88,8 +84,9 @@ public void testResume() {
verifyZeroInteractions(ballItem);

ballThread.resumeMe();
verify(ballItem, timeout(2000).atLeastOnce()).draw();
verify(ballItem, timeout(2000).atLeastOnce()).move();
sleep(200);
verify(ballItem, atLeastOnce()).draw();
verify(ballItem, atLeastOnce()).move();

ballThread.stopMe();
ballThread.join();
Expand Down

0 comments on commit 36e80c4

Please sign in to comment.