diff --git a/blueocean-git-pipeline/src/test/java/io/jenkins/blueocean/blueocean_git_pipeline/GitReadSaveTest.java b/blueocean-git-pipeline/src/test/java/io/jenkins/blueocean/blueocean_git_pipeline/GitReadSaveTest.java index c86a3ae45f..596f276279 100644 --- a/blueocean-git-pipeline/src/test/java/io/jenkins/blueocean/blueocean_git_pipeline/GitReadSaveTest.java +++ b/blueocean-git-pipeline/src/test/java/io/jenkins/blueocean/blueocean_git_pipeline/GitReadSaveTest.java @@ -59,6 +59,7 @@ import java.io.File; import java.io.IOException; import java.lang.reflect.Field; +import java.net.InetAddress; import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.HashMap; @@ -86,8 +87,8 @@ public class GitReadSaveTest extends PipelineBaseTest { private final Logger logger = Logger.getLogger(getClass().getName()); private SSHServer sshd; - - private static IP_ADDRESS = InetAddress.getLoopbackAddress().getHostAddress(); + + private static String IP_ADDRESS = InetAddress.getLoopbackAddress().getHostAddress(); public GitReadSaveTest() { } @@ -195,7 +196,7 @@ private void startSSH(@Nullable User u) throws Exception { sshd.start(); } } - + private String getAddress() { return Boolean.getBoolean("java.net.preferIPv6Addresses") ? String.format("[%s]", IP_ADDRESS) : IP_ADDRESS; }