summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java1
-rw-r--r--models-base/src/main/java/org/onap/policy/models/base/PfUtils.java2
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java10
-rw-r--r--models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeleteResponse.java2
-rw-r--r--models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeployResponse.java2
-rw-r--r--models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupStateChangeResponse.java2
-rw-r--r--models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyUndeployResponse.java35
7 files changed, 50 insertions, 4 deletions
diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java b/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java
index a7d8401f0..6ede4d9a3 100644
--- a/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java
+++ b/models-base/src/main/java/org/onap/policy/models/base/PfObjectFilter.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfUtils.java b/models-base/src/main/java/org/onap/policy/models/base/PfUtils.java
index 7bdd9a5f4..c33271d78 100644
--- a/models-base/src/main/java/org/onap/policy/models/base/PfUtils.java
+++ b/models-base/src/main/java/org/onap/policy/models/base/PfUtils.java
@@ -73,7 +73,7 @@ public final class PfUtils {
*/
public static <T> List<T> mapList(List<T> source, Function<T, T> mapFunc) {
if (source == null) {
- return new ArrayList<>();
+ return new ArrayList<>(0);
}
return source.stream().map(mapFunc).collect(Collectors.toList());
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java
index 11ddf3132..339ee9d1b 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java
@@ -52,9 +52,19 @@ public class PfUtilsTest {
});
assertTrue(resultList.isEmpty());
+ // verify that we can modify the empty list without throwing an exception
+ resultList.add("xyz");
+ resultList.add("pdq");
+ resultList.remove("xyz");
+
+
List<String> origList = Arrays.asList("abc", "def");
List<String> newList = PfUtils.mapList(origList, text -> text + "X");
assertEquals(Arrays.asList("abcX", "defX"), newList);
+
+ // verify that we can modify the list without throwing an exception
+ newList.remove("abcX");
+ newList.add("something else");
}
}
diff --git a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeleteResponse.java b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeleteResponse.java
index 46da8d363..e1094f48a 100644
--- a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeleteResponse.java
+++ b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeleteResponse.java
@@ -29,7 +29,7 @@ import lombok.ToString;
*/
@Getter
@Setter
-@ToString
+@ToString(callSuper = true)
public class PdpGroupDeleteResponse extends SimpleResponse {
}
diff --git a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeployResponse.java b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeployResponse.java
index b81d02b87..2d7dd2ec3 100644
--- a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeployResponse.java
+++ b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeployResponse.java
@@ -29,7 +29,7 @@ import lombok.ToString;
*/
@Getter
@Setter
-@ToString
+@ToString(callSuper = true)
public class PdpGroupDeployResponse extends SimpleResponse {
}
diff --git a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupStateChangeResponse.java b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupStateChangeResponse.java
index 1c013012a..292848346 100644
--- a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupStateChangeResponse.java
+++ b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupStateChangeResponse.java
@@ -29,7 +29,7 @@ import lombok.ToString;
*/
@Getter
@Setter
-@ToString
+@ToString(callSuper = true)
public class PdpGroupStateChangeResponse extends SimpleResponse {
}
diff --git a/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyUndeployResponse.java b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyUndeployResponse.java
new file mode 100644
index 000000000..a41913032
--- /dev/null
+++ b/models-pap/src/main/java/org/onap/policy/models/pap/concepts/PolicyUndeployResponse.java
@@ -0,0 +1,35 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP Policy Models
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.pap.concepts;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ * Response to a Policy UNDEPLOY REST API.
+ */
+@Getter
+@Setter
+@ToString(callSuper = true)
+public class PolicyUndeployResponse extends SimpleResponse {
+
+}