|
33 | 33 | import java.net.URL;
|
34 | 34 | import java.util.Collections;
|
35 | 35 | import java.util.concurrent.atomic.AtomicReference;
|
36 |
| - |
37 | 36 | import org.json.JSONArray;
|
38 | 37 | import org.json.JSONObject;
|
39 | 38 | import org.junit.After;
|
@@ -562,27 +561,27 @@ public void testIdempotencyLogic() throws Exception {
|
562 | 561 | ParseHttpClient mockHttpClient = mock(ParseHttpClient.class);
|
563 | 562 | AtomicReference<String> requestIdAtomicReference = new AtomicReference<>();
|
564 | 563 | when(mockHttpClient.execute(
|
565 |
| - argThat( |
566 |
| - argument -> { |
567 |
| - assertNotNull( |
568 |
| - argument.getHeader(ParseRESTCommand.HEADER_REQUEST_ID)); |
569 |
| - if (requestIdAtomicReference.get() == null) |
570 |
| - requestIdAtomicReference.set( |
571 |
| - argument.getHeader( |
572 |
| - ParseRESTCommand.HEADER_REQUEST_ID)); |
573 |
| - assertEquals( |
574 |
| - argument.getHeader(ParseRESTCommand.HEADER_REQUEST_ID), |
575 |
| - requestIdAtomicReference.get()); |
576 |
| - return true; |
577 |
| - }))) |
578 |
| - .thenThrow(new IOException()); |
| 564 | + argThat( |
| 565 | + argument -> { |
| 566 | + assertNotNull( |
| 567 | + argument.getHeader(ParseRESTCommand.HEADER_REQUEST_ID)); |
| 568 | + if (requestIdAtomicReference.get() == null) |
| 569 | + requestIdAtomicReference.set( |
| 570 | + argument.getHeader( |
| 571 | + ParseRESTCommand.HEADER_REQUEST_ID)); |
| 572 | + assertEquals( |
| 573 | + argument.getHeader(ParseRESTCommand.HEADER_REQUEST_ID), |
| 574 | + requestIdAtomicReference.get()); |
| 575 | + return true; |
| 576 | + }))) |
| 577 | + .thenThrow(new IOException()); |
579 | 578 |
|
580 | 579 | ParseRESTCommand.server = new URL("http://parse.com");
|
581 | 580 | ParseRESTCommand command = new ParseRESTCommand.Builder().build();
|
582 | 581 | Task<Void> task = command.executeAsync(mockHttpClient).makeVoid();
|
583 | 582 | task.waitForCompletion();
|
584 | 583 |
|
585 | 584 | verify(mockHttpClient, times(ParseRequest.DEFAULT_MAX_RETRIES + 1))
|
586 |
| - .execute(any(ParseHttpRequest.class)); |
| 585 | + .execute(any(ParseHttpRequest.class)); |
587 | 586 | }
|
588 | 587 | }
|
0 commit comments