@@ -151,8 +151,8 @@ void retry() {
151
151
assertThat (callable .call (initialRequest )).isEqualTo (2 );
152
152
assertThat (tracerFactory .getTracerAttemptsFailed ().get ()).isEqualTo (3 );
153
153
assertThat (tracerFactory .getTracerAttempts ().get ()).isEqualTo (4 );
154
- assertThat (tracerFactory .getTracerOperationFailed ().get ()).isEqualTo ( false );
155
- assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isEqualTo ( false );
154
+ assertThat (tracerFactory .getTracerOperationFailed ().get ()).isFalse ( );
155
+ assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isFalse ( );
156
156
157
157
// Capture the argument passed to futureCall
158
158
ArgumentCaptor <Integer > argumentCaptor = ArgumentCaptor .forClass (Integer .class );
@@ -192,7 +192,8 @@ void retryTotalTimeoutExceeded() {
192
192
assertThrows (ApiException .class , () -> callable .call (initialRequest ));
193
193
assertThat (tracerFactory .getTracerAttempts ().get ()).isEqualTo (1 );
194
194
assertThat (tracerFactory .getTracerAttemptsFailed ().get ()).isEqualTo (0 );
195
- assertThat (tracerFactory .getTracerOperationFailed ().get ()).isEqualTo (true );
195
+ assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isFalse ();
196
+ assertThat (tracerFactory .getTracerOperationFailed ().get ()).isTrue ();
196
197
// Capture the argument passed to futureCall
197
198
ArgumentCaptor <Integer > argumentCaptor = ArgumentCaptor .forClass (Integer .class );
198
199
verify (callInt , atLeastOnce ()).futureCall (argumentCaptor .capture (), any (ApiCallContext .class ));
@@ -215,7 +216,8 @@ void retryMaxAttemptsExceeded() {
215
216
assertThrows (ApiException .class , () -> callable .call (initialRequest ));
216
217
assertThat (tracerFactory .getTracerAttempts ().get ()).isEqualTo (2 );
217
218
assertThat (tracerFactory .getTracerAttemptsFailed ().get ()).isEqualTo (1 );
218
- assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isEqualTo (true );
219
+ assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isTrue ();
220
+ assertThat (tracerFactory .getTracerOperationFailed ().get ()).isTrue ();
219
221
// Capture the argument passed to futureCall
220
222
ArgumentCaptor <Integer > argumentCaptor = ArgumentCaptor .forClass (Integer .class );
221
223
verify (callInt , atLeastOnce ()).futureCall (argumentCaptor .capture (), any (ApiCallContext .class ));
@@ -238,7 +240,8 @@ void retryWithinMaxAttempts() {
238
240
assertThat (callable .call (initialRequest )).isEqualTo (2 );
239
241
assertThat (tracerFactory .getTracerAttempts ().get ()).isEqualTo (3 );
240
242
assertThat (tracerFactory .getTracerAttemptsFailed ().get ()).isEqualTo (2 );
241
- assertThat (tracerFactory .getTracerOperationFailed ().get ()).isEqualTo (false );
243
+ assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isFalse ();
244
+ assertThat (tracerFactory .getTracerOperationFailed ().get ()).isFalse ();
242
245
// Capture the argument passed to futureCall
243
246
ArgumentCaptor <Integer > argumentCaptor = ArgumentCaptor .forClass (Integer .class );
244
247
verify (callInt , atLeastOnce ()).futureCall (argumentCaptor .capture (), any (ApiCallContext .class ));
@@ -267,7 +270,8 @@ void retryOnStatusUnknown() {
267
270
assertThat (callable .call (initialRequest )).isEqualTo (2 );
268
271
assertThat (tracerFactory .getTracerAttempts ().get ()).isEqualTo (4 );
269
272
assertThat (tracerFactory .getTracerAttemptsFailed ().get ()).isEqualTo (3 );
270
- assertThat (tracerFactory .getTracerOperationFailed ().get ()).isEqualTo (false );
273
+ assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isFalse ();
274
+ assertThat (tracerFactory .getTracerOperationFailed ().get ()).isFalse ();
271
275
// Capture the argument passed to futureCall
272
276
ArgumentCaptor <Integer > argumentCaptor = ArgumentCaptor .forClass (Integer .class );
273
277
verify (callInt , atLeastOnce ()).futureCall (argumentCaptor .capture (), any (ApiCallContext .class ));
@@ -288,7 +292,8 @@ void retryOnUnexpectedException() {
288
292
ApiException exception = assertThrows (ApiException .class , () -> callable .call (initialRequest ));
289
293
assertThat (tracerFactory .getTracerAttempts ().get ()).isEqualTo (1 );
290
294
assertThat (tracerFactory .getTracerAttemptsFailed ().get ()).isEqualTo (0 );
291
- assertThat (tracerFactory .getTracerOperationFailed ().get ()).isEqualTo (true );
295
+ assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isFalse ();
296
+ assertThat (tracerFactory .getTracerOperationFailed ().get ()).isTrue ();
292
297
assertThat (exception ).hasCauseThat ().isSameInstanceAs (throwable );
293
298
// Capture the argument passed to futureCall
294
299
ArgumentCaptor <Integer > argumentCaptor = ArgumentCaptor .forClass (Integer .class );
@@ -320,7 +325,8 @@ void retryNoRecover() {
320
325
ApiException exception = assertThrows (ApiException .class , () -> callable .call (initialRequest ));
321
326
assertThat (tracerFactory .getTracerAttempts ().get ()).isEqualTo (1 );
322
327
assertThat (tracerFactory .getTracerAttemptsFailed ().get ()).isEqualTo (0 );
323
- assertThat (tracerFactory .getTracerOperationFailed ().get ()).isEqualTo (true );
328
+ assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isFalse ();
329
+ assertThat (tracerFactory .getTracerOperationFailed ().get ()).isTrue ();
324
330
assertThat (exception ).isSameInstanceAs (apiException );
325
331
// Capture the argument passed to futureCall
326
332
ArgumentCaptor <Integer > argumentCaptor = ArgumentCaptor .forClass (Integer .class );
@@ -353,7 +359,8 @@ void retryKeepFailing() {
353
359
assertThat (tracerFactory .getTracerAttemptsFailed ().get ()).isGreaterThan (0 );
354
360
assertThat (tracerFactory .getTracerAttemptsFailed ().get ())
355
361
.isEqualTo (tracerFactory .getTracerAttempts ().get () - 1 );
356
- assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isEqualTo (true );
362
+ assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isTrue ();
363
+ assertThat (tracerFactory .getTracerOperationFailed ().get ()).isTrue ();
357
364
assertThat (exception ).hasCauseThat ().isInstanceOf (ApiException .class );
358
365
assertThat (exception ).hasCauseThat ().hasMessageThat ().contains ("Unavailable" );
359
366
// Capture the argument passed to futureCall
@@ -396,7 +403,8 @@ void testKnownStatusCode() {
396
403
assertThrows (FailedPreconditionException .class , () -> callable .call (initialRequest ));
397
404
assertThat (tracerFactory .getTracerAttempts ().get ()).isEqualTo (1 );
398
405
assertThat (tracerFactory .getTracerAttemptsFailed ().get ()).isEqualTo (0 );
399
- assertThat (tracerFactory .getTracerOperationFailed ().get ()).isEqualTo (true );
406
+ assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isFalse ();
407
+ assertThat (tracerFactory .getTracerOperationFailed ().get ()).isTrue ();
400
408
assertThat (exception .getStatusCode ().getTransportCode ())
401
409
.isEqualTo (HTTP_CODE_PRECONDITION_FAILED );
402
410
assertThat (exception ).hasMessageThat ().contains ("precondition failed" );
@@ -423,7 +431,8 @@ void testUnknownStatusCode() {
423
431
assertThat (exception ).hasMessageThat ().isEqualTo ("java.lang.RuntimeException: unknown" );
424
432
assertThat (tracerFactory .getTracerAttempts ().get ()).isEqualTo (1 );
425
433
assertThat (tracerFactory .getTracerAttemptsFailed ().get ()).isEqualTo (0 );
426
- assertThat (tracerFactory .getTracerOperationFailed ().get ()).isEqualTo (true );
434
+ assertThat (tracerFactory .getTracerFailedRetriesExhausted ().get ()).isFalse ();
435
+ assertThat (tracerFactory .getTracerOperationFailed ().get ()).isTrue ();
427
436
// Capture the argument passed to futureCall
428
437
ArgumentCaptor <Integer > argumentCaptor = ArgumentCaptor .forClass (Integer .class );
429
438
verify (callInt , atLeastOnce ()).futureCall (argumentCaptor .capture (), any (ApiCallContext .class ));
0 commit comments