summaryrefslogtreecommitdiffstats
path: root/runtime-acm/src/test/java/org/onap
diff options
context:
space:
mode:
authorsaul.gill <saul.gill@est.tech>2023-02-02 11:40:29 +0000
committersaul.gill <saul.gill@est.tech>2023-02-02 11:40:35 +0000
commit9659c99c9c8b4b7ce33d7f48e61df44a03090186 (patch)
treed04b196466e12895183e95ac7885427ca5482e69 /runtime-acm/src/test/java/org/onap
parent203a14a0c5397096f4b6918cd587248ea275e245 (diff)
Refactor ParticipantUpdate to ParticipantPrime
Refactored ParticipantUpdateAck to ParticipantPrimeAck Refactored ParticipantUpdate to ParticipantPrime Refactored all associated tests and code Issue-ID: POLICY-4548 Change-Id: I2265777add4e088173ec465603e26143e3f40070 Signed-off-by: saul.gill <saul.gill@est.tech>
Diffstat (limited to 'runtime-acm/src/test/java/org/onap')
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProviderTest.java14
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java36
-rw-r--r--runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/comm/SupervisionMessagesTest.java20
3 files changed, 35 insertions, 35 deletions
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProviderTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProviderTest.java
index 071fc26fd..327d881a1 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProviderTest.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProviderTest.java
@@ -33,7 +33,7 @@ import java.util.List;
import java.util.UUID;
import org.junit.jupiter.api.Test;
import org.onap.policy.clamp.acm.runtime.instantiation.InstantiationUtils;
-import org.onap.policy.clamp.acm.runtime.supervision.comm.ParticipantUpdatePublisher;
+import org.onap.policy.clamp.acm.runtime.supervision.comm.ParticipantPrimePublisher;
import org.onap.policy.clamp.acm.runtime.util.CommonTestData;
import org.onap.policy.clamp.models.acm.concepts.AcTypeState;
import org.onap.policy.clamp.models.acm.concepts.AutomationComposition;
@@ -154,15 +154,15 @@ class CommissioningProviderTest {
var compositionId = acmDefinition.getCompositionId();
when(acDefinitionProvider.getAcDefinition(compositionId)).thenReturn(acmDefinition);
- var participantUpdatePublisher = mock(ParticipantUpdatePublisher.class);
+ var participantPrimePublisher = mock(ParticipantPrimePublisher.class);
var provider = new CommissioningProvider(acDefinitionProvider, mock(AutomationCompositionProvider.class),
- new AcTypeStateResolver(), participantUpdatePublisher);
+ new AcTypeStateResolver(), participantPrimePublisher);
var acTypeStateUpdate = new AcTypeStateUpdate();
acTypeStateUpdate.setPrimeOrder(PrimeOrder.PRIME);
provider.compositionDefinitionPriming(compositionId, acTypeStateUpdate);
verify(acDefinitionProvider).updateAcDefinition(acmDefinition);
- verify(participantUpdatePublisher).sendPriming(any(), any(), any());
+ verify(participantPrimePublisher).sendPriming(any(), any(), any());
}
@Test
@@ -173,13 +173,13 @@ class CommissioningProviderTest {
var compositionId = acmDefinition.getCompositionId();
when(acDefinitionProvider.getAcDefinition(compositionId)).thenReturn(acmDefinition);
- var participantUpdatePublisher = mock(ParticipantUpdatePublisher.class);
+ var participantPrimePublisher = mock(ParticipantPrimePublisher.class);
var provider = new CommissioningProvider(acDefinitionProvider, mock(AutomationCompositionProvider.class),
- new AcTypeStateResolver(), participantUpdatePublisher);
+ new AcTypeStateResolver(), participantPrimePublisher);
var acTypeStateUpdate = new AcTypeStateUpdate();
acTypeStateUpdate.setPrimeOrder(PrimeOrder.DEPRIME);
provider.compositionDefinitionPriming(compositionId, acTypeStateUpdate);
- verify(participantUpdatePublisher).sendDepriming(compositionId);
+ verify(participantPrimePublisher).sendDepriming(compositionId);
}
}
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java
index 8ae21ca75..e54cfafa2 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionHandlerTest.java
@@ -48,7 +48,7 @@ import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionState;
import org.onap.policy.clamp.models.acm.concepts.ParticipantState;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCompositionDeployAck;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessageType;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdateAck;
+import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantPrimeAck;
import org.onap.policy.clamp.models.acm.persistence.provider.AcDefinitionProvider;
import org.onap.policy.clamp.models.acm.persistence.provider.AutomationCompositionProvider;
@@ -240,28 +240,28 @@ class SupervisionHandlerTest {
}
@Test
- void testParticipantUpdateAckNotFound() {
- var participantUpdateAckMessage = new ParticipantUpdateAck();
- participantUpdateAckMessage.setParticipantId(CommonTestData.getParticipantId());
- participantUpdateAckMessage.setState(ParticipantState.ON_LINE);
+ void testParticipantPrimeAckNotFound() {
+ var participantPrimeAckMessage = new ParticipantPrimeAck();
+ participantPrimeAckMessage.setParticipantId(CommonTestData.getParticipantId());
+ participantPrimeAckMessage.setState(ParticipantState.ON_LINE);
var acDefinitionProvider = mock(AcDefinitionProvider.class);
var handler = new SupervisionHandler(mock(AutomationCompositionProvider.class), acDefinitionProvider,
mock(AutomationCompositionDeployPublisher.class),
mock(AutomationCompositionStateChangePublisher.class));
- handler.handleParticipantMessage(participantUpdateAckMessage);
+ handler.handleParticipantMessage(participantPrimeAckMessage);
verify(acDefinitionProvider).findAcDefinition(any());
}
@Test
- void testParticipantUpdateAckPrimed() {
- var participantUpdateAckMessage = new ParticipantUpdateAck();
- participantUpdateAckMessage.setParticipantId(CommonTestData.getParticipantId());
- participantUpdateAckMessage.setState(ParticipantState.ON_LINE);
+ void testParticipantPrimeAckPrimed() {
+ var participantPrimeAckMessage = new ParticipantPrimeAck();
+ participantPrimeAckMessage.setParticipantId(CommonTestData.getParticipantId());
+ participantPrimeAckMessage.setState(ParticipantState.ON_LINE);
var acDefinition = CommonTestData.createAcDefinition(
InstantiationUtils.getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML), AcTypeState.PRIMED);
- participantUpdateAckMessage.setCompositionId(acDefinition.getCompositionId());
+ participantPrimeAckMessage.setCompositionId(acDefinition.getCompositionId());
var acDefinitionProvider = mock(AcDefinitionProvider.class);
when(acDefinitionProvider.findAcDefinition(acDefinition.getCompositionId()))
@@ -271,19 +271,19 @@ class SupervisionHandlerTest {
mock(AutomationCompositionDeployPublisher.class),
mock(AutomationCompositionStateChangePublisher.class));
- handler.handleParticipantMessage(participantUpdateAckMessage);
+ handler.handleParticipantMessage(participantPrimeAckMessage);
verify(acDefinitionProvider).findAcDefinition(any());
}
@Test
- void testParticipantUpdateAck() {
- var participantUpdateAckMessage = new ParticipantUpdateAck();
- participantUpdateAckMessage.setParticipantId(CommonTestData.getParticipantId());
- participantUpdateAckMessage.setState(ParticipantState.ON_LINE);
+ void testParticipantPrimeAck() {
+ var participantPrimeAckMessage = new ParticipantPrimeAck();
+ participantPrimeAckMessage.setParticipantId(CommonTestData.getParticipantId());
+ participantPrimeAckMessage.setState(ParticipantState.ON_LINE);
var acDefinition = CommonTestData.createAcDefinition(
InstantiationUtils.getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML), AcTypeState.PRIMING);
- participantUpdateAckMessage.setCompositionId(acDefinition.getCompositionId());
+ participantPrimeAckMessage.setCompositionId(acDefinition.getCompositionId());
var acDefinitionProvider = mock(AcDefinitionProvider.class);
when(acDefinitionProvider.findAcDefinition(acDefinition.getCompositionId()))
@@ -293,7 +293,7 @@ class SupervisionHandlerTest {
mock(AutomationCompositionDeployPublisher.class),
mock(AutomationCompositionStateChangePublisher.class));
- handler.handleParticipantMessage(participantUpdateAckMessage);
+ handler.handleParticipantMessage(participantPrimeAckMessage);
verify(acDefinitionProvider).findAcDefinition(any());
verify(acDefinitionProvider).updateAcDefinition(any());
}
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/comm/SupervisionMessagesTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/comm/SupervisionMessagesTest.java
index 010e8ba38..c2d4e0ff7 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/comm/SupervisionMessagesTest.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/supervision/comm/SupervisionMessagesTest.java
@@ -46,10 +46,10 @@ import org.onap.policy.clamp.models.acm.messages.dmaap.participant.AutomationCom
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregister;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantDeregisterAck;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantMessageType;
+import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantPrimeAck;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegister;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantRegisterAck;
import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantStatus;
-import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantUpdateAck;
import org.onap.policy.clamp.models.acm.persistence.provider.ParticipantProvider;
import org.onap.policy.clamp.models.acm.utils.AcmUtils;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
@@ -105,12 +105,12 @@ class SupervisionMessagesTest {
}
@Test
- void testReceiveParticipantUpdateAckMessage() {
- final var participantUpdateAckMsg = new ParticipantUpdateAck();
+ void testReceiveParticipantPrimeAckMessage() {
+ final var participantPrimeAckMsg = new ParticipantPrimeAck();
var supervisionHandler = mock(SupervisionHandler.class);
- var participantUpdateAckListener = new ParticipantUpdateAckListener(supervisionHandler);
- participantUpdateAckListener.onTopicEvent(INFRA, TOPIC, null, participantUpdateAckMsg);
- verify(supervisionHandler).handleParticipantMessage(participantUpdateAckMsg);
+ var participantPrimeAckListener = new ParticipantPrimeAckListener(supervisionHandler);
+ participantPrimeAckListener.onTopicEvent(INFRA, TOPIC, null, participantPrimeAckMsg);
+ verify(supervisionHandler).handleParticipantMessage(participantPrimeAckMsg);
}
@Test
@@ -138,8 +138,8 @@ class SupervisionMessagesTest {
}
@Test
- void testParticipantUpdatePublisherDecomisioning() {
- var publisher = new ParticipantUpdatePublisher(mock(ParticipantProvider.class));
+ void testParticipantPrimePublisherDecommissioning() {
+ var publisher = new ParticipantPrimePublisher(mock(ParticipantProvider.class));
var topicSink = mock(TopicSink.class);
publisher.active(List.of(topicSink));
publisher.sendDepriming(UUID.randomUUID());
@@ -147,7 +147,7 @@ class SupervisionMessagesTest {
}
@Test
- void testParticipantUpdatePublisherPriming() {
+ void testParticipantPrimePublisherPriming() {
var participantId = UUID.randomUUID();
Map<ToscaConceptIdentifier, UUID> supportedElementMap = new HashMap<>();
supportedElementMap.put(
@@ -160,7 +160,7 @@ class SupervisionMessagesTest {
participantId);
var participantProvider = mock(ParticipantProvider.class);
when(participantProvider.getSupportedElementMap()).thenReturn(supportedElementMap);
- var publisher = new ParticipantUpdatePublisher(participantProvider);
+ var publisher = new ParticipantPrimePublisher(participantProvider);
var topicSink = mock(TopicSink.class);
publisher.active(List.of(topicSink));
var serviceTemplate = InstantiationUtils.getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML);