diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2024-07-09 17:53:37 +0100 |
---|---|---|
committer | FrancescoFioraEst <francesco.fiora@est.tech> | 2024-07-10 13:47:59 +0100 |
commit | adcc527c0a10426f99be50cc2267f7063a85c8d7 (patch) | |
tree | 013912f2727578d9bc8eed167ad59ddc18bf80dc /runtime-acm/src/test/java/org | |
parent | e0d7e568c86b612852372d566bddb97585ae5cad (diff) |
Fix sync message during migration
Issue-ID: POLICY-5070
Change-Id: I6d6ca235fd5463cb58a8f43e027022244ffe5bbe
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'runtime-acm/src/test/java/org')
2 files changed, 14 insertions, 8 deletions
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandlerTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandlerTest.java index 0bec9d0ce..e895401a4 100644 --- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandlerTest.java +++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandlerTest.java @@ -66,6 +66,8 @@ class SupervisionAcHandlerTest { var automationCompositionProvider = mock(AutomationCompositionProvider.class); when(automationCompositionProvider.findAutomationComposition(IDENTIFIER)) .thenReturn(Optional.of(automationComposition)); + when(automationCompositionProvider.updateAcState(any(AutomationComposition.class))) + .thenReturn(automationComposition); var acDefinitionProvider = mock(AcDefinitionProvider.class); when(acDefinitionProvider.getAcDefinition(automationComposition.getCompositionId())) @@ -82,7 +84,7 @@ class SupervisionAcHandlerTest { handler.handleAutomationCompositionStateChangeAckMessage(automationCompositionAckMessage); verify(automationCompositionProvider, times(3)) - .updateAutomationCompositionElement(any(AutomationCompositionElement.class), any()); + .updateAutomationCompositionElement(any(AutomationCompositionElement.class)); } private AutomationCompositionDeployAck getAutomationCompositionDeployAck(ParticipantMessageType messageType, @@ -107,6 +109,8 @@ class SupervisionAcHandlerTest { var automationCompositionProvider = mock(AutomationCompositionProvider.class); when(automationCompositionProvider.findAutomationComposition(IDENTIFIER)) .thenReturn(Optional.of(automationComposition)); + when(automationCompositionProvider.updateAcState(any(AutomationComposition.class))) + .thenReturn(automationComposition); var acDefinitionProvider = mock(AcDefinitionProvider.class); when(acDefinitionProvider.getAcDefinition(automationComposition.getCompositionId())) @@ -124,7 +128,7 @@ class SupervisionAcHandlerTest { handler.handleAutomationCompositionUpdateAckMessage(automationCompositionAckMessage); - verify(automationCompositionProvider).updateAutomationComposition(any(AutomationComposition.class)); + verify(automationCompositionProvider).updateAcState(any(AutomationComposition.class)); } @Test @@ -162,7 +166,7 @@ class SupervisionAcHandlerTest { handler.handleAutomationCompositionUpdateAckMessage(automationCompositionAckMessage); verify(automationCompositionProvider) - .updateAutomationCompositionElement(any(AutomationCompositionElement.class), any()); + .updateAutomationCompositionElement(any(AutomationCompositionElement.class)); } @Test @@ -322,7 +326,7 @@ class SupervisionAcHandlerTest { handler.handleAutomationCompositionUpdateAckMessage(automationCompositionAckMessage); verify(automationCompositionProvider) - .updateAutomationCompositionElement(any(AutomationCompositionElement.class), any()); + .updateAutomationCompositionElement(any(AutomationCompositionElement.class)); } @Test diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java index fa5929f0b..6bdab706c 100644 --- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java +++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java @@ -186,6 +186,7 @@ class SupervisionScannerTest { automationComposition.setCompositionId(compositionId); var automationCompositionProvider = mock(AutomationCompositionProvider.class); when(automationCompositionProvider.getAcInstancesInTransition()).thenReturn(List.of(automationComposition)); + when(automationCompositionProvider.updateAcState(any())).thenReturn(automationComposition); var automationCompositionDeployPublisher = mock(AutomationCompositionDeployPublisher.class); var automationCompositionStateChangePublisher = mock(AutomationCompositionStateChangePublisher.class); @@ -196,7 +197,7 @@ class SupervisionScannerTest { mock(ParticipantSyncPublisher.class), acRuntimeParameterGroup); supervisionScanner.run(); - verify(automationCompositionProvider).updateAutomationComposition(any(AutomationComposition.class)); + verify(automationCompositionProvider).updateAcState(any(AutomationComposition.class)); } @Test @@ -255,7 +256,7 @@ class SupervisionScannerTest { var automationCompositionProvider = mock(AutomationCompositionProvider.class); when(automationCompositionProvider.getAcInstancesInTransition()).thenReturn(List.of(automationComposition)); - + when(automationCompositionProvider.updateAcState(any())).thenReturn(automationComposition); var automationCompositionDeployPublisher = mock(AutomationCompositionDeployPublisher.class); var automationCompositionStateChangePublisher = mock(AutomationCompositionStateChangePublisher.class); var acRuntimeParameterGroup = CommonTestData.geParameterGroup("dbScanner"); @@ -282,7 +283,7 @@ class SupervisionScannerTest { entry.getValue().setDeployState(DeployState.DEPLOYED); } scannerObj2.run(); - verify(automationCompositionProvider, times(1)).updateAutomationComposition(any(AutomationComposition.class)); + verify(automationCompositionProvider, times(1)).updateAcState(any(AutomationComposition.class)); assertEquals(StateChangeResult.NO_ERROR, automationComposition.getStateChangeResult()); } @@ -341,6 +342,7 @@ class SupervisionScannerTest { var automationCompositionProvider = mock(AutomationCompositionProvider.class); when(automationCompositionProvider.getAcInstancesInTransition()).thenReturn(List.of(automationComposition)); + when(automationCompositionProvider.updateAcState(any())).thenReturn(automationComposition); var automationCompositionDeployPublisher = mock(AutomationCompositionDeployPublisher.class); var automationCompositionStateChangePublisher = mock(AutomationCompositionStateChangePublisher.class); @@ -358,7 +360,7 @@ class SupervisionScannerTest { automationComposition.getElements().entrySet().iterator().next().getValue() .setDeployState(DeployState.DEPLOYED); supervisionScanner.run(); - verify(automationCompositionProvider, times(1)).updateAutomationComposition(any(AutomationComposition.class)); + verify(automationCompositionProvider, times(1)).updateAcState(any(AutomationComposition.class)); assertEquals(DeployState.DEPLOYED, automationComposition.getDeployState()); assertEquals(compositionTargetId, automationComposition.getCompositionId()); |