summaryrefslogtreecommitdiffstats
path: root/a1-policy-management/src/test
diff options
context:
space:
mode:
authorPatrikBuhr <patrik.buhr@est.tech>2021-08-26 10:47:27 +0200
committerPatrikBuhr <patrik.buhr@est.tech>2021-08-26 10:47:27 +0200
commit633c8e32702db13c28349152c76efea8e97fb252 (patch)
tree9ae9788e10e169445400d76c7ab79757c13e9134 /a1-policy-management/src/test
parentb9a7016920746a6537bf4c0165595e758716ea03 (diff)
Bugfix, timing issue in a unittest1.2.0
Issue-ID: CCSDK-3421 Signed-off-by: PatrikBuhr <patrik.buhr@est.tech> Change-Id: I66bec17ab17d189740c50d6cc8af473b5a0fbbd4
Diffstat (limited to 'a1-policy-management/src/test')
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
index e31d0b91..08350f81 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java
@@ -275,8 +275,8 @@ class ApplicationTest {
assertThat(addedRic.getSupportedPolicyTypes().iterator().next().getId()).isEqualTo(TYPE);
// Check that a service callback for the AVAILABLE RIC is invoked
- RappSimulatorController.TestResults receivedCallbacks = rAppSimulator.getTestResults();
- assertThat(receivedCallbacks.getReceivedInfo().size()).isEqualTo(1);
+ final RappSimulatorController.TestResults receivedCallbacks = rAppSimulator.getTestResults();
+ await().untilAsserted(() -> assertThat(receivedCallbacks.getReceivedInfo().size()).isEqualTo(1));
ServiceCallbackInfo callbackInfo = receivedCallbacks.getReceivedInfo().get(0);
assertThat(callbackInfo.ricId).isEqualTo(RIC);
assertThat(callbackInfo.eventType).isEqualTo(ServiceCallbackInfo.EventType.AVAILABLE);
@@ -297,15 +297,15 @@ class ApplicationTest {
waitForRicState(RIC, RicState.UNAVAILABLE);
// Check that no service callback for the UNAVAILABLE RIC is invoked
- RappSimulatorController.TestResults receivedCallbacks = rAppSimulator.getTestResults();
- assertThat(receivedCallbacks.getReceivedInfo()).isEmpty();
+ final RappSimulatorController.TestResults receivedCallbacks = rAppSimulator.getTestResults();
+ await().untilAsserted(() -> assertThat(receivedCallbacks.getReceivedInfo()).isEmpty());
// Run a synch and check that the AVAILABLE notification is received
a1ClientFactory.reset();
supervision.checkAllRics();
waitForRicState(RIC, RicState.AVAILABLE);
- receivedCallbacks = rAppSimulator.getTestResults();
- assertThat(receivedCallbacks.getReceivedInfo().size()).isEqualTo(1);
+
+ await().untilAsserted(() -> assertThat(receivedCallbacks.getReceivedInfo().size()).isEqualTo(1));
}
@Test
@@ -787,8 +787,8 @@ class ApplicationTest {
supervision.checkAllRics();
waitForRicState("ric1", RicState.AVAILABLE);
- RappSimulatorController.TestResults receivedCallbacks = rAppSimulator.getTestResults();
- assertThat(receivedCallbacks.getReceivedInfo().size()).isEqualTo(1);
+ final RappSimulatorController.TestResults receivedCallbacks = rAppSimulator.getTestResults();
+ await().untilAsserted(() -> assertThat(receivedCallbacks.getReceivedInfo().size()).isEqualTo(1));
ServiceCallbackInfo callbackInfo = receivedCallbacks.getReceivedInfo().get(0);
assertThat(callbackInfo.ricId).isEqualTo("ric1");
assertThat(callbackInfo.eventType).isEqualTo(ServiceCallbackInfo.EventType.AVAILABLE);