Skip to content

Commit 36e80c4

Browse files
id4usiluwatar
authored andcommitted
fixed failing tests (iluwatar#860) (iluwatar#880)
1 parent 3454941 commit 36e80c4

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

twin/src/test/java/com/iluwatar/twin/BallThreadTest.java

+7-10
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@
3030
import static org.junit.jupiter.api.Assertions.assertTimeout;
3131
import static org.mockito.Matchers.any;
3232
import static org.mockito.Matchers.eq;
33-
import static org.mockito.Mockito.mock;
34-
import static org.mockito.Mockito.timeout;
35-
import static org.mockito.Mockito.verify;
36-
import static org.mockito.Mockito.verifyNoMoreInteractions;
37-
import static org.mockito.Mockito.verifyZeroInteractions;
33+
import static org.mockito.Mockito.*;
3834

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

5753
ballThread.start();
58-
59-
verify(ballItem, timeout(2000).atLeastOnce()).draw();
60-
verify(ballItem, timeout(2000).atLeastOnce()).move();
54+
sleep(200);
55+
verify(ballItem, atLeastOnce()).draw();
56+
verify(ballItem, atLeastOnce()).move();
6157
ballThread.suspendMe();
6258

6359
sleep(1000);
@@ -88,8 +84,9 @@ public void testResume() {
8884
verifyZeroInteractions(ballItem);
8985

9086
ballThread.resumeMe();
91-
verify(ballItem, timeout(2000).atLeastOnce()).draw();
92-
verify(ballItem, timeout(2000).atLeastOnce()).move();
87+
sleep(200);
88+
verify(ballItem, atLeastOnce()).draw();
89+
verify(ballItem, atLeastOnce()).move();
9390

9491
ballThread.stopMe();
9592
ballThread.join();

0 commit comments

Comments
 (0)