diff --git a/parse/src/main/java/com/parse/ParseException.java b/parse/src/main/java/com/parse/ParseException.java index 972a8b4a..6a6ff6b2 100644 --- a/parse/src/main/java/com/parse/ParseException.java +++ b/parse/src/main/java/com/parse/ParseException.java @@ -102,7 +102,10 @@ public class ParseException extends Exception { public static final int FILE_DELETE_ERROR = 153; /** Error code indicating that the application has exceeded its request limit. */ public static final int REQUEST_LIMIT_EXCEEDED = 155; - /** Error code indicating that the request was a duplicate and has been discarded due to idempotency rules. */ + /** + * Error code indicating that the request was a duplicate and has been discarded due to + * idempotency rules. + */ public static final int DUPLICATE_REQUEST = 159; /** Error code indicating that the provided event name is invalid. */ public static final int INVALID_EVENT_NAME = 160; diff --git a/parse/src/test/java/com/parse/ParseRESTCommandTest.java b/parse/src/test/java/com/parse/ParseRESTCommandTest.java index 5d1b79c3..7d5ccb78 100644 --- a/parse/src/test/java/com/parse/ParseRESTCommandTest.java +++ b/parse/src/test/java/com/parse/ParseRESTCommandTest.java @@ -562,20 +562,20 @@ public void testIdempotencyLogic() throws Exception { ParseHttpClient mockHttpClient = mock(ParseHttpClient.class); AtomicReference requestIdAtomicReference = new AtomicReference<>(); when(mockHttpClient.execute( - argThat( - argument -> { - assertNotNull( - argument.getHeader(ParseRESTCommand.HEADER_REQUEST_ID)); - if (requestIdAtomicReference.get() == null) - requestIdAtomicReference.set( - argument.getHeader( - ParseRESTCommand.HEADER_REQUEST_ID)); - assertEquals( - argument.getHeader(ParseRESTCommand.HEADER_REQUEST_ID), - requestIdAtomicReference.get()); - return true; - }))) - .thenThrow(new IOException()); + argThat( + argument -> { + assertNotNull( + argument.getHeader(ParseRESTCommand.HEADER_REQUEST_ID)); + if (requestIdAtomicReference.get() == null) + requestIdAtomicReference.set( + argument.getHeader( + ParseRESTCommand.HEADER_REQUEST_ID)); + assertEquals( + argument.getHeader(ParseRESTCommand.HEADER_REQUEST_ID), + requestIdAtomicReference.get()); + return true; + }))) + .thenThrow(new IOException()); ParseRESTCommand.server = new URL("http://parse.com"); ParseRESTCommand command = new ParseRESTCommand.Builder().build(); @@ -583,6 +583,6 @@ public void testIdempotencyLogic() throws Exception { task.waitForCompletion(); verify(mockHttpClient, times(ParseRequest.DEFAULT_MAX_RETRIES + 1)) - .execute(any(ParseHttpRequest.class)); + .execute(any(ParseHttpRequest.class)); } }