aboutsummaryrefslogtreecommitdiffstats
path: root/models/src/test/java/org
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2022-12-19 14:43:11 +0000
committerFrancescoFioraEst <francesco.fiora@est.tech>2022-12-20 10:35:32 +0000
commitc71863696d729286502f951a64c3d2193c6641e7 (patch)
tree024363ddde071c3f59d7468bdc9ddfd011d3701e /models/src/test/java/org
parent66208f7d9ec65d859803ed347c3fdecd2d99022f (diff)
Add compositionId into Messages between ACM and Participants
Issue-ID: POLICY-4489 Change-Id: I1fb8c04eacee040d5c944c522ca59a2a9a50376b Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'models/src/test/java/org')
-rw-r--r--models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantStatusTest.java7
-rw-r--r--models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantUpdateTest.java8
-rw-r--r--models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java46
3 files changed, 0 insertions, 61 deletions
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantStatusTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantStatusTest.java
index a8a2267ad..7bf439e3f 100644
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantStatusTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantStatusTest.java
@@ -27,7 +27,6 @@ import static org.onap.policy.clamp.models.acm.messages.dmaap.participant.Partic
import java.time.Instant;
import java.util.List;
-import java.util.Map;
import java.util.UUID;
import org.junit.jupiter.api.Test;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition;
@@ -39,7 +38,6 @@ import org.onap.policy.clamp.models.acm.concepts.ParticipantState;
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 {
@@ -100,11 +98,6 @@ class ParticipantStatusTest {
acDefinition.setAcElementDefinitionId(id);
acDefinition.setAutomationCompositionElementToscaNodeTemplate(toscaNodeTemplate);
- var property = new ToscaProperty();
- property.setName("test");
- property.setType("testType");
- var commonPropertiesMap = Map.of("Prop1", property);
- acDefinition.setCommonPropertiesMap(commonPropertiesMap);
return acDefinition;
}
}
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantUpdateTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantUpdateTest.java
index 074f6f2e2..177e22356 100644
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantUpdateTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantUpdateTest.java
@@ -27,7 +27,6 @@ import static org.onap.policy.clamp.models.acm.messages.dmaap.participant.Partic
import java.time.Instant;
import java.util.List;
-import java.util.Map;
import java.util.UUID;
import org.junit.jupiter.api.Test;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElementDefinition;
@@ -35,7 +34,6 @@ import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition;
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;
/**
@@ -90,12 +88,6 @@ class ParticipantUpdateTest {
AutomationCompositionElementDefinition acDefinition = new AutomationCompositionElementDefinition();
acDefinition.setAcElementDefinitionId(id);
acDefinition.setAutomationCompositionElementToscaNodeTemplate(toscaNodeTemplate);
-
- ToscaProperty property = new ToscaProperty();
- property.setName("test");
- property.setType("testType");
- Map<String, ToscaProperty> commonPropertiesMap = Map.of("Prop1", property);
- acDefinition.setCommonPropertiesMap(commonPropertiesMap);
return acDefinition;
}
}
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java
index 617b2459c..bb33e4d5a 100644
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java
@@ -37,13 +37,9 @@ import java.util.UUID;
import org.junit.jupiter.api.Test;
import org.onap.policy.clamp.models.acm.concepts.AutomationComposition;
import org.onap.policy.clamp.models.acm.concepts.AutomationCompositionElement;
-import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition;
import org.onap.policy.clamp.models.acm.concepts.ParticipantUpdates;
-import org.onap.policy.clamp.models.acm.concepts.ParticipantUtils;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
-import org.onap.policy.common.utils.coder.StandardYamlCoder;
-import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
import org.onap.policy.models.tosca.authorative.concepts.ToscaDataType;
import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
@@ -55,10 +51,6 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaTopologyTemplate;
class AcmUtilsTest {
private final ToscaConceptIdentifier id = new ToscaConceptIdentifier("id", "1.0.0");
- private final ToscaConceptIdentifier idNode =
- new ToscaConceptIdentifier("org.onap.dcae.acm.DCAEMicroserviceAutomationCompositionParticipant", "0.0.0");
- private static final StandardYamlCoder YAML_TRANSLATOR = new StandardYamlCoder();
- private static final String TOSCA_SERVICE_TEMPLATE_YAML = "clamp/acm/pmsh/funtional-pmsh-usecase.yaml";
@Test
void testCommonUtilsParticipantUpdate() {
@@ -88,21 +80,6 @@ class AcmUtilsTest {
}
@Test
- void testCommonUtilsDefinitionUpdate() {
- var toscaServiceTemplate = getDummyToscaServiceTemplate();
- List<ParticipantDefinition> participantDefinitionUpdates = new ArrayList<>();
- assertThat(participantDefinitionUpdates).isEmpty();
-
- checkParticipantDefinitionUpdate(toscaServiceTemplate, participantDefinitionUpdates);
- assertThat(participantDefinitionUpdates).isNotEmpty();
- assertEquals(id, participantDefinitionUpdates.get(0).getParticipantType());
-
- checkParticipantDefinitionUpdate(toscaServiceTemplate, participantDefinitionUpdates);
- assertEquals(idNode, participantDefinitionUpdates.get(0).getAutomationCompositionElementDefinitionList().get(0)
- .getAcElementDefinitionId());
- }
-
- @Test
void testSetServiceTemplatePolicyInfoWithNullInfo() {
var toscaServiceTemplate = getDummyToscaServiceTemplate();
toscaServiceTemplate.setPolicyTypes(null);
@@ -113,16 +90,6 @@ class AcmUtilsTest {
}
@Test
- void testGetCommonOrInstancePropertiesFromNodeTypes() throws Exception {
- var inputServiceTemplate = YAML_TRANSLATOR
- .decode(ResourceUtils.getResourceAsStream(TOSCA_SERVICE_TEMPLATE_YAML), ToscaServiceTemplate.class);
-
- var result = AcmUtils.getCommonOrInstancePropertiesFromNodeTypes(true, inputServiceTemplate);
- assertNotNull(result);
- assertThat(result).hasSize(6);
- }
-
- @Test
void testValidateAutomationComposition() throws Exception {
var automationComposition = getDummyAutomationComposition();
var toscaServiceTemplate = getDummyToscaServiceTemplate();
@@ -196,17 +163,4 @@ class AcmUtilsTest {
nodeTemplates.put("org.onap.dcae.acm.DCAEMicroserviceAutomationCompositionParticipant", nodeTemplate);
return nodeTemplates;
}
-
- private void checkParticipantDefinitionUpdate(ToscaServiceTemplate toscaServiceTemplate,
- List<ParticipantDefinition> participantDefinitionUpdates) {
-
- for (Map.Entry<String, ToscaNodeTemplate> toscaInputEntry : toscaServiceTemplate.getToscaTopologyTemplate()
- .getNodeTemplates().entrySet()) {
- if (ParticipantUtils.checkIfNodeTemplateIsAutomationCompositionElement(toscaInputEntry.getValue(),
- toscaServiceTemplate)) {
- AcmUtils.prepareParticipantDefinitionUpdate(id, toscaInputEntry.getKey(), toscaInputEntry.getValue(),
- participantDefinitionUpdates, null);
- }
- }
- }
}