From b9a7016920746a6537bf4c0165595e758716ea03 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Thu, 19 Aug 2021 16:17:02 +0200 Subject: Bugfix, timing issue in a unittest Issue-ID: CCSDK-3421 Signed-off-by: PatrikBuhr Change-Id: I6fc0f78806dd46b6824433304fa89d97c66e9aa5 --- .../tasks/RicSynchronizationTaskTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'a1-policy-management/src/test/java') 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); -- cgit 1.2.3-korg