diff --git a/build.gradle b/build.gradle index 42c31dfc8d..5ef27dec80 100644 --- a/build.gradle +++ b/build.gradle @@ -73,6 +73,7 @@ subprojects { options.errorprone { check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.WARN) option("NullAway:AnnotatedPackages", "com.netflix.zuul") + check("DeduplicateConstants", net.ltgt.gradle.errorprone.CheckSeverity.WARN) errorproneArgs.addAll( // Uncomment to automatically apply fixes for a check. // N.B: disables all other checks while enabled. @@ -83,7 +84,6 @@ subprojects { "-Xep:BanSerializableRead", "-Xep:ClassName", "-Xep:ComparisonContractViolated", - "-Xep:DeduplicateConstants", "-Xep:DepAnn", "-Xep:EmptyIf", "-Xep:ExtendsAutoValue", diff --git a/zuul-core/src/test/java/com/netflix/zuul/message/ZuulMessageImplTest.java b/zuul-core/src/test/java/com/netflix/zuul/message/ZuulMessageImplTest.java index a0804f9b08..21d3c66719 100644 --- a/zuul-core/src/test/java/com/netflix/zuul/message/ZuulMessageImplTest.java +++ b/zuul-core/src/test/java/com/netflix/zuul/message/ZuulMessageImplTest.java @@ -16,19 +16,21 @@ package com.netflix.zuul.message; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.netflix.zuul.context.SessionContext; import io.netty.buffer.Unpooled; import io.netty.handler.codec.http.DefaultHttpContent; import io.netty.handler.codec.http.DefaultLastHttpContent; import io.netty.handler.codec.http.HttpContent; +import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; -import java.nio.charset.StandardCharsets; - -import static org.junit.jupiter.api.Assertions.*; - @ExtendWith(MockitoExtension.class) class ZuulMessageImplTest { private static final String TEXT1 = "Hello World!"; @@ -64,7 +66,7 @@ void testBufferBody2GetBody() { final String body = new String(msg.getBody()); assertTrue(msg.hasBody()); assertTrue(msg.hasCompleteBody()); - assertEquals(TEXT1, body); + assertEquals("Hello World!", body); assertEquals(0, msg.getHeaders().getAll("Content-Length").size()); } @@ -77,7 +79,7 @@ void testBufferBody3GetBody() { final String body = new String(msg.getBody()); assertTrue(msg.hasBody()); assertTrue(msg.hasCompleteBody()); - assertEquals(TEXT1, body); + assertEquals("Hello World!", body); assertEquals(0, msg.getHeaders().getAll("Content-Length").size()); } @@ -90,7 +92,7 @@ void testBufferBody3GetBodyAsText() { final String body = msg.getBodyAsText(); assertTrue(msg.hasBody()); assertTrue(msg.hasCompleteBody()); - assertEquals(TEXT1, body); + assertEquals("Hello World!", body); assertEquals(0, msg.getHeaders().getAll("Content-Length").size()); }