summaryrefslogtreecommitdiffstats
path: root/participant/participant-impl/participant-impl-policy/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'participant/participant-impl/participant-impl-policy/src/test')
-rw-r--r--participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantPolicyTest.java20
-rw-r--r--participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/utils/TestListenerUtils.java9
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());