aboutsummaryrefslogtreecommitdiffstats
path: root/runtime-acm/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'runtime-acm/src/test/java')
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionAcHandlerTest.java12
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScannerTest.java10
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());