From 9b982666d6ddb6c964a1e539fea97231b5053f5b Mon Sep 17 00:00:00 2001 From: Sirisha_Manchikanti Date: Mon, 20 Sep 2021 16:08:25 +0100 Subject: Add participantType to participant class Add participantType to participant class, cascade common and instance properties from runtime to participants Issue-ID: POLICY-3576 Signed-off-by: Sirisha_Manchikanti Change-Id: Ic9205aafe269ccc6dae0b3463fc6df5c47129e5d --- .../controlloop/persistence/concepts/JpaParticipantTest.java | 1 + .../models/messages/dmaap/participant/ControlLoopUpdateTest.java | 8 ++++++-- .../models/messages/dmaap/participant/ParticipantStatusTest.java | 7 ++++++- .../models/messages/dmaap/participant/ParticipantUpdateTest.java | 7 ++++++- 4 files changed, 19 insertions(+), 4 deletions(-) (limited to 'models/src/test/java/org/onap') diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipantTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipantTest.java index e2eb5154f..087292354 100644 --- a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipantTest.java +++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/concepts/JpaParticipantTest.java @@ -247,6 +247,7 @@ class JpaParticipantTest { testParticipant.setName("participant"); testParticipant.setVersion("0.0.1"); testParticipant.setDefinition(new ToscaConceptIdentifier("participantDefinitionName", "0.0.1")); + testParticipant.setParticipantType(new ToscaConceptIdentifier("participantTypeName", "0.0.1")); return testParticipant; } diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdateTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdateTest.java index 1b155a12a..ce56d582a 100644 --- a/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdateTest.java +++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ControlLoopUpdateTest.java @@ -36,6 +36,7 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoop import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantUpdates; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; +import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty; /** * Test the copy constructor. @@ -62,8 +63,11 @@ class ControlLoopUpdateTest { clElement.setParticipantId(id); clElement.setParticipantType(id); - Map commonPropertiesMap = Map.of("Prop1", "PropValue"); - clElement.setCommonPropertiesMap(commonPropertiesMap); + ToscaProperty property = new ToscaProperty(); + property.setName("test"); + property.setType("testType"); + Map propertiesMap = Map.of("Prop1", property); + clElement.setPropertiesMap(propertiesMap); ParticipantUpdates participantUpdates = new ParticipantUpdates(); participantUpdates.setParticipantId(id); diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantStatusTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantStatusTest.java index f34777a70..b2bce05cc 100644 --- a/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantStatusTest.java +++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantStatusTest.java @@ -42,6 +42,7 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate; +import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty; class ParticipantStatusTest { @@ -117,7 +118,11 @@ class ParticipantStatusTest { ControlLoopElementDefinition clDefinition = new ControlLoopElementDefinition(); clDefinition.setClElementDefinitionId(id); clDefinition.setControlLoopElementToscaNodeTemplate(toscaNodeTemplate); - Map commonPropertiesMap = Map.of("Prop1", "PropValue"); + + ToscaProperty property = new ToscaProperty(); + property.setName("test"); + property.setType("testType"); + Map commonPropertiesMap = Map.of("Prop1", property); clDefinition.setCommonPropertiesMap(commonPropertiesMap); return clDefinition; } diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantUpdateTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantUpdateTest.java index 6fe8604cf..d7023d0c1 100644 --- a/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantUpdateTest.java +++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/messages/dmaap/participant/ParticipantUpdateTest.java @@ -35,6 +35,7 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate; +import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; /** @@ -89,7 +90,11 @@ class ParticipantUpdateTest { ControlLoopElementDefinition clDefinition = new ControlLoopElementDefinition(); clDefinition.setClElementDefinitionId(id); clDefinition.setControlLoopElementToscaNodeTemplate(toscaNodeTemplate); - Map commonPropertiesMap = Map.of("Prop1", "PropValue"); + + ToscaProperty property = new ToscaProperty(); + property.setName("test"); + property.setType("testType"); + Map commonPropertiesMap = Map.of("Prop1", property); clDefinition.setCommonPropertiesMap(commonPropertiesMap); return clDefinition; } -- cgit 1.2.3-korg