Skip to content

Commit 9de386e

Browse files
committed
Upman tests are using random server port
1 parent 29a9af3 commit 9de386e

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

integration-tests/src/test/resources/unityServer.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ unityServer.core.pkiConfigFile=src/test/resources/pki.properties
88
unityServer.core.templatesFile=src/test/resources/msgTemplates.properties
99
unityServer.core.workspaceDirectory=target/workspace
1010
unityServer.core.defaultWebContentDirectory=../vaadin-styles/src/main/resources
11+
unityServer.core.defaultWebPath=/home
1112

1213
unityServer.core.asyncStateUpdateInterval=20
1314
unityServer.core.auditEventLogsEnabled=true

web-upman/src/test/java/io/imunity/upman/rest/UpmanRESTTestBase.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,22 @@ public void setup() throws Exception
8888
host = getHost();
8989
}
9090

91-
protected HttpHost getHost() {
92-
return new HttpHost("https", "localhost", 53458);
91+
protected HttpHost getHost()
92+
{
93+
int port = httpServer.getUrls()[0].getPort();
94+
return new HttpHost("https", "localhost", port);
9395
}
9496

95-
protected HttpClient getClient() throws Exception
97+
private HttpClient getClient() throws Exception
9698
{
9799
DefaultClientConfiguration clientCfg = new DefaultClientConfiguration();
98100
clientCfg.setCredential(getDemoCredential());
99101
clientCfg.setValidator(getDemoValidator());
100102
clientCfg.setSslEnabled(true);
101103
clientCfg.setSslAuthn(false);
102104
clientCfg.setHttpAuthn(true);
103-
return HttpUtils.createClient("https://localhost:53456", clientCfg);
105+
int port = httpServer.getUrls()[0].getPort();
106+
return HttpUtils.createClient("https://localhost:"+port, clientCfg);
104107
}
105108

106109
protected HttpClientContext getClientContext(HttpHost host)

web-upman/src/test/resources/unityServer.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ unityServer.core.pkiConfigFile=src/test/resources/pki.properties
88
unityServer.core.workspaceDirectory=target/workspace
99
unityServer.core.auditEventLogsEnabled=false
1010

11-
unityServer.core.httpServer.port=53458
11+
unityServer.core.httpServer.port=0
1212
unityServer.core.httpServer.host=localhost
1313
unityServer.core.httpServer.fastRandom=true
1414

0 commit comments

Comments
 (0)