From 2d351b432d28c0d9bda0dbeaac994b030e3b6f82 Mon Sep 17 00:00:00 2001 From: Sirisha_Manchikanti Date: Tue, 27 Jul 2021 17:24:44 +0100 Subject: Updates to participant messages Updated participant messages according to https://wiki.onap.org/display/DW/The+CLAMP+Control+Loop+Participant+Protocol Issue-ID: POLICY-3416 Signed-off-by: Sirisha_Manchikanti Change-Id: Idef19bee05116f11690c7aca0493e731dd128e06 --- .../policy/endtoend/ParticipantPolicyTest.java | 20 -------------------- .../policy/main/utils/TestListenerUtils.java | 9 +++------ 2 files changed, 3 insertions(+), 26 deletions(-) (limited to 'participant/participant-impl/participant-impl-policy') diff --git a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantPolicyTest.java b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantPolicyTest.java index c0bd89696..10563cde2 100644 --- a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantPolicyTest.java +++ b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantPolicyTest.java @@ -21,17 +21,14 @@ package org.onap.policy.clamp.controlloop.participant.policy.endtoend; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopOrderedState; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopStateChange; import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ControlLoopUpdate; -import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdate; import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ControlLoopStateChangeListener; import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ControlLoopUpdateListener; -import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ParticipantUpdateListener; import org.onap.policy.clamp.controlloop.participant.intermediary.handler.ParticipantHandler; import org.onap.policy.clamp.controlloop.participant.policy.main.utils.TestListenerUtils; import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; @@ -58,9 +55,6 @@ class ParticipantPolicyTest { ControlLoopUpdate controlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg(); controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE); - // Verify that the ToscaServicetemplate has policy_types - assertNotNull(controlLoopUpdateMsg.getControlLoopDefinition().getPolicyTypes()); - synchronized (lockit) { ControlLoopUpdateListener clUpdateListener = new ControlLoopUpdateListener(participantHandler); @@ -75,13 +69,6 @@ class ParticipantPolicyTest { ControlLoopUpdate controlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg(); controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE); - // Add policies to the toscaServiceTemplate - TestListenerUtils.addPoliciesToToscaServiceTemplate(controlLoopUpdateMsg.getControlLoopDefinition()); - - // Verify that the ToscaServicetemplate has policies - assertNotNull( - controlLoopUpdateMsg.getControlLoopDefinition().getToscaTopologyTemplate().getPolicies()); - synchronized (lockit) { ControlLoopUpdateListener clUpdateListener = new ControlLoopUpdateListener(participantHandler); @@ -96,13 +83,6 @@ class ParticipantPolicyTest { ControlLoopUpdate controlLoopUpdateMsg = TestListenerUtils.createControlLoopUpdateMsg(); controlLoopUpdateMsg.getControlLoop().setOrderedState(ControlLoopOrderedState.PASSIVE); - // Add policies to the toscaServiceTemplate - TestListenerUtils.addPoliciesToToscaServiceTemplate(controlLoopUpdateMsg.getControlLoopDefinition()); - - // Verify that the ToscaServicetemplate has policies - assertNotNull( - controlLoopUpdateMsg.getControlLoopDefinition().getToscaTopologyTemplate().getPolicies()); - synchronized (lockit) { ControlLoopUpdateListener clUpdateListener = new ControlLoopUpdateListener(participantHandler); diff --git a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/utils/TestListenerUtils.java b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/utils/TestListenerUtils.java index 6f1e00143..fe7e17fd7 100644 --- a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/utils/TestListenerUtils.java +++ b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/utils/TestListenerUtils.java @@ -168,7 +168,6 @@ public class TestListenerUtils { controlLoop.setVersion("1.0.0"); controlLoop.setDefinition(controlLoopId); clUpdateMsg.setControlLoop(controlLoop); - clUpdateMsg.setControlLoopDefinition(toscaServiceTemplate); return clUpdateMsg; } @@ -190,11 +189,9 @@ public class TestListenerUtils { participantUpdateMsg.setTimestamp(Instant.ofEpochMilli(3000)); participantUpdateMsg.setMessageId(UUID.randomUUID()); - ToscaServiceTemplate toscaServiceTemplate = new ToscaServiceTemplate(); - toscaServiceTemplate.setName("serviceTemplate"); - toscaServiceTemplate.setDerivedFrom("parentServiceTemplate"); - toscaServiceTemplate.setDescription("Description of serviceTemplate"); - toscaServiceTemplate.setVersion("1.2.3"); + ToscaServiceTemplate toscaServiceTemplate = testControlLoopRead(); + // Add policies to the toscaServiceTemplate + TestListenerUtils.addPoliciesToToscaServiceTemplate(toscaServiceTemplate); ControlLoopElementDefinition clDefinition = new ControlLoopElementDefinition(); clDefinition.setId(UUID.randomUUID()); -- cgit 1.2.3-korg