@@ -75,7 +75,7 @@ public void ensuresTasksScheduling() throws InterruptedException {
75
75
Disposable disposable = scheduler .schedule (latch ::countDown );
76
76
77
77
Assertions .assertThat (latch .await (5 , TimeUnit .SECONDS )).isTrue ();
78
- Assertions .assertThat (disposable .isDisposed ()).isTrue ();
78
+ Awaitility . await (). untilAsserted (() -> Assertions .assertThat (disposable .isDisposed ()).isTrue () );
79
79
}
80
80
81
81
@ Test
@@ -108,7 +108,7 @@ public void ensuresTasksDelayedScheduling() throws InterruptedException {
108
108
.until (() -> ((ScheduledThreadPoolExecutor ) resource .sharedDelayedTasksScheduler ).getQueue ().isEmpty ());
109
109
110
110
Assertions .assertThat (latch .await (5 , TimeUnit .SECONDS )).isTrue ();
111
- Assertions .assertThat (disposable .isDisposed ()).isTrue ();
111
+ Awaitility . await (). untilAsserted (() -> Assertions .assertThat (disposable .isDisposed ()).isTrue () );
112
112
}
113
113
114
114
@ Test
@@ -135,7 +135,7 @@ public void ensuresTasksDelayedZeroDelayScheduling() throws InterruptedException
135
135
Assertions .assertThat (((ScheduledThreadPoolExecutor ) resource .sharedDelayedTasksScheduler ).getQueue ().size ()).isZero ();
136
136
137
137
Assertions .assertThat (latch .await (5 , TimeUnit .SECONDS )).isTrue ();
138
- Assertions .assertThat (disposable .isDisposed ()).isTrue ();
138
+ Awaitility . await (). untilAsserted (() -> Assertions .assertThat (disposable .isDisposed ()).isTrue () );
139
139
140
140
// unblock scheduler
141
141
awaiter .countDown ();
@@ -153,7 +153,7 @@ public void ensuresTasksPeriodicScheduling() throws InterruptedException {
153
153
Assertions .assertThat (latch .await (5 , TimeUnit .SECONDS )).isTrue ();
154
154
Assertions .assertThat (disposable .isDisposed ()).isFalse ();
155
155
disposable .dispose ();
156
- Assertions .assertThat (disposable .isDisposed ()).isTrue ();
156
+ Awaitility . await (). untilAsserted (() -> Assertions .assertThat (disposable .isDisposed ()).isTrue () );
157
157
}
158
158
159
159
@ Test
@@ -168,7 +168,7 @@ public void ensuresTasksPeriodicZeroInitialDelayScheduling() throws InterruptedE
168
168
Assertions .assertThat (latch .await (5 , TimeUnit .SECONDS )).isTrue ();
169
169
Assertions .assertThat (disposable .isDisposed ()).isFalse ();
170
170
disposable .dispose ();
171
- Assertions .assertThat (disposable .isDisposed ()).isTrue ();
171
+ Awaitility . await (). untilAsserted (() -> Assertions .assertThat (disposable .isDisposed ()).isTrue () );
172
172
}
173
173
174
174
@ Test
@@ -183,7 +183,7 @@ public void ensuresTasksPeriodicWithInitialDelayAndInstantPeriodScheduling() thr
183
183
Assertions .assertThat (latch .await (5 , TimeUnit .SECONDS )).isTrue ();
184
184
Assertions .assertThat (disposable .isDisposed ()).isFalse ();
185
185
disposable .dispose ();
186
- Assertions .assertThat (disposable .isDisposed ()).isTrue ();
186
+ Awaitility . await (). untilAsserted (() -> Assertions .assertThat (disposable .isDisposed ()).isTrue () );
187
187
}
188
188
189
189
@ Test
@@ -198,7 +198,7 @@ public void ensuresTasksPeriodicWithZeroInitialDelayAndInstantPeriodScheduling()
198
198
Assertions .assertThat (latch .await (5 , TimeUnit .SECONDS )).isTrue ();
199
199
Assertions .assertThat (disposable .isDisposed ()).isFalse ();
200
200
disposable .dispose ();
201
- Assertions .assertThat (disposable .isDisposed ()).isTrue ();
201
+ Awaitility . await (). untilAsserted (() -> Assertions .assertThat (disposable .isDisposed ()).isTrue () );
202
202
}
203
203
204
204
@ Test
0 commit comments