aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-09-06 14:38:25 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-09-13 15:50:50 +0200
commit0d06d27d3c0f1a35384b40926e34dc0020de998d (patch)
tree1246636c4acf1d1c5d9c00de23dfada6646f17bd /tests
parent893b3d2f8d5e5d2789cd5c954d8016742bfc18e5 (diff)
downloadsonarqube-0d06d27d3c0f1a35384b40926e34dc0020de998d.tar.gz
sonarqube-0d06d27d3c0f1a35384b40926e34dc0020de998d.zip
SONAR-9741 make NetworkUtils an interface
to allow unit testing
Diffstat (limited to 'tests')
-rw-r--r--tests/src/test/java/org/sonarqube/tests/Byteman.java2
-rw-r--r--tests/src/test/java/org/sonarqube/tests/settings/ElasticsearchSettingsTest.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/src/test/java/org/sonarqube/tests/Byteman.java b/tests/src/test/java/org/sonarqube/tests/Byteman.java
index 315d2c2cd01..2de41f2acbd 100644
--- a/tests/src/test/java/org/sonarqube/tests/Byteman.java
+++ b/tests/src/test/java/org/sonarqube/tests/Byteman.java
@@ -50,7 +50,7 @@ public class Byteman {
public Byteman(OrchestratorBuilder builder, Process process) {
this.builder = builder;
String jar = findBytemanJar();
- port = NetworkUtils.getNextAvailablePort(InetAddress.getLoopbackAddress());
+ port = NetworkUtils.INSTANCE.getNextAvailablePort(InetAddress.getLoopbackAddress());
String bytemanArg = format("-javaagent:%s=boot:%s,port:%d", jar, jar, port);
builder.setServerProperty(process.argument, bytemanArg);
}
diff --git a/tests/src/test/java/org/sonarqube/tests/settings/ElasticsearchSettingsTest.java b/tests/src/test/java/org/sonarqube/tests/settings/ElasticsearchSettingsTest.java
index 195278edbcb..ee69c552878 100644
--- a/tests/src/test/java/org/sonarqube/tests/settings/ElasticsearchSettingsTest.java
+++ b/tests/src/test/java/org/sonarqube/tests/settings/ElasticsearchSettingsTest.java
@@ -33,7 +33,7 @@ public class ElasticsearchSettingsTest {
@Test
public void set_http_port_through_sonar_properties() throws Exception {
- int port = NetworkUtils.getNextAvailablePort(InetAddress.getLoopbackAddress());
+ int port = NetworkUtils.INSTANCE.getNextAvailablePort(InetAddress.getLoopbackAddress());
Orchestrator orchestrator = Orchestrator
.builderEnv()
.setServerProperty("sonar.search.httpPort", "" + port)