summaryrefslogtreecommitdiffstats
path: root/participant/participant-intermediary/src/test
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-01-30 13:43:10 +0000
committerFrancescoFioraEst <francesco.fiora@est.tech>2023-01-31 10:20:02 +0000
commit7f762dfa19f673241f8ea1b2ff3d56d2d58bdcdb (patch)
tree591b04b568efed20c76f7d67973163d075d27162 /participant/participant-intermediary/src/test
parent934f7bd443225a6945b0542fa5cb7c043deac426 (diff)
Refactor ACM Update message to ACM Deploy message in ACM
Refactor ACM Update message to ACM Deploy message in ACM and add AcElementDeploy in Deploy message. AutomationCompositionElement will be removed from the message after POLICY-4506 and POLICY-4507. Issue-ID: POLICY-4543 Change-Id: I8444e15b3b4cb1209ffd083fb965e0707fbd9625 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant/participant-intermediary/src/test')
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java8
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/AutomationCompositionHandlerTest.java26
-rw-r--r--participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java2
3 files changed, 18 insertions, 18 deletions
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java
index f8db70cc9..d9d99da4e 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.onap.policy.clamp.acm.participant.intermediary.main.parameters.CommonTestData;
import org.onap.policy.clamp.common.acm.exception.AutomationCompositionRuntimeException;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionAck;
+import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeployAck;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregister;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessageType;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegister;
@@ -59,8 +59,8 @@ class ParticipantCommTest {
var participantUpdateListener = new ParticipantUpdateListener(participantHandler);
assertEquals(ParticipantMessageType.PARTICIPANT_UPDATE.name(), participantUpdateListener.getType());
- var automationCompositionUpdateListener = new AutomationCompositionUpdateListener(participantHandler);
- assertEquals(ParticipantMessageType.AUTOMATION_COMPOSITION_UPDATE.name(),
+ var automationCompositionUpdateListener = new AutomationCompositionDeployListener(participantHandler);
+ assertEquals(ParticipantMessageType.AUTOMATION_COMPOSITION_DEPLOY.name(),
automationCompositionUpdateListener.getType());
var automationCompositionStateChangeListener = new AutomationCompositionStateChangeListener(participantHandler);
@@ -86,7 +86,7 @@ class ParticipantCommTest {
assertThrows(AutomationCompositionRuntimeException.class,
() -> participantMessagePublisher.sendParticipantDeregister(participantDeregister));
- var automationCompositionAck = Mockito.mock(AutomationCompositionAck.class);
+ var automationCompositionAck = Mockito.mock(AutomationCompositionDeployAck.class);
assertThrows(AutomationCompositionRuntimeException.class,
() -> participantMessagePublisher.sendAutomationCompositionAck(automationCompositionAck));
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 6698ef9a8..ae8a8b2a0 100644
--- 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
@@ -37,9 +37,9 @@ import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionOrderedState;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionState;
-import org.onap.policy.clamp.models.acm.concepts.ParticipantUpdates;
+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.AutomationCompositionStateChange;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionUpdate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
import org.springframework.test.context.junit.jupiter.SpringExtension;
@@ -124,36 +124,36 @@ class AutomationCompositionHandlerTest {
var acd = new AutomationCompositionElementDefinition();
acd.setAcElementDefinitionId(definition);
- var updateMsg = new AutomationCompositionUpdate();
+ var updateMsg = new AutomationCompositionDeploy();
updateMsg.setAutomationCompositionId(UUID.randomUUID());
updateMsg.setMessageId(uuid);
updateMsg.setParticipantId(partecipantId);
updateMsg.setStartPhase(0);
var acElementDefinitions = List.of(acd);
- assertDoesNotThrow(() -> ach.handleAutomationCompositionUpdate(updateMsg, acElementDefinitions));
+ assertDoesNotThrow(() -> ach.handleAutomationCompositionDeploy(updateMsg, acElementDefinitions));
updateMsg.setStartPhase(1);
- assertDoesNotThrow(() -> ach.handleAutomationCompositionUpdate(updateMsg, acElementDefinitions));
+ assertDoesNotThrow(() -> ach.handleAutomationCompositionDeploy(updateMsg, acElementDefinitions));
ach.getAutomationCompositionMap().clear();
updateMsg.setStartPhase(0);
- assertDoesNotThrow(() -> ach.handleAutomationCompositionUpdate(updateMsg, acElementDefinitions));
+ assertDoesNotThrow(() -> ach.handleAutomationCompositionDeploy(updateMsg, acElementDefinitions));
updateMsg.setAutomationCompositionId(UUID.randomUUID());
- updateMsg.setParticipantUpdatesList(List.of(mock(ParticipantUpdates.class)));
- assertDoesNotThrow(() -> ach.handleAutomationCompositionUpdate(updateMsg, acElementDefinitions));
+ updateMsg.setParticipantUpdatesList(List.of(mock(ParticipantDeploy.class)));
+ assertDoesNotThrow(() -> ach.handleAutomationCompositionDeploy(updateMsg, acElementDefinitions));
updateMsg.setStartPhase(1);
- var participantUpdate = new ParticipantUpdates();
- participantUpdate.setParticipantId(partecipantId);
+ var participantDeploy = new ParticipantDeploy();
+ participantDeploy.setParticipantId(partecipantId);
var element = new AutomationCompositionElement();
element.setDefinition(definition);
- participantUpdate.setAutomationCompositionElementList(List.of(element));
- updateMsg.setParticipantUpdatesList(List.of(participantUpdate));
+ participantDeploy.setAutomationCompositionElementList(List.of(element));
+ updateMsg.setParticipantUpdatesList(List.of(participantDeploy));
var acd2 = new AutomationCompositionElementDefinition();
acd2.setAcElementDefinitionId(definition);
acd2.setAutomationCompositionElementToscaNodeTemplate(mock(ToscaNodeTemplate.class));
- assertDoesNotThrow(() -> ach.handleAutomationCompositionUpdate(updateMsg, List.of(acd2)));
+ assertDoesNotThrow(() -> ach.handleAutomationCompositionDeploy(updateMsg, List.of(acd2)));
}
diff --git a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java
index dc04440ca..9f1bf29be 100644
--- a/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java
+++ b/participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/handler/ParticipantHandlerTest.java
@@ -97,7 +97,7 @@ class ParticipantHandlerTest {
void checkAppliesTo() {
var participantHandler = commonTestData.getMockParticipantHandler();
var participantAckMsg =
- new ParticipantAckMessage(ParticipantMessageType.AUTOMATION_COMPOSITION_UPDATE);
+ new ParticipantAckMessage(ParticipantMessageType.AUTOMATION_COMPOSITION_DEPLOY);
assertTrue(participantHandler.appliesTo(participantAckMsg));
var participantMsg =