3030package com .google .api .gax .batching ;
3131
3232import static com .google .common .truth .Truth .assertThat ;
33+ import static org .awaitility .Awaitility .await ;
3334import static org .junit .jupiter .api .Assertions .assertEquals ;
3435import static org .junit .jupiter .api .Assertions .assertThrows ;
3536import static org .mockito .ArgumentMatchers .any ;
3637import static org .mockito .ArgumentMatchers .anyLong ;
3738import static org .mockito .ArgumentMatchers .eq ;
3839import static org .mockito .Mockito .mock ;
3940import static org .mockito .Mockito .times ;
40- import static org .awaitility .Awaitility .await ;
4141import static org .mockito .Mockito .verify ;
4242import static org .mockito .Mockito .when ;
4343
@@ -196,12 +196,16 @@ void testBatching() throws Exception {
196196 batcher .add (SimpleBatch .fromInteger (3 ));
197197 batcher .add (SimpleBatch .fromInteger (5 ));
198198 // Give time for the executor to push the batch
199- await ().atMost (Duration .ofSeconds (5 )).untilAsserted (() -> assertThat (receiver .getBatches ()).hasSize (1 ));
199+ await ()
200+ .atMost (Duration .ofSeconds (5 ))
201+ .untilAsserted (() -> assertThat (receiver .getBatches ()).hasSize (1 ));
200202
201203 batcher .add (SimpleBatch .fromInteger (7 ));
202204 batcher .add (SimpleBatch .fromInteger (9 ));
203205 // Give time for the executor to push the batch
204- await ().atMost (Duration .ofSeconds (5 )).untilAsserted (() -> assertThat (receiver .getBatches ()).hasSize (2 ));
206+ await ()
207+ .atMost (Duration .ofSeconds (5 ))
208+ .untilAsserted (() -> assertThat (receiver .getBatches ()).hasSize (2 ));
205209
206210 batcher .add (SimpleBatch .fromInteger (11 ));
207211
@@ -228,7 +232,9 @@ void testBatchingWithDelay() throws Exception {
228232 batcher .add (SimpleBatch .fromInteger (3 ));
229233 batcher .add (SimpleBatch .fromInteger (5 ));
230234 // Give time for the delay to trigger and push the batch
231- await ().atMost (Duration .ofSeconds (5 )).untilAsserted (() -> assertThat (receiver .getBatches ()).hasSize (1 ));
235+ await ()
236+ .atMost (Duration .ofSeconds (5 ))
237+ .untilAsserted (() -> assertThat (receiver .getBatches ()).hasSize (1 ));
232238
233239 batcher .add (SimpleBatch .fromInteger (11 ));
234240
0 commit comments