File tree Expand file tree Collapse file tree
google-cloud-firestore/src/test/java/com/google/cloud/firestore Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353import java .util .concurrent .ExecutionException ;
5454import java .util .concurrent .Executors ;
5555import java .util .concurrent .ThreadFactory ;
56+ import java .util .concurrent .atomic .AtomicInteger ;
5657import org .junit .Assert ;
5758import org .junit .Before ;
5859import org .junit .Test ;
@@ -273,17 +274,19 @@ public void limitsRetriesWithSuccess() throws Exception {
273274 .when (firestoreMock )
274275 .sendRequest (requestCapture .capture (), Matchers .<UnaryCallable <Message , Message >>any ());
275276
277+ final AtomicInteger retryCount = new AtomicInteger (1 );
278+
276279 ApiFuture <String > transaction =
277280 firestoreMock .runTransaction (
278281 new Transaction .Function <String >() {
279282 @ Override
280283 public String updateCallback (Transaction transaction ) {
281- return "foo" ;
284+ return "foo" + retryCount . getAndIncrement () ;
282285 }
283286 },
284287 TransactionOptions .create (options .getExecutor (), 6 ));
285288
286- assertEquals ("foo " , transaction .get ());
289+ assertEquals ("foo6 " , transaction .get ());
287290
288291 List <Message > requests = requestCapture .getAllValues ();
289292 assertEquals (12 , requests .size ());
You can’t perform that action at this time.
0 commit comments