summaryrefslogtreecommitdiffstats
path: root/a1-policy-management/src/test
diff options
context:
space:
mode:
authorPatrikBuhr <patrik.buhr@est.tech>2021-08-19 16:17:02 +0200
committerPatrikBuhr <patrik.buhr@est.tech>2021-08-19 16:21:55 +0200
commitb9a7016920746a6537bf4c0165595e758716ea03 (patch)
tree88f281e0c75a654d1db5877e8294ba81b88d013f /a1-policy-management/src/test
parente7f0355378e636261ad960626d2eb92f317b3f16 (diff)
Bugfix, timing issue in a unittest
Issue-ID: CCSDK-3421 Signed-off-by: PatrikBuhr <patrik.buhr@est.tech> Change-Id: I6fc0f78806dd46b6824433304fa89d97c66e9aa5
Diffstat (limited to 'a1-policy-management/src/test')
-rw-r--r--a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java
index fae05475..99c49d89 100644
--- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java
+++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSynchronizationTaskTest.java
@@ -161,6 +161,7 @@ class RicSynchronizationTaskTest {
RicSynchronizationTask synchronizerUnderTest = spy(createTask());
+ RIC_1.setState(RicState.UNAVAILABLE);
synchronizerUnderTest.run(RIC_1);
await().untilAsserted(() -> RicState.AVAILABLE.equals(RIC_1.getState()));
@@ -186,6 +187,7 @@ class RicSynchronizationTaskTest {
RicSynchronizationTask synchronizerUnderTest = createTask();
+ RIC_1.setState(RicState.UNAVAILABLE);
synchronizerUnderTest.run(RIC_1);
await().untilAsserted(() -> RicState.AVAILABLE.equals(RIC_1.getState()));
@@ -216,8 +218,10 @@ class RicSynchronizationTaskTest {
RicSynchronizationTask synchronizerUnderTest = createTask();
+ RIC_1.setState(RicState.UNAVAILABLE);
synchronizerUnderTest.run(RIC_1);
await().untilAsserted(() -> RicState.AVAILABLE.equals(RIC_1.getState()));
+
verify(a1ClientMock).deleteAllPolicies();
verify(a1ClientMock).putPolicy(POLICY_1);
verifyNoMoreInteractions(a1ClientMock);
@@ -243,6 +247,7 @@ class RicSynchronizationTaskTest {
RicSynchronizationTask synchronizerUnderTest = createTask();
+ RIC_1.setState(RicState.UNAVAILABLE);
synchronizerUnderTest.run(RIC_1);
await().untilAsserted(() -> RicState.AVAILABLE.equals(RIC_1.getState()));
@@ -268,8 +273,9 @@ class RicSynchronizationTaskTest {
RicSynchronizationTask synchronizerUnderTest = createTask();
+ RIC_1.setState(RicState.AVAILABLE);
synchronizerUnderTest.run(RIC_1);
- await().untilAsserted(() -> RicState.AVAILABLE.equals(RIC_1.getState()));
+ await().untilAsserted(() -> RicState.UNAVAILABLE.equals(RIC_1.getState()));
verify(a1ClientMock, times(2)).deleteAllPolicies();
verifyNoMoreInteractions(a1ClientMock);