summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@est.tech>2021-02-16 14:40:11 +0000
committerGerrit Code Review <gerrit@onap.org>2021-02-16 14:40:11 +0000
commitee3d6d87e355acf2f45a9876ed065d2623b8983d (patch)
tree1fa4e3ffd02c20370bd7112f2ab4bb662603fa52
parent5aeffc5b5032cb4c14f00420136cd997a240c17d (diff)
parent59d6c65ea096b5fe169c8f62acc15dd0f3de7cfb (diff)
Merge "Updating PAP deployment API to reflect actual status"
-rw-r--r--models-pap/src/main/java/org/onap/policy/models/pap/concepts/PdpGroupDeployResponse.java21
-rw-r--r--models-pap/src/test/java/org/onap/policy/models/pap/concepts/PdpGroupDeployResponseTest.java49
2 files changed, 70 insertions, 0 deletions
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 2d7dd2ec3..60f76e29a 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
@@ -3,6 +3,7 @@
* ONAP Policy Models
* ================================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2021 Bell Canada. 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.
@@ -32,4 +33,24 @@ import lombok.ToString;
@ToString(callSuper = true)
public class PdpGroupDeployResponse extends SimpleResponse {
+ /**
+ * Response message for deployment.
+ */
+ private String message;
+
+ /**
+ * Url to fetch the deployment status.
+ */
+ private String url;
+
+ /**
+ * Constructs the object.
+ *
+ * @param message the message
+ * @param url the url to get actual deployment status
+ */
+ public PdpGroupDeployResponse(String message, String url) {
+ this.message = message;
+ this.url = url;
+ }
}
diff --git a/models-pap/src/test/java/org/onap/policy/models/pap/concepts/PdpGroupDeployResponseTest.java b/models-pap/src/test/java/org/onap/policy/models/pap/concepts/PdpGroupDeployResponseTest.java
new file mode 100644
index 000000000..178687daa
--- /dev/null
+++ b/models-pap/src/test/java/org/onap/policy/models/pap/concepts/PdpGroupDeployResponseTest.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2021 Bell Canada. 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.junit.Test;
+
+/**
+ * Test class for PdpGroupDeployResponse.
+ */
+public class PdpGroupDeployResponseTest {
+
+ private static final String URL = "/policy/pap/v1/policies/status";
+ private static final String MESSAGE = "the message";
+
+ @Test
+ public void testPdpGroupDeployResponse() {
+ assertNotNull(new PdpGroupDeployResponse("message", "url"));
+ assertNotNull(new PdpGroupDeployResponse("message", null));
+ assertNotNull(new PdpGroupDeployResponse(null, null));
+
+ PdpGroupDeployResponse resp = new PdpGroupDeployResponse(MESSAGE, URL);
+ assertEquals(MESSAGE, resp.getMessage());
+ assertEquals(URL, resp.getUrl());
+
+ resp = new PdpGroupDeployResponse(null, null);
+ assertNull(resp.getMessage());
+ assertNull(resp.getUrl());
+ }
+}