diff options
author | Sirisha_Manchikanti <sirisha.manchikanti@est.tech> | 2021-07-27 17:24:44 +0100 |
---|---|---|
committer | Sirisha_Manchikanti <sirisha.manchikanti@est.tech> | 2021-07-29 08:59:27 +0100 |
commit | 2d351b432d28c0d9bda0dbeaac994b030e3b6f82 (patch) | |
tree | eeb9e82baae554ea395a0e62a19e54da1847fa13 /participant/participant-impl/participant-impl-policy | |
parent | d5c645873589e0b56a6ad0edd5bd0d480896f765 (diff) |
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 <sirisha.manchikanti@est.tech>
Change-Id: Idef19bee05116f11690c7aca0493e731dd128e06
Diffstat (limited to 'participant/participant-impl/participant-impl-policy')
2 files changed, 3 insertions, 26 deletions
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()); |