Skip to content

Commit b321a78

Browse files
committed
Updated test case to clear all System properties
1 parent 6ab357a commit b321a78

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/http-client-tests/src/main/java/software/amazon/awssdk/http/proxy/HttpClientDefaultProxyConfigTestSuite.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ public abstract class HttpClientDefaultProxyConfigTestSuite {
8484

8585
@BeforeEach
8686
public void setup() {
87+
System.clearProperty("http.proxyHost");
88+
System.clearProperty("http.proxyPort");
89+
System.clearProperty("https.proxyHost");
90+
System.clearProperty("https.proxyPort");
91+
System.clearProperty("http.nonProxyHosts");
92+
System.clearProperty("https.nonProxyHosts");
93+
System.clearProperty("https.proxyPort");
8794
mockProxy.start();
8895
mockServer.start();
8996
mockServer.stubFor(get(WireMock.urlMatching(".*"))
@@ -95,10 +102,6 @@ public void teardown() {
95102
mockServer.stop();
96103
mockProxy.stop();
97104
ENVIRONMENT_VARIABLE_HELPER.reset();
98-
System.clearProperty("http.proxyHost");
99-
System.clearProperty("http.proxyPort");
100-
System.clearProperty("https.proxyHost");
101-
System.clearProperty("https.proxyPort");
102105
}
103106

104107
public static Stream<Arguments> proxyConfigurationSettingsForEnvironmentAndSystemProperty() {
@@ -117,7 +120,7 @@ public static Stream<Arguments> proxyConfigurationSettingsForEnvironmentAndSyste
117120

118121
Arguments.of(new TestData()
119122
.addSystemProperKeyValue("none", "none")
120-
.addEnvironmentPropertyProperKeyValue("http_proxy", "http://" + "localhost" + ":" + "%s" + "/"),
123+
.addEnvironmentPropertyProperKeyValue("http_proxy", "http://" + "localhost" + ":" + "%s"),
121124
"Provided Environment Variables and No system variables uses proxy config")
122125
);
123126
}

0 commit comments

Comments
 (0)