16
16
import org .jvnet .hudson .test .JenkinsRule ;
17
17
18
18
import java .io .IOException ;
19
+ import java .net .InetAddress ;
19
20
import java .net .Proxy ;
20
21
import java .net .SocketTimeoutException ;
21
22
import java .net .URI ;
@@ -149,7 +150,7 @@ public void testTimeout() throws ExecutionException, InterruptedException {
149
150
150
151
@ Test
151
152
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" ));
153
154
secureProxy ("Basic" , "proxy-user:proxy-pass" );
154
155
server .stubFor (WireMock .get ("/hello" ).willReturn (aResponse ().proxiedFrom (proxy .baseUrl ())));
155
156
@@ -167,7 +168,7 @@ public void testProxy() throws ExecutionException, InterruptedException, IOExcep
167
168
168
169
@ Test
169
170
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" ));
171
172
secureProxy ("Basic realm=\" somerealm\" " , "proxy-user:proxy-pass" );
172
173
server .stubFor (WireMock .get ("/hello" ).willReturn (aResponse ().proxiedFrom (proxy .baseUrl ())));
173
174
0 commit comments