aboutsummaryrefslogtreecommitdiffstats
path: root/models-tosca/src/main/java
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-04-09 11:55:57 +0000
committerliamfallon <liam.fallon@est.tech>2019-04-09 11:55:57 +0000
commit9ede89131044d171187c5be906aefee615a0e568 (patch)
treed77966aa7aa12ea520bacdbe835355ba20cccb65 /models-tosca/src/main/java
parentc54b9408a10c0060e35be2ee0b5bac6a24e9153a (diff)
Complete unit test for models-pdp
This review completes the unit test for the models-pdp module, for persistence of PDP groups and for PDP group filtering. Added unit test of filters for TOSCA policy types and policies. Added fix to allow filters to pass when the value being checked is null. Issue-ID: POLICY-1095 Change-Id: I982400ef39f0282d813d49e484a58207e03b8a63 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-tosca/src/main/java')
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntity.java2
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyType.java20
2 files changed, 21 insertions, 1 deletions
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntity.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntity.java
index e89b31635..f5a178a37 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntity.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaEntity.java
@@ -54,7 +54,7 @@ public class ToscaEntity implements PfNameVersion {
private String description;
/**
- * Copy COnstructor.
+ * Copy Constructor.
*
* @param copyObject object to copy from
*/
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyType.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyType.java
index 75f17ea5b..3a3b1476d 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyType.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyType.java
@@ -23,10 +23,14 @@
package org.onap.policy.models.tosca.authorative.concepts;
+import java.util.LinkedHashMap;
import java.util.Map;
+import java.util.Map.Entry;
+
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
+import lombok.NonNull;
/**
* Class to represent TOSCA policy type matching input/output from/to client.
@@ -39,6 +43,22 @@ import lombok.NoArgsConstructor;
public class ToscaPolicyType extends ToscaEntity implements Comparable<ToscaPolicyType> {
private Map<String, ToscaProperty> properties;
+ /**
+ * Copy Constructor.
+ *
+ * @param copyObject object to copy from
+ */
+ public ToscaPolicyType(@NonNull ToscaPolicyType copyObject) {
+ super(copyObject);
+
+ if (copyObject.properties != null) {
+ properties = new LinkedHashMap<>();
+ for (final Entry<String, ToscaProperty> propertyEntry : copyObject.properties.entrySet()) {
+ properties.put(propertyEntry.getKey(), propertyEntry.getValue());
+ }
+ }
+ }
+
@Override
public int compareTo(final ToscaPolicyType other) {
return compareNameVersion(this, other);