diff options
author | Sirisha_Manchikanti <sirisha.manchikanti@est.tech> | 2021-09-20 16:08:25 +0100 |
---|---|---|
committer | Sirisha_Manchikanti <sirisha.manchikanti@est.tech> | 2021-09-22 14:07:56 +0100 |
commit | 9b982666d6ddb6c964a1e539fea97231b5053f5b (patch) | |
tree | d3e5d8959002f73c420946e7553bb4fb0aae02b7 /models/src/test | |
parent | b428105b44d0504b05a0b93894bef97e5ab7e8b4 (diff) |
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 <sirisha.manchikanti@est.tech>
Change-Id: Ic9205aafe269ccc6dae0b3463fc6df5c47129e5d
Diffstat (limited to 'models/src/test')
5 files changed, 24 insertions, 5 deletions
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<String, String> commonPropertiesMap = Map.of("Prop1", "PropValue"); - clElement.setCommonPropertiesMap(commonPropertiesMap); + ToscaProperty property = new ToscaProperty(); + property.setName("test"); + property.setType("testType"); + Map<String, ToscaProperty> 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<String, String> commonPropertiesMap = Map.of("Prop1", "PropValue"); + + ToscaProperty property = new ToscaProperty(); + property.setName("test"); + property.setType("testType"); + Map<String, ToscaProperty> 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<String, String> commonPropertiesMap = Map.of("Prop1", "PropValue"); + + ToscaProperty property = new ToscaProperty(); + property.setName("test"); + property.setType("testType"); + Map<String, ToscaProperty> commonPropertiesMap = Map.of("Prop1", property); clDefinition.setCommonPropertiesMap(commonPropertiesMap); return clDefinition; } diff --git a/models/src/test/resources/providers/TestParticipant.json b/models/src/test/resources/providers/TestParticipant.json index c6965ce62..4722ead9b 100644 --- a/models/src/test/resources/providers/TestParticipant.json +++ b/models/src/test/resources/providers/TestParticipant.json @@ -7,5 +7,9 @@ }, "participantState": "PASSIVE", "healthStatus": "HEALTHY", - "description": "A dummy PMSH participant1" + "description": "A dummy PMSH participant1", + "participantType":{ + "name": "org.onap.domain.pmsh.PolicyControlLoopDefinition", + "version": "1.0.0" + } } |