@@ -103,7 +103,7 @@ public void testPublishByDuration() throws Exception {
103103 getTestPublisherBuilder ()
104104 // To demonstrate that reaching duration will trigger publish
105105 .setBundlingSettings (
106- Publisher .DEFAULT_BUNDLING_SETTINGS
106+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS
107107 .toBuilder ()
108108 .setDelayThreshold (Duration .standardSeconds (5 ))
109109 .setElementCountThreshold (10 )
@@ -134,7 +134,7 @@ public void testPublishByNumBundledMessages() throws Exception {
134134 Publisher publisher =
135135 getTestPublisherBuilder ()
136136 .setBundlingSettings (
137- Publisher .DEFAULT_BUNDLING_SETTINGS
137+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS
138138 .toBuilder ()
139139 .setElementCountThreshold (2 )
140140 .setDelayThreshold (Duration .standardSeconds (100 ))
@@ -173,7 +173,7 @@ public void testSinglePublishByNumBytes() throws Exception {
173173 Publisher publisher =
174174 getTestPublisherBuilder ()
175175 .setBundlingSettings (
176- Publisher .DEFAULT_BUNDLING_SETTINGS
176+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS
177177 .toBuilder ()
178178 .setElementCountThreshold (2 )
179179 .setDelayThreshold (Duration .standardSeconds (100 ))
@@ -208,7 +208,7 @@ public void testPublishMixedSizeAndDuration() throws Exception {
208208 getTestPublisherBuilder ()
209209 // To demonstrate that reaching duration will trigger publish
210210 .setBundlingSettings (
211- Publisher .DEFAULT_BUNDLING_SETTINGS
211+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS
212212 .toBuilder ()
213213 .setElementCountThreshold (2 )
214214 .setDelayThreshold (Duration .standardSeconds (5 ))
@@ -256,7 +256,7 @@ public void testPublishFailureRetries() throws Exception {
256256 getTestPublisherBuilder ()
257257 .setExecutor (Executors .newSingleThreadScheduledExecutor ())
258258 .setBundlingSettings (
259- Publisher .DEFAULT_BUNDLING_SETTINGS
259+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS
260260 .toBuilder ()
261261 .setElementCountThreshold (1 )
262262 .setDelayThreshold (Duration .standardSeconds (5 ))
@@ -281,7 +281,7 @@ public void testPublishFailureRetries_exceededsRetryDuration() throws Exception
281281 .setExecutor (Executors .newSingleThreadScheduledExecutor ())
282282 .setSendBundleDeadline (Duration .standardSeconds (10 ))
283283 .setBundlingSettings (
284- Publisher .DEFAULT_BUNDLING_SETTINGS
284+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS
285285 .toBuilder ()
286286 .setElementCountThreshold (1 )
287287 .setDelayThreshold (Duration .standardSeconds (5 ))
@@ -310,7 +310,7 @@ public void testPublishFailureRetries_nonRetryableFailsImmediately() throws Exce
310310 .setExecutor (Executors .newSingleThreadScheduledExecutor ())
311311 .setSendBundleDeadline (Duration .standardSeconds (10 ))
312312 .setBundlingSettings (
313- Publisher .DEFAULT_BUNDLING_SETTINGS
313+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS
314314 .toBuilder ()
315315 .setElementCountThreshold (1 )
316316 .setDelayThreshold (Duration .standardSeconds (5 ))
@@ -371,16 +371,17 @@ public void testBuilderParametersAndDefaults() {
371371 assertEquals (Optional .absent (), builder .executor );
372372 assertFalse (builder .failOnFlowControlLimits );
373373 assertEquals (
374- Publisher .DEFAULT_MAX_BUNDLE_BYTES ,
374+ Publisher .Builder . DEFAULT_MAX_BUNDLE_BYTES ,
375375 builder .bundlingSettings .getRequestByteThreshold ().longValue ());
376376 assertEquals (
377- Publisher .DEFAULT_MAX_BUNDLE_DURATION , builder .bundlingSettings .getDelayThreshold ());
377+ Publisher .Builder .DEFAULT_MAX_BUNDLE_DURATION ,
378+ builder .bundlingSettings .getDelayThreshold ());
378379 assertEquals (
379- Publisher .DEFAULT_MAX_BUNDLE_MESSAGES ,
380+ Publisher .Builder . DEFAULT_MAX_BUNDLE_MESSAGES ,
380381 builder .bundlingSettings .getElementCountThreshold ().longValue ());
381382 assertEquals (FlowController .Settings .DEFAULT , builder .flowControlSettings );
382- assertEquals (Publisher .DEFAULT_REQUEST_TIMEOUT , builder .requestTimeout );
383- assertEquals (Publisher .MIN_SEND_BUNDLE_DURATION , builder .sendBundleDeadline );
383+ assertEquals (Publisher .Builder . DEFAULT_REQUEST_TIMEOUT , builder .requestTimeout );
384+ assertEquals (Publisher .Builder . MIN_SEND_BUNDLE_DURATION , builder .sendBundleDeadline );
384385 assertEquals (Optional .absent (), builder .userCredentials );
385386 }
386387
@@ -410,7 +411,7 @@ public void testBuilderInvalidArguments() {
410411 }
411412 try {
412413 builder .setBundlingSettings (
413- Publisher .DEFAULT_BUNDLING_SETTINGS
414+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS
414415 .toBuilder ()
415416 .setRequestByteThreshold ((Long ) null )
416417 .build ());
@@ -420,31 +421,40 @@ public void testBuilderInvalidArguments() {
420421 }
421422 try {
422423 builder .setBundlingSettings (
423- Publisher .DEFAULT_BUNDLING_SETTINGS .toBuilder ().setRequestByteThreshold (0 ).build ());
424+ Publisher .Builder .DEFAULT_BUNDLING_SETTINGS
425+ .toBuilder ()
426+ .setRequestByteThreshold (0 )
427+ .build ());
424428 fail ("Should have thrown an IllegalArgumentException" );
425429 } catch (IllegalArgumentException expected ) {
426430 // Expected
427431 }
428432 try {
429433 builder .setBundlingSettings (
430- Publisher .DEFAULT_BUNDLING_SETTINGS .toBuilder ().setRequestByteThreshold (-1 ).build ());
434+ Publisher .Builder .DEFAULT_BUNDLING_SETTINGS
435+ .toBuilder ()
436+ .setRequestByteThreshold (-1 )
437+ .build ());
431438 fail ("Should have thrown an IllegalArgumentException" );
432439 } catch (IllegalArgumentException expected ) {
433440 // Expected
434441 }
435442
436443 builder .setBundlingSettings (
437- Publisher .DEFAULT_BUNDLING_SETTINGS .toBuilder ().setDelayThreshold (new Duration (1 )).build ());
444+ Publisher .Builder .DEFAULT_BUNDLING_SETTINGS
445+ .toBuilder ()
446+ .setDelayThreshold (new Duration (1 ))
447+ .build ());
438448 try {
439449 builder .setBundlingSettings (
440- Publisher .DEFAULT_BUNDLING_SETTINGS .toBuilder ().setDelayThreshold (null ).build ());
450+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS .toBuilder ().setDelayThreshold (null ).build ());
441451 fail ("Should have thrown an NullPointerException" );
442452 } catch (NullPointerException expected ) {
443453 // Expected
444454 }
445455 try {
446456 builder .setBundlingSettings (
447- Publisher .DEFAULT_BUNDLING_SETTINGS
457+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS
448458 .toBuilder ()
449459 .setDelayThreshold (new Duration (-1 ))
450460 .build ());
@@ -454,10 +464,13 @@ public void testBuilderInvalidArguments() {
454464 }
455465
456466 builder .setBundlingSettings (
457- Publisher .DEFAULT_BUNDLING_SETTINGS .toBuilder ().setElementCountThreshold (1 ).build ());
467+ Publisher .Builder .DEFAULT_BUNDLING_SETTINGS
468+ .toBuilder ()
469+ .setElementCountThreshold (1 )
470+ .build ());
458471 try {
459472 builder .setBundlingSettings (
460- Publisher .DEFAULT_BUNDLING_SETTINGS
473+ Publisher .Builder . DEFAULT_BUNDLING_SETTINGS
461474 .toBuilder ()
462475 .setElementCountThreshold ((Long ) null )
463476 .build ());
@@ -467,14 +480,20 @@ public void testBuilderInvalidArguments() {
467480 }
468481 try {
469482 builder .setBundlingSettings (
470- Publisher .DEFAULT_BUNDLING_SETTINGS .toBuilder ().setElementCountThreshold (0 ).build ());
483+ Publisher .Builder .DEFAULT_BUNDLING_SETTINGS
484+ .toBuilder ()
485+ .setElementCountThreshold (0 )
486+ .build ());
471487 fail ("Should have thrown an IllegalArgumentException" );
472488 } catch (IllegalArgumentException expected ) {
473489 // Expected
474490 }
475491 try {
476492 builder .setBundlingSettings (
477- Publisher .DEFAULT_BUNDLING_SETTINGS .toBuilder ().setElementCountThreshold (-1 ).build ());
493+ Publisher .Builder .DEFAULT_BUNDLING_SETTINGS
494+ .toBuilder ()
495+ .setElementCountThreshold (-1 )
496+ .build ());
478497 fail ("Should have thrown an IllegalArgumentException" );
479498 } catch (IllegalArgumentException expected ) {
480499 // Expected
@@ -532,16 +551,16 @@ public void testBuilderInvalidArguments() {
532551 // Expected
533552 }
534553
535- builder .setRequestTimeout (Publisher .MIN_REQUEST_TIMEOUT );
554+ builder .setRequestTimeout (Publisher .Builder . MIN_REQUEST_TIMEOUT );
536555 try {
537- builder .setRequestTimeout (Publisher .MIN_REQUEST_TIMEOUT .minus (1 ));
556+ builder .setRequestTimeout (Publisher .Builder . MIN_REQUEST_TIMEOUT .minus (1 ));
538557 fail ("Should have thrown an IllegalArgumentException" );
539558 } catch (IllegalArgumentException expected ) {
540559 // Expected
541560 }
542- builder .setSendBundleDeadline (Publisher .MIN_SEND_BUNDLE_DURATION );
561+ builder .setSendBundleDeadline (Publisher .Builder . MIN_SEND_BUNDLE_DURATION );
543562 try {
544- builder .setSendBundleDeadline (Publisher .MIN_SEND_BUNDLE_DURATION .minus (1 ));
563+ builder .setSendBundleDeadline (Publisher .Builder . MIN_SEND_BUNDLE_DURATION .minus (1 ));
545564 fail ("Should have thrown an IllegalArgumentException" );
546565 } catch (IllegalArgumentException expected ) {
547566 // Expected
0 commit comments