diff --git a/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/AccessLogArgProviderH2Tests.java b/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/AccessLogArgProviderH2Tests.java index 437ddbf9d8..3c68ce4bd9 100644 --- a/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/AccessLogArgProviderH2Tests.java +++ b/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/AccessLogArgProviderH2Tests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2022 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,8 +30,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatNullPointerException; -import static reactor.netty.http.server.logging.LoggingTests.HEADER_CONNECTION_NAME; -import static reactor.netty.http.server.logging.LoggingTests.HEADER_CONNECTION_VALUE; +import static reactor.netty.http.server.logging.LoggingTests.HEADER_TEST_NAME; +import static reactor.netty.http.server.logging.LoggingTests.HEADER_TEST_VALUE; import static reactor.netty.http.server.logging.LoggingTests.URI; @@ -45,7 +45,7 @@ class AccessLogArgProviderH2Tests { static { Http2Headers requestHttpHeaders = new DefaultHttp2Headers(); - requestHttpHeaders.add(HEADER_CONNECTION_NAME, HEADER_CONNECTION_VALUE); + requestHttpHeaders.add(HEADER_TEST_NAME, HEADER_TEST_VALUE); requestHttpHeaders.method(HttpMethod.GET.name()); requestHttpHeaders.path(URI); requestHeaders = new DefaultHttp2HeadersFrame(requestHttpHeaders); @@ -94,10 +94,10 @@ void protocol() { @Test void requestHeader() { assertThatNullPointerException().isThrownBy(() -> accessLogArgProvider.requestHeader(null)); - assertThat(accessLogArgProvider.requestHeader(HEADER_CONNECTION_NAME)).isNull(); + assertThat(accessLogArgProvider.requestHeader(HEADER_TEST_NAME)).isNull(); accessLogArgProvider.requestHeaders(requestHeaders); - assertThat(accessLogArgProvider.requestHeader(HEADER_CONNECTION_NAME)) - .isEqualTo(HEADER_CONNECTION_VALUE); + assertThat(accessLogArgProvider.requestHeader(HEADER_TEST_NAME)) + .isEqualTo(HEADER_TEST_VALUE); } @Test diff --git a/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/AccessLogHandlerH2Tests.java b/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/AccessLogHandlerH2Tests.java index 6314bb1250..b63fbf561f 100644 --- a/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/AccessLogHandlerH2Tests.java +++ b/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/AccessLogHandlerH2Tests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2022 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,8 +29,8 @@ import java.net.SocketAddress; import static org.assertj.core.api.Assertions.assertThat; -import static reactor.netty.http.server.logging.LoggingTests.HEADER_CONNECTION_NAME; -import static reactor.netty.http.server.logging.LoggingTests.HEADER_CONNECTION_VALUE; +import static reactor.netty.http.server.logging.LoggingTests.HEADER_TEST_NAME; +import static reactor.netty.http.server.logging.LoggingTests.HEADER_TEST_VALUE; import static reactor.netty.http.server.logging.LoggingTests.RESPONSE_CONTENT; import static reactor.netty.http.server.logging.LoggingTests.URI; @@ -45,14 +45,14 @@ void accessLogArgs() { channel.pipeline().addLast(new AccessLogHandlerH2( args -> { assertAccessLogArgProvider(args, channel.remoteAddress()); - return AccessLog.create("{}={}", HEADER_CONNECTION_NAME, - args.requestHeader(HEADER_CONNECTION_NAME)); + return AccessLog.create("{}={}", HEADER_TEST_NAME, + args.requestHeader(HEADER_TEST_NAME)); })); Http2Headers requestHeaders = new DefaultHttp2Headers(); requestHeaders.method(HttpMethod.GET.name()); requestHeaders.path(URI); - requestHeaders.add(HEADER_CONNECTION_NAME, HEADER_CONNECTION_VALUE); + requestHeaders.add(HEADER_TEST_NAME, HEADER_TEST_VALUE); channel.writeInbound(new DefaultHttp2HeadersFrame(requestHeaders)); Http2Headers responseHeaders = new DefaultHttp2Headers(); @@ -75,7 +75,7 @@ private void assertAccessLogArgProvider(AccessLogArgProvider args, SocketAddress assertThat(args.protocol()).isEqualTo(AccessLogArgProviderH2.H2_PROTOCOL_NAME); assertThat(args.status()).isEqualTo(HttpResponseStatus.OK.codeAsText()); assertThat(args.contentLength()).isEqualTo(RESPONSE_CONTENT.length); - assertThat(args.requestHeader(HEADER_CONNECTION_NAME)).isEqualTo(HEADER_CONNECTION_VALUE); + assertThat(args.requestHeader(HEADER_TEST_NAME)).isEqualTo(HEADER_TEST_VALUE); } } diff --git a/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/LoggingTests.java b/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/LoggingTests.java index 384e6cf0a8..76aca05515 100644 --- a/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/LoggingTests.java +++ b/reactor-netty-http/src/test/java/reactor/netty/http/server/logging/LoggingTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2022 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,8 @@ class LoggingTests { static final CharSequence HEADER_CONNECTION_NAME = HttpHeaderNames.CONNECTION; static final String HEADER_CONNECTION_VALUE = "keep-alive"; + static final CharSequence HEADER_TEST_NAME = "test"; + static final String HEADER_TEST_VALUE = "test"; static final String URI = "/hello"; static final byte[] RESPONSE_CONTENT = "Hello".getBytes(StandardCharsets.UTF_8);