aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2020-04-06 15:41:28 +0100
committerliamfallon <liam.fallon@est.tech>2020-04-06 18:44:17 +0100
commit69c227a9f1d91268fbd91471b012af38fba8b857 (patch)
tree6d950f8c4f7b54f8348dc7960e982a8dd26feee3 /plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test
parente1085f59c1ecd68de574391dc490973abd72a731 (diff)
Fix intermittent unit test failures WebSocket
The Web Socket server is marked as started before the start process has complted. This change fixes that issue. Issue-ID: POLICY-1470 Change-Id: I5b5ef5832893d884a6551b0516df91cb71d6c622 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java
index cbb81f9da..1e8105976 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java
@@ -143,7 +143,7 @@ public class RestRequestorTest {
Response response = null;
// Wait for the required amount of events to be received or for 10 seconds
- Double getsSoFar = 0.0;
+ double getsSoFar = 0.0;
for (int i = 0; i < 40; i++) {
response = client.target("http://localhost:32801/TestRESTRequestor/apex/event/Stats")
.request("application/json").get();
@@ -156,7 +156,7 @@ public class RestRequestorTest {
@SuppressWarnings("unchecked")
final Map<String, Object> jsonMap = new Gson().fromJson(responseString, Map.class);
- getsSoFar = Double.valueOf(jsonMap.get("GET").toString());
+ getsSoFar = Double.parseDouble(jsonMap.get("GET").toString());
if (getsSoFar >= 50.0) {
break;
@@ -320,7 +320,7 @@ public class RestRequestorTest {
+ "does not exist or is not defined with the same peered mode"));
}
- private Double getStatsFromServer(final Client client, final String statToGet) {
+ private double getStatsFromServer(final Client client, final String statToGet) {
final Response response = client.target("http://localhost:32801/TestRESTRequestor/apex/event/Stats")
.request("application/json").get();
@@ -329,6 +329,6 @@ public class RestRequestorTest {
@SuppressWarnings("unchecked")
final Map<String, Object> jsonMap = new Gson().fromJson(responseString, Map.class);
- return Double.valueOf(jsonMap.get(statToGet).toString());
+ return Double.parseDouble(jsonMap.get(statToGet).toString());
}
}