Skip to content

Commit ef9449c

Browse files
authored
Merge pull request #192 from imonteroperez/adapt-ipv6
Remove hardcoded IPv4 address for testing on IPv6 env
2 parents c5e07ea + 1e5819e commit ef9449c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/java/jenkins/plugins/okhttp/api/ClientTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.jvnet.hudson.test.JenkinsRule;
1717

1818
import java.io.IOException;
19+
import java.net.InetAddress;
1920
import java.net.Proxy;
2021
import java.net.SocketTimeoutException;
2122
import java.net.URI;
@@ -149,7 +150,7 @@ public void testTimeout() throws ExecutionException, InterruptedException {
149150

150151
@Test
151152
public void testProxy() throws ExecutionException, InterruptedException, IOException {
152-
jenkinsRule.jenkins.setProxy(new ProxyConfiguration("127.0.0.1", proxy.port(), "proxy-user", "proxy-pass"));
153+
jenkinsRule.jenkins.setProxy(new ProxyConfiguration(InetAddress.getLoopbackAddress().getHostAddress(), proxy.port(), "proxy-user", "proxy-pass"));
153154
secureProxy("Basic", "proxy-user:proxy-pass");
154155
server.stubFor(WireMock.get("/hello").willReturn(aResponse().proxiedFrom(proxy.baseUrl())));
155156

@@ -167,7 +168,7 @@ public void testProxy() throws ExecutionException, InterruptedException, IOExcep
167168

168169
@Test
169170
public void testProxyWithBasicAuthAndRealm() throws ExecutionException, InterruptedException, IOException {
170-
jenkinsRule.jenkins.setProxy(new ProxyConfiguration("127.0.0.1", proxy.port(), "proxy-user", "proxy-pass"));
171+
jenkinsRule.jenkins.setProxy(new ProxyConfiguration(InetAddress.getLoopbackAddress().getHostAddress(), proxy.port(), "proxy-user", "proxy-pass"));
171172
secureProxy("Basic realm=\"somerealm\"", "proxy-user:proxy-pass");
172173
server.stubFor(WireMock.get("/hello").willReturn(aResponse().proxiedFrom(proxy.baseUrl())));
173174

0 commit comments

Comments
 (0)