Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Dec 12, 2024
1 parent 8d22dec commit d473186
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class HttpCompressionClientServerTests extends BaseHttpTest {

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@ParameterizedTest(name = "{displayName}({0}, {1})")
@ParameterizedTest
@MethodSource("data")
@interface ParameterizedCompressionTest {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,28 +122,28 @@ static void disposePool() {

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@ParameterizedTest(name = "{displayName}({0}, {1})")
@ParameterizedTest
@MethodSource("dataAllCombinations")
@interface ParameterizedAllCombinationsTest {
}

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@ParameterizedTest(name = "{displayName}({0}, {1})")
@ParameterizedTest
@MethodSource("dataCompatibleCombinations")
@interface ParameterizedCompatibleCombinationsTest {
}

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@ParameterizedTest(name = "{displayName}({0}, {1})")
@ParameterizedTest
@MethodSource("dataCompatibleCombinations_NoPool")
@interface ParameterizedCompatibleCombinationsNoPoolTest {
}

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@ParameterizedTest(name = "{displayName}({0}, {1})")
@ParameterizedTest
@MethodSource("dataCompatibleCombinations_CustomPool")
@interface ParameterizedCompatibleCombinationsCustomPoolTest {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void forwardedHostIpV6() {
});
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(strings = {"http", "https", "wss"})
void forwardedProtoOnly(String protocol) {
testClientRequest(
Expand All @@ -210,7 +210,7 @@ void forwardedProtoOnly(String protocol) {
});
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedFor(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -224,7 +224,7 @@ void xForwardedFor(boolean useCustomForwardedHandler) {
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedHost(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -241,7 +241,7 @@ void xForwardedHost(boolean useCustomForwardedHandler) {
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedHostEmptyHostHeader(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -258,7 +258,7 @@ void xForwardedHostEmptyHostHeader(boolean useCustomForwardedHandler) {
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedHostPortIncluded(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -274,7 +274,7 @@ void xForwardedHostPortIncluded(boolean useCustomForwardedHandler) {
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedHostAndPort(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -292,7 +292,7 @@ void xForwardedHostAndPort(boolean useCustomForwardedHandler) {
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedHostPortIncludedAndXForwardedPort(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -310,7 +310,7 @@ void xForwardedHostPortIncludedAndXForwardedPort(boolean useCustomForwardedHandl
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedPrefix(boolean useCustomForwardedHandler) {
testClientRequest(
Expand Down Expand Up @@ -357,7 +357,7 @@ void xForwardedPrefixDelimited(String input, String output) {
false);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedPrefixEmpty(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -370,7 +370,7 @@ void xForwardedPrefixEmpty(boolean useCustomForwardedHandler) {
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedPrefixMissing(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -381,7 +381,7 @@ void xForwardedPrefixMissing(boolean useCustomForwardedHandler) {
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedMultipleHeaders(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -405,7 +405,7 @@ void xForwardedMultipleHeaders(boolean useCustomForwardedHandler) {
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedHostAndEmptyPort(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -427,7 +427,7 @@ void xForwardedHostAndEmptyPort(boolean useCustomForwardedHandler) {
false);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedHostAndNonNumericPort(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -449,7 +449,7 @@ void xForwardedHostAndNonNumericPort(boolean useCustomForwardedHandler) {
true);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedForHostAndPort(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -469,7 +469,7 @@ void xForwardedForHostAndPort(boolean useCustomForwardedHandler) {
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedForHostAndPortAndProto(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -491,7 +491,7 @@ void xForwardedForHostAndPortAndProto(boolean useCustomForwardedHandler) {
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedForMultipleHostAndPortAndProto(boolean useCustomForwardedHandler) {
testClientRequest(
Expand All @@ -513,7 +513,7 @@ void xForwardedForMultipleHostAndPortAndProto(boolean useCustomForwardedHandler)
useCustomForwardedHandler);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(booleans = {true, false})
void xForwardedForAndPortOnly(boolean useCustomForwardedHandler) throws SSLException {
SslContext clientSslContext = SslContextBuilder.forClient()
Expand Down Expand Up @@ -542,7 +542,7 @@ void xForwardedForAndPortOnly(boolean useCustomForwardedHandler) throws SSLExcep
true);
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@MethodSource("forwardedProtoOnlyParams")
void xForwardedProtoOnly(String protocol, boolean useCustomForwardedHandler) {
testClientRequest(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2021-2024 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.
Expand Down Expand Up @@ -61,7 +61,7 @@ class HttpServerPostFormTests extends BaseHttpTest {

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@ParameterizedTest(name = "{displayName}({0}, {1})")
@ParameterizedTest
@MethodSource("data")
@interface ParameterizedPostFormTest {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3126,7 +3126,7 @@ void testRemoveRoutes() {
.verify(Duration.ofSeconds(5));
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(ints = {-1, 1, 2})
void testMaxKeepAliveRequests(int maxKeepAliveRequests) {
HttpServer server = createServer().handle((req, res) -> res.sendString(Mono.just("testMaxKeepAliveRequests")));
Expand Down Expand Up @@ -3176,7 +3176,7 @@ else if (maxKeepAliveRequests == 2) {
provider.disposeLater().block(Duration.ofSeconds(5));
}

@ParameterizedTest(name = "{displayName}({arguments})")
@ParameterizedTest
@ValueSource(ints = {-2, 0})
void testMaxKeepAliveRequestsBadValues(int maxKeepAliveRequests) {
assertThatExceptionOfType(IllegalArgumentException.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2021-2024 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.
Expand Down Expand Up @@ -42,15 +42,15 @@ class TrailerHeadersTests {
static final String HEADER_VALUE = "test";
static final String SPACE = " ";

@ParameterizedTest(name = "{displayName}({0})")
@ParameterizedTest
@MethodSource("disallowedTrailerHeaderNames")
void testDisallowedTrailerHeaderNames(String declaredHeaderName) {
assertThatExceptionOfType(IllegalArgumentException.class)
.isThrownBy(() -> new HttpServerOperations.TrailerHeaders(declaredHeaderName).add(declaredHeaderName, HEADER_VALUE))
.withMessage(String.format(ERROR_MESSAGE, declaredHeaderName));
}

@ParameterizedTest(name = "{displayName}({index})")
@ParameterizedTest
@ValueSource(strings = {
HEADER_NAME_1,
COMMA + HEADER_NAME_1,
Expand Down Expand Up @@ -86,7 +86,7 @@ void testNameNotIncludedInTrailerHeader() {
.withMessage(String.format(ERROR_MESSAGE, HEADER_NAME_2));
}

@ParameterizedTest(name = "{displayName}({index})")
@ParameterizedTest
@ValueSource(strings = {COMMA, EMPTY, SPACE})
void testNothingIsIncludedInTrailerHeader(String declaredHeaderNames) {
assertThatExceptionOfType(IllegalArgumentException.class)
Expand Down

0 comments on commit d473186

Please sign in to comment.