summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Williams <marcus.williams@intel.com>2018-08-24 21:51:02 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-24 21:51:02 +0000
commitf5c3e3e3c8d0f3c05111de578f1beae99652988d (patch)
tree013a322942c5a1ee6c68a9e8cd32570f9a284e22
parent83c158371384b29a4252d12d842ab632a93209f6 (diff)
parente27650bc7ca78bfc1b54e5423cc72b2a44064df3 (diff)
Merge "converted test to dynamic port"
-rw-r--r--bpmn/MSORESTClient/src/test/java/org/onap/so/rest/RESTClientTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/bpmn/MSORESTClient/src/test/java/org/onap/so/rest/RESTClientTest.java b/bpmn/MSORESTClient/src/test/java/org/onap/so/rest/RESTClientTest.java
index bbdaa94581..17ede2f2ff 100644
--- a/bpmn/MSORESTClient/src/test/java/org/onap/so/rest/RESTClientTest.java
+++ b/bpmn/MSORESTClient/src/test/java/org/onap/so/rest/RESTClientTest.java
@@ -51,7 +51,8 @@ public class RESTClientTest {
private String jsonResponseAsString;
@Rule
- public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().port(28090));
+ public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());
+
@Before
public void before() throws Exception {
@@ -62,7 +63,7 @@ public class RESTClientTest {
jsonResponse = new JSONObject();
jsonResponse.put("response", "responseValue");
jsonResponseAsString = jsonResponse.toString();
- restClient = new RESTClient("http://localhost:28090/example", "localhost", 28090);
+ restClient = new RESTClient("http://localhost:" + wireMockRule.port() + "/example", "localhost", wireMockRule.port());
}
@Test
@@ -79,9 +80,9 @@ public class RESTClientTest {
assertEquals(1, restClient.getParameters().size());
restClient.addAuthorizationHeader("token");
assertEquals("[token]", restClient.getHeaders().get("Authorization").toString());
- assertEquals("http://localhost:28090/example", restClient.getURL());
- restClient = new RESTClient("http://localhost:28090/example1");
- assertEquals("http://localhost:28090/example1", restClient.getURL());
+ assertEquals("http://localhost:" + wireMockRule.port() + "/example", restClient.getURL());
+ restClient = new RESTClient("http://localhost:" + wireMockRule.port() + "/example1");
+ assertEquals("http://localhost:" + wireMockRule.port() + "/example1", restClient.getURL());
}
@Test