From 2729b30bb0d45adfe47a8daef7bcf49649becf3a Mon Sep 17 00:00:00 2001 From: github-actions <> Date: Tue, 16 Jan 2024 06:14:33 +0000 Subject: [PATCH] Google Java Format --- .../rest/RestRequestResultErrorCodeTest.java | 83 ++++++++++--------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/src/test/java/com/github/brenoepics/at4j/util/rest/RestRequestResultErrorCodeTest.java b/src/test/java/com/github/brenoepics/at4j/util/rest/RestRequestResultErrorCodeTest.java index 7643aed..bc10d1a 100644 --- a/src/test/java/com/github/brenoepics/at4j/util/rest/RestRequestResultErrorCodeTest.java +++ b/src/test/java/com/github/brenoepics/at4j/util/rest/RestRequestResultErrorCodeTest.java @@ -11,40 +11,49 @@ class RestRequestResultErrorCodeTest { - @Test - void test_all_enum_values() { - for (RestRequestResultErrorCode errorCode : RestRequestResultErrorCode.values()) { - Optional retrievedErrorCode = RestRequestResultErrorCode.fromCode(errorCode.getCode(), errorCode.getResponseCode()); - assertTrue(retrievedErrorCode.isPresent()); - assertEquals(errorCode, retrievedErrorCode.get()); - assertEquals(errorCode.getCode(), retrievedErrorCode.get().getCode()); - assertEquals(errorCode.getMeaning(), retrievedErrorCode.get().getMeaning()); - } - } - - @Test - void test_getCode() { - Map expectedCodes = new HashMap<>(); - expectedCodes.putAll(Arrays.stream(RestRequestResultErrorCode.values()) - .collect(HashMap::new, (map, errorCode) -> map.put(errorCode, errorCode.getCode()), HashMap::putAll)); - - for (RestRequestResultErrorCode errorCode : RestRequestResultErrorCode.values()) { - int expectedCode = expectedCodes.get(errorCode); - int actualCode = errorCode.getCode(); - assertEquals(expectedCode, actualCode); - } - } - - @Test - void test_getMeaning() { - Map expectedMeanings = new HashMap<>(); - expectedMeanings.putAll(Arrays.stream(RestRequestResultErrorCode.values()) - .collect(HashMap::new, (map, errorCode) -> map.put(errorCode, errorCode.getMeaning()), HashMap::putAll)); - - for (RestRequestResultErrorCode errorCode : RestRequestResultErrorCode.values()) { - String expectedMeaning = expectedMeanings.get(errorCode); - String actualMeaning = errorCode.getMeaning(); - assertEquals(expectedMeaning, actualMeaning); - } - } -} \ No newline at end of file + @Test + void test_all_enum_values() { + for (RestRequestResultErrorCode errorCode : RestRequestResultErrorCode.values()) { + Optional retrievedErrorCode = + RestRequestResultErrorCode.fromCode(errorCode.getCode(), errorCode.getResponseCode()); + assertTrue(retrievedErrorCode.isPresent()); + assertEquals(errorCode, retrievedErrorCode.get()); + assertEquals(errorCode.getCode(), retrievedErrorCode.get().getCode()); + assertEquals(errorCode.getMeaning(), retrievedErrorCode.get().getMeaning()); + } + } + + @Test + void test_getCode() { + Map expectedCodes = new HashMap<>(); + expectedCodes.putAll( + Arrays.stream(RestRequestResultErrorCode.values()) + .collect( + HashMap::new, + (map, errorCode) -> map.put(errorCode, errorCode.getCode()), + HashMap::putAll)); + + for (RestRequestResultErrorCode errorCode : RestRequestResultErrorCode.values()) { + int expectedCode = expectedCodes.get(errorCode); + int actualCode = errorCode.getCode(); + assertEquals(expectedCode, actualCode); + } + } + + @Test + void test_getMeaning() { + Map expectedMeanings = new HashMap<>(); + expectedMeanings.putAll( + Arrays.stream(RestRequestResultErrorCode.values()) + .collect( + HashMap::new, + (map, errorCode) -> map.put(errorCode, errorCode.getMeaning()), + HashMap::putAll)); + + for (RestRequestResultErrorCode errorCode : RestRequestResultErrorCode.values()) { + String expectedMeaning = expectedMeanings.get(errorCode); + String actualMeaning = errorCode.getMeaning(); + assertEquals(expectedMeaning, actualMeaning); + } + } +}