summaryrefslogtreecommitdiffstats
path: root/models-tosca/src/test
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2020-11-20 10:24:44 +0000
committerliamfallon <liam.fallon@est.tech>2020-12-01 12:27:54 +0000
commit950cbb8872fb2227f4a0382a756a7e1dff53b09c (patch)
treece493c7161872360f4d88c5065c0730d53987c82 /models-tosca/src/test
parent1dd41890f83702d47c5a957493046433989ef36c (diff)
Add extra authorative TOSCA concepts
This review brings in extra TOSCA concepts for Node types, nodes, and capabilities. The TOSCA handling is also amended to make the handling of equality consistent. Now, if filtering or ordering is required using an order rather than natural ordering, a comparator must be supplied by the user. Issue-ID: POLICY-2900 Change-Id: Ie40e86870b97eb993b1338bdc0666ac116f72f67 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-tosca/src/test')
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTest.java4
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeTest.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTest.java
index faafa8c60..9fd559392 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTest.java
@@ -56,11 +56,11 @@ public class ToscaPolicyTest {
assertEquals("3.2.1", type.getVersion());
ToscaPolicy clonedPolicy0 = new ToscaPolicy(policy);
- assertEquals(0, policy.compareTo(clonedPolicy0));
+ assertEquals(0, new ToscaPolicyComparator().compare(policy, clonedPolicy0));
policy.setProperties(new LinkedHashMap<String, Object>());
policy.getProperties().put("PropertyKey", "PropertyValue");
ToscaPolicy clonedPolicy1 = new ToscaPolicy(policy);
- assertEquals(0, policy.compareTo(clonedPolicy1));
+ assertEquals(0, new ToscaPolicyComparator().compare(policy, clonedPolicy1));
}
}
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeTest.java
index fc9c69319..75c6b51e3 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyTypeTest.java
@@ -46,7 +46,7 @@ public class ToscaPolicyTypeTest {
tpt.setDescription("Desc");
ToscaPolicyType clonedTpt0 = new ToscaPolicyType(tpt);
- assertEquals(0, tpt.compareTo(clonedTpt0));
+ assertEquals(0, new ToscaPolicyTypeComparator().compare(tpt, clonedTpt0));
tpt.setMetadata(new LinkedHashMap<>());
tpt.setProperties(new LinkedHashMap<>());
@@ -57,6 +57,6 @@ public class ToscaPolicyTypeTest {
tpt.getProperties().put("Property0", tp);
ToscaPolicyType clonedTpt1 = new ToscaPolicyType(tpt);
- assertEquals(0, tpt.compareTo(clonedTpt1));
+ assertEquals(0, new ToscaPolicyTypeComparator().compare(tpt, clonedTpt1));
}
}