41
41
import com .google .firestore .v1 .RunAggregationQueryResponse ;
42
42
import com .google .firestore .v1 .StructuredQuery ;
43
43
import io .grpc .Status ;
44
+ import java .time .Duration ;
44
45
import java .util .concurrent .ExecutionException ;
45
46
import java .util .concurrent .TimeUnit ;
46
47
import org .junit .Before ;
50
51
import org .mockito .Captor ;
51
52
import org .mockito .Spy ;
52
53
import org .mockito .junit .MockitoJUnitRunner ;
53
- import org .threeten .bp .Duration ;
54
54
55
55
@ RunWith (MockitoJUnitRunner .class )
56
56
public class QueryCountTest {
@@ -70,7 +70,7 @@ public class QueryCountTest {
70
70
71
71
@ Before
72
72
public void before () {
73
- doReturn (Duration .ZERO ).when (firestoreMock ).getTotalRequestTimeout ();
73
+ doReturn (Duration .ZERO ).when (firestoreMock ).getTotalRequestTimeoutDuration ();
74
74
query = firestoreMock .collection (COLLECTION_ID );
75
75
}
76
76
@@ -230,7 +230,7 @@ public void shouldNotRetryIfExceptionIsFirestoreExceptionWithNonRetryableStatus(
230
230
public void
231
231
shouldRetryIfExceptionIsFirestoreExceptionWithRetryableStatusWithInfiniteTimeoutWindow ()
232
232
throws Exception {
233
- doReturn (Duration .ZERO ).when (firestoreMock ).getTotalRequestTimeout ();
233
+ doReturn (Duration .ZERO ).when (firestoreMock ).getTotalRequestTimeoutDuration ();
234
234
doAnswer (countQueryResponse (new FirestoreException ("reason" , Status .INTERNAL )))
235
235
.doAnswer (countQueryResponse (42 ))
236
236
.when (firestoreMock )
@@ -245,7 +245,7 @@ public void shouldNotRetryIfExceptionIsFirestoreExceptionWithNonRetryableStatus(
245
245
@ Test
246
246
public void shouldRetryIfExceptionIsFirestoreExceptionWithRetryableStatusWithinTimeoutWindow ()
247
247
throws Exception {
248
- doReturn (Duration .ofDays (999 )).when (firestoreMock ).getTotalRequestTimeout ();
248
+ doReturn (Duration .ofDays (999 )).when (firestoreMock ).getTotalRequestTimeoutDuration ();
249
249
doAnswer (countQueryResponse (new FirestoreException ("reason" , Status .INTERNAL )))
250
250
.doAnswer (countQueryResponse (42 ))
251
251
.when (firestoreMock )
@@ -267,7 +267,7 @@ public void shouldRetryIfExceptionIsFirestoreExceptionWithRetryableStatusWithinT
267
267
.doReturn (TimeUnit .SECONDS .toNanos (30 ))
268
268
.when (clockMock )
269
269
.nanoTime ();
270
- doReturn (Duration .ofSeconds (5 )).when (firestoreMock ).getTotalRequestTimeout ();
270
+ doReturn (Duration .ofSeconds (5 )).when (firestoreMock ).getTotalRequestTimeoutDuration ();
271
271
doAnswer (countQueryResponse (new FirestoreException ("reason" , Status .INTERNAL )))
272
272
.doAnswer (countQueryResponse (42 ))
273
273
.when (firestoreMock )
0 commit comments