aboutsummaryrefslogtreecommitdiffstats
path: root/participant/participant-intermediary/src/test
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-09-01 15:41:47 +0100
committerAdheli Tavares <adheli.tavares@est.tech>2023-09-14 11:24:35 +0000
commitf28e48ef033188e6b4f252922124184c96217a09 (patch)
treed46cc20ad8e77d300d3a6109a54090d93746b259 /participant/participant-intermediary/src/test
parenta1a18ba3f09642976c20f8457afedc91e42b3359 (diff)
Fix updating the state in Participant Intermediaryjava-17
Fix the Participant Intermediary that is not updating the transition state "UNDEPLOYING" in the participant status. Issue-ID: POLICY-4804 Change-Id: I849d29b904d78fe9fd1b3dec9d018bf8ccc67476 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech> (cherry picked from commit c4b3c527882610afc3f08c0efd73e2f7841e9fe5)
Diffstat (limited to 'participant/participant-intermediary/src/test')
-rwxr-xr-x[-rw-r--r--]participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java
index 6509491ce..cb7e560ba 100644..100755
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java
@@ -21,6 +21,7 @@
package org.onap.policy.clamp.acm.participant.intermediary.handler;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
@@ -37,6 +38,8 @@ import org.onap.policy.clamp.acm.participant.intermediary.main.parameters.Common
import org.onap.policy.clamp.models.acm.concepts.AcElementDeploy;
import org.onap.policy.clamp.models.acm.concepts.AcTypeState;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition;
+import org.onap.policy.clamp.models.acm.concepts.DeployState;
+import org.onap.policy.clamp.models.acm.concepts.LockState;
import org.onap.policy.clamp.models.acm.concepts.ParticipantDeploy;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeploy;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeployAck;
@@ -87,6 +90,9 @@ class AutomationCompositionHandlerTest {
var ach = new AutomationCompositionHandler(cacheProvider, participantMessagePublisher, listener);
ach.handleAutomationCompositionStateChange(automationCompositionStateChange);
verify(listener, times(automationComposition.getElements().size())).undeploy(any(), any(), any());
+ for (var element: automationComposition.getElements().values()) {
+ assertEquals(DeployState.UNDEPLOYING, element.getDeployState());
+ }
}
@Test
@@ -104,6 +110,9 @@ class AutomationCompositionHandlerTest {
var ach = new AutomationCompositionHandler(cacheProvider, participantMessagePublisher, listener);
ach.handleAutomationCompositionStateChange(automationCompositionStateChange);
verify(listener, times(automationComposition.getElements().size())).lock(any(), any(), any());
+ for (var element: automationComposition.getElements().values()) {
+ assertEquals(LockState.LOCKING, element.getLockState());
+ }
}
@Test
@@ -121,6 +130,9 @@ class AutomationCompositionHandlerTest {
var ach = new AutomationCompositionHandler(cacheProvider, participantMessagePublisher, listener);
ach.handleAutomationCompositionStateChange(automationCompositionStateChange);
verify(listener, times(automationComposition.getElements().size())).unlock(any(), any(), any());
+ for (var element: automationComposition.getElements().values()) {
+ assertEquals(LockState.UNLOCKING, element.getLockState());
+ }
}
@Test
@@ -138,6 +150,9 @@ class AutomationCompositionHandlerTest {
var ach = new AutomationCompositionHandler(cacheProvider, participantMessagePublisher, listener);
ach.handleAutomationCompositionStateChange(automationCompositionStateChange);
verify(listener, times(automationComposition.getElements().size())).delete(any(), any(), any());
+ for (var element: automationComposition.getElements().values()) {
+ assertEquals(DeployState.DELETING, element.getDeployState());
+ }
}
@Test