From 4f45c56d01a5f903533b121ac5a6fa621592545f Mon Sep 17 00:00:00 2001 From: Abubkr Hago <24502430+abubkr-hago@users.noreply.github.com> Date: Fri, 16 Aug 2024 23:19:26 +0400 Subject: [PATCH] fix: linting errors --- .../main/java/com/parse/ParseException.java | 5 +++- .../java/com/parse/ParseRESTCommandTest.java | 30 +++++++++---------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/parse/src/main/java/com/parse/ParseException.java b/parse/src/main/java/com/parse/ParseException.java index 972a8b4aa..6a6ff6b2b 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 5d1b79c34..7d5ccb78a 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)); } }