summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpUpdate.java3
-rw-r--r--models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/PdpUpdateTest.java1
2 files changed, 3 insertions, 1 deletions
diff --git a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpUpdate.java b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpUpdate.java
index 5d0e225c3..c42f1db09 100644
--- a/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpUpdate.java
+++ b/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpUpdate.java
@@ -21,6 +21,7 @@
package org.onap.policy.models.pdp.concepts;
+import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import lombok.Getter;
@@ -54,7 +55,7 @@ public class PdpUpdate extends PdpMessage {
* listed. Note: this list may be empty, as a PDP may remain attached to a subgroup
* even if all of the policies are removed from the subgroup.
*/
- private List<ToscaPolicy> policies;
+ private List<ToscaPolicy> policies = new LinkedList<>();
/**
* Constructor for instantiating PdpUpdate class with message name.
diff --git a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/PdpUpdateTest.java b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/PdpUpdateTest.java
index 8889e483f..2dfcb30fe 100644
--- a/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/PdpUpdateTest.java
+++ b/models-pdp/src/test/java/org/onap/policy/models/pdp/concepts/PdpUpdateTest.java
@@ -41,6 +41,7 @@ public class PdpUpdateTest {
assertThatThrownBy(() -> new PdpUpdate(null)).isInstanceOf(NullPointerException.class);
PdpUpdate orig = new PdpUpdate();
+ orig.setPolicies(null);
// verify with null values
assertEquals(removeVariableFields(orig.toString()), removeVariableFields(new PdpUpdate(orig).toString()));