Skip to content

Commit

Permalink
Downgrade constant deduplication to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
connorworley committed Nov 4, 2024
1 parent ce0e86d commit 33a883d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!";
Expand Down Expand Up @@ -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());
}

Expand All @@ -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());
}

Expand All @@ -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());
}

Expand Down

0 comments on commit 33a883d

Please sign in to comment.