aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-lib
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2020-08-04 14:16:00 +0200
committersebdet <sebastien.determe@intl.att.com>2020-09-08 13:45:31 +0200
commit30670accb070b20c1c770d1ebbd6d72e24fee2db (patch)
tree8ddb5d70500aa1b3baa4e262de411e8394e22e6a /openecomp-be/lib/openecomp-tosca-lib
parenta8a96339680fa1c4df5577285442e902b5637631 (diff)
Upgrade to java 11
MOve SDC to Java 11, this is one of the PR to move to Jdk 11, jenkins will have to be changed as well Issue-ID: SDC-2725 Change-Id: I85f13f14ba8004f6e9656093a837465a2e4af3e1 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Signed-off-by: xuegao <xg353y@intl.att.com> Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib')
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/pom.xml20
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java5
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java3
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java2
4 files changed, 22 insertions, 8 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/pom.xml b/openecomp-be/lib/openecomp-tosca-lib/pom.xml
index 6867d17cde..fd1728e905 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/pom.xml
+++ b/openecomp-be/lib/openecomp-tosca-lib/pom.xml
@@ -109,6 +109,24 @@
<properties>
<useSystemClassLoader>false</useSystemClassLoader>
</properties>
-
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <excludes>
+ <exclude>**/*.csar</exclude>
+ </excludes>
+ <filtering>true</filtering>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources/mock/analyzerService</directory>
+ <includes>
+ <include>**.csar</include>
+ </includes>
+ <filtering>false</filtering>
+ <targetPath>mock/analyzerService</targetPath>
+ </testResource>
+ </testResources>
+ </build>
</project>
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
index 70cae71f17..f7188379dc 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java
@@ -373,12 +373,9 @@ public class DataModelUtil {
throw new CoreException(new InvalidRequirementAssignmentErrorBuilder(requirementId).build());
}
- if (nodeTemplate.getRequirements() == null) {
- nodeTemplate.setRequirements(new ArrayList<>());
- }
Map<String, RequirementAssignment> requirement = new HashMap<>();
requirement.put(requirementId, requirementAssignment);
- nodeTemplate.getRequirements().add(requirement);
+ nodeTemplate.addRequirements(requirement);
}
/**
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java
index 4ad4d2b53e..5a19eacf3e 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java
@@ -268,8 +268,7 @@ public class ToscaModelTest {
Map<String, RequirementAssignment> nodeTemplateRequirement2 = new HashMap<>();
nodeTemplateRequirement1.put(REQ1, reqAssignment1);
nodeTemplateRequirement2.put(REQ2, reqAssignment2);
- nodeTemplate.setRequirements(new ArrayList<>());
- nodeTemplate.getRequirements().add(nodeTemplateRequirement1);
+ nodeTemplate.addRequirements(nodeTemplateRequirement1);
nodeTemplate.getRequirements().add(nodeTemplateRequirement2);
CapabilityAssignment capAss = new CapabilityAssignment();
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java
index fe4a37f39b..8b732df95c 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java
@@ -681,7 +681,7 @@ public class DataModelUtilTest {
requirementAssignment1.setRelationship("relationshipId");
DataModelUtil.removeRequirementAssignment(nodeTemplate, REQUIREMENT_KEY, requirementAssignment);
- assertTrue(requirementList.isEmpty());
+ assertTrue(nodeTemplate.getRequirements().isEmpty());
}
@Test