@@ -71,7 +71,7 @@ public void StatusCode204StopsLongPollingTriggersOnClosed() {
71
71
72
72
assertFalse (onClosedRan .get ());
73
73
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
74
- assertTrue (block .blockingAwait (1 , TimeUnit .SECONDS ));
74
+ assertTrue (block .blockingAwait (30 , TimeUnit .SECONDS ));
75
75
assertTrue (onClosedRan .get ());
76
76
assertFalse (transport .isActive ());
77
77
}
@@ -100,7 +100,7 @@ public void LongPollingFailsWhenReceivingUnexpectedErrorCode() {
100
100
});
101
101
102
102
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
103
- assertTrue (blocker .blockingAwait (1 , TimeUnit .SECONDS ));
103
+ assertTrue (blocker .blockingAwait (30 , TimeUnit .SECONDS ));
104
104
assertFalse (transport .isActive ());
105
105
assertTrue (onClosedRan .get ());
106
106
}
@@ -158,7 +158,7 @@ public void LongPollingTransportOnReceiveGetsCalled() {
158
158
transport .setOnClose ((error ) -> {});
159
159
160
160
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
161
- assertTrue (block .blockingAwait (1 , TimeUnit .SECONDS ));
161
+ assertTrue (block .blockingAwait (30 , TimeUnit .SECONDS ));
162
162
assertTrue (onReceiveCalled .get ());
163
163
assertEquals ("TEST" , message .get ());
164
164
}
@@ -203,7 +203,7 @@ public void LongPollingTransportOnReceiveGetsCalledMultipleTimes() {
203
203
transport .setOnClose ((error ) -> {});
204
204
205
205
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
206
- assertTrue (blocker .blockingAwait (1 , TimeUnit .SECONDS ));
206
+ assertTrue (blocker .blockingAwait (30 , TimeUnit .SECONDS ));
207
207
assertTrue (onReceiveCalled .get ());
208
208
assertEquals ("FIRSTSECONDTHIRD" , message .get ());
209
209
}
@@ -219,7 +219,7 @@ public void LongPollingTransportSendsHeaders() {
219
219
requestCount .incrementAndGet ();
220
220
return Single .just (new HttpResponse (200 , "" , TestUtils .emptyByteBuffer ));
221
221
}
222
- assertTrue (close .blockingAwait (1 , TimeUnit .SECONDS ));
222
+ assertTrue (close .blockingAwait (30 , TimeUnit .SECONDS ));
223
223
return Single .just (new HttpResponse (204 , "" , TestUtils .emptyByteBuffer ));
224
224
}).on ("POST" , (req ) -> {
225
225
assertFalse (req .getHeaders ().isEmpty ());
@@ -234,7 +234,7 @@ public void LongPollingTransportSendsHeaders() {
234
234
235
235
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
236
236
ByteBuffer sendBuffer = TestUtils .stringToByteBuffer ("TEST" );
237
- assertTrue (transport .send (sendBuffer ).blockingAwait (1 , TimeUnit .SECONDS ));
237
+ assertTrue (transport .send (sendBuffer ).blockingAwait (30 , TimeUnit .SECONDS ));
238
238
close .onComplete ();
239
239
assertEquals (headerValue .get (), "VALUE" );
240
240
}
@@ -250,7 +250,7 @@ public void LongPollingTransportSetsAuthorizationHeader() {
250
250
requestCount .incrementAndGet ();
251
251
return Single .just (new HttpResponse (200 , "" , TestUtils .emptyByteBuffer ));
252
252
}
253
- assertTrue (close .blockingAwait (1 , TimeUnit .SECONDS ));
253
+ assertTrue (close .blockingAwait (30 , TimeUnit .SECONDS ));
254
254
return Single .just (new HttpResponse (204 , "" , TestUtils .emptyByteBuffer ));
255
255
})
256
256
.on ("POST" , (req ) -> {
@@ -266,7 +266,7 @@ public void LongPollingTransportSetsAuthorizationHeader() {
266
266
267
267
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
268
268
ByteBuffer sendBuffer = TestUtils .stringToByteBuffer ("TEST" );
269
- assertTrue (transport .send (sendBuffer ).blockingAwait (1 , TimeUnit .SECONDS ));
269
+ assertTrue (transport .send (sendBuffer ).blockingAwait (30 , TimeUnit .SECONDS ));
270
270
assertEquals (headerValue .get (), "Bearer TOKEN" );
271
271
close .onComplete ();
272
272
}
@@ -285,7 +285,7 @@ public void LongPollingTransportRunsAccessTokenProviderEveryRequest() {
285
285
}
286
286
assertEquals ("Bearer TOKEN1" , req .getHeaders ().get ("Authorization" ));
287
287
secondGet .onComplete ();
288
- assertTrue (close .blockingAwait (1 , TimeUnit .SECONDS ));
288
+ assertTrue (close .blockingAwait (30 , TimeUnit .SECONDS ));
289
289
return Single .just (new HttpResponse (204 , "" , TestUtils .emptyByteBuffer ));
290
290
})
291
291
.on ("POST" , (req ) -> {
@@ -301,9 +301,9 @@ public void LongPollingTransportRunsAccessTokenProviderEveryRequest() {
301
301
transport .setOnClose ((error ) -> {});
302
302
303
303
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
304
- secondGet .blockingAwait (1 , TimeUnit .SECONDS );
304
+ secondGet .blockingAwait (30 , TimeUnit .SECONDS );
305
305
ByteBuffer sendBuffer = TestUtils .stringToByteBuffer ("TEST" );
306
- assertTrue (transport .send (sendBuffer ).blockingAwait (1 , TimeUnit .SECONDS ));
306
+ assertTrue (transport .send (sendBuffer ).blockingAwait (30 , TimeUnit .SECONDS ));
307
307
assertEquals ("Bearer TOKEN2" , headerValue .get ());
308
308
close .onComplete ();
309
309
}
@@ -336,12 +336,12 @@ public void After204StopDoesNotTriggerOnCloseAgain() {
336
336
337
337
assertFalse (onClosedRan .get ());
338
338
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
339
- assertTrue (block .blockingAwait (1 , TimeUnit .SECONDS ));
339
+ assertTrue (block .blockingAwait (30 , TimeUnit .SECONDS ));
340
340
assertEquals (1 , onCloseCount .get ());
341
341
assertTrue (onClosedRan .get ());
342
342
assertFalse (transport .isActive ());
343
343
344
- assertTrue (transport .stop ().blockingAwait (1 , TimeUnit .SECONDS ));
344
+ assertTrue (transport .stop ().blockingAwait (30 , TimeUnit .SECONDS ));
345
345
assertEquals (1 , onCloseCount .get ());
346
346
}
347
347
@@ -355,7 +355,7 @@ public void StoppingTransportRunsCloseHandlersOnce() {
355
355
firstPoll .set (false );
356
356
return Single .just (new HttpResponse (200 , "" , TestUtils .emptyByteBuffer ));
357
357
} else {
358
- assertTrue (block .blockingAwait (1 , TimeUnit .SECONDS ));
358
+ assertTrue (block .blockingAwait (30 , TimeUnit .SECONDS ));
359
359
return Single .just (new HttpResponse (204 , "" , TestUtils .emptyByteBuffer ));
360
360
}
361
361
})
@@ -374,7 +374,7 @@ public void StoppingTransportRunsCloseHandlersOnce() {
374
374
375
375
assertEquals (0 , onCloseCount .get ());
376
376
transport .start ("http://example.com" ).timeout (30 , TimeUnit .SECONDS ).blockingAwait ();
377
- assertTrue (transport .stop ().blockingAwait (1 , TimeUnit .SECONDS ));
377
+ assertTrue (transport .stop ().blockingAwait (30 , TimeUnit .SECONDS ));
378
378
assertEquals (1 , onCloseCount .get ());
379
379
assertFalse (transport .isActive ());
380
380
}
0 commit comments