Modified PdpUpdate to create an empty policy list, by default,
rather than leaving it null.
Change-Id: I81906410bcc7da21d6471d496713ec9b375632a2
Issue-ID: POLICY-1692
Signed-off-by: Jim Hahn <jrh3@att.com>
package org.onap.policy.models.pdp.concepts;
+import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import lombok.Getter;
* 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.
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()));