From b75038fab6ae0816413ed9f925639f3befe4fddb Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Thu, 14 Dec 2023 17:33:57 +0000 Subject: Update compositions and instances monitoring Improved performance scanning only compositions and instances that are in transition. Issue-ID: POLICY-4906 Change-Id: I7a849e921f1d97509f67ff624c715c893a1432ab Signed-off-by: FrancescoFioraEst --- .../handler/AutomationCompositionHandlerTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'participant/participant-intermediary/src/test/java') 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 661c009f6..b8fd3b42d 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 @@ -47,6 +47,7 @@ import org.onap.policy.clamp.models.acm.messages.kafka.participant.AutomationCom import org.onap.policy.clamp.models.acm.messages.kafka.participant.AutomationCompositionDeployAck; import org.onap.policy.clamp.models.acm.messages.kafka.participant.AutomationCompositionMigration; import org.onap.policy.clamp.models.acm.messages.kafka.participant.AutomationCompositionStateChange; +import org.onap.policy.clamp.models.acm.messages.kafka.participant.ParticipantPrimeAck; import org.onap.policy.clamp.models.acm.messages.kafka.participant.PropertiesUpdate; import org.onap.policy.clamp.models.acm.messages.rest.instantiation.DeployOrder; import org.onap.policy.clamp.models.acm.messages.rest.instantiation.LockOrder; @@ -273,7 +274,7 @@ class AutomationCompositionHandlerTest { } @Test - void handleComposiotDeprimeTest() { + void handleCompositionDeprimeTest() { var acElementDefinition = new AutomationCompositionElementDefinition(); acElementDefinition.setAcElementDefinitionId(new ToscaConceptIdentifier("key", "1.0.0")); var toscaNodeTemplate = new ToscaNodeTemplate(); @@ -291,6 +292,17 @@ class AutomationCompositionHandlerTest { verify(listener).deprime(any(UUID.class), any(CompositionDto.class)); } + @Test + void handleCompositionAlreadyDeprimedTest() { + var messageId = UUID.randomUUID(); + var compositionId = UUID.randomUUID(); + var participantMessagePublisher = mock(ParticipantMessagePublisher.class); + var ach = new AutomationCompositionHandler(mock(CacheProvider.class), participantMessagePublisher, + mock(ThreadHandler.class)); + ach.deprime(messageId, compositionId); + verify(participantMessagePublisher).sendParticipantPrimeAck(any(ParticipantPrimeAck.class)); + } + @Test void restartedTest() { var acElementDefinition = new AutomationCompositionElementDefinition(); -- cgit 1.2.3-korg