summaryrefslogtreecommitdiffstats
path: root/main/src/test/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-04-10 09:26:59 -0400
committerJim Hahn <jrh3@att.com>2019-04-10 09:31:53 -0400
commitf156e04114c5e67ad59d3b7f12e6ddf9e8442755 (patch)
tree281c3421d7dc1f21763bd76fb0a4c9a2364d0cd4 /main/src/test/java
parentc967bf7387a7586a13a2ae7d4f0e258e3f524a38 (diff)
Current draft of undeploy
Change-Id: If3f01a6e92bef9eb889066115537f599e6b09229 Issue-ID: POLICY-1541 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main/src/test/java')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeleteControllerV1.java (renamed from main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeleteControllerV1.java)19
1 files changed, 10 insertions, 9 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeleteControllerV1.java b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeleteControllerV1.java
index dd4fe937..e1c8c519 100644
--- a/main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupDeleteControllerV1.java
+++ b/main/src/test/java/org/onap/policy/pap/main/rest/depundep/TestPdpGroupDeleteControllerV1.java
@@ -19,7 +19,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.pap.main.rest;
+package org.onap.policy.pap.main.rest.depundep;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
@@ -28,6 +28,7 @@ import javax.ws.rs.client.Invocation;
import javax.ws.rs.core.Response;
import org.junit.Test;
import org.onap.policy.models.pap.concepts.PdpGroupDeleteResponse;
+import org.onap.policy.pap.main.rest.CommonPapRestServer;
public class TestPdpGroupDeleteControllerV1 extends CommonPapRestServer {
@@ -88,13 +89,13 @@ public class TestPdpGroupDeleteControllerV1 extends CommonPapRestServer {
Invocation.Builder invocationBuilder = sendRequest(uri);
Response rawresp = invocationBuilder.delete();
PdpGroupDeleteResponse resp = rawresp.readEntity(PdpGroupDeleteResponse.class);
- assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus());
- assertNull(resp.getErrorDetails());
+ assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), rawresp.getStatus());
+ assertEquals("cannot find policy: my-name", resp.getErrorDetails());
rawresp = invocationBuilder.delete();
resp = rawresp.readEntity(PdpGroupDeleteResponse.class);
- assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus());
- assertNull(resp.getErrorDetails());
+ assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), rawresp.getStatus());
+ assertEquals("cannot find policy: my-name", resp.getErrorDetails());
// verify it fails when no authorization info is included
checkUnauthRequest(uri, req -> req.delete());
@@ -107,13 +108,13 @@ public class TestPdpGroupDeleteControllerV1 extends CommonPapRestServer {
Invocation.Builder invocationBuilder = sendRequest(uri);
Response rawresp = invocationBuilder.delete();
PdpGroupDeleteResponse resp = rawresp.readEntity(PdpGroupDeleteResponse.class);
- assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus());
- assertNull(resp.getErrorDetails());
+ assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), rawresp.getStatus());
+ assertEquals("cannot find policy: my-name 3", resp.getErrorDetails());
rawresp = invocationBuilder.delete();
resp = rawresp.readEntity(PdpGroupDeleteResponse.class);
- assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus());
- assertNull(resp.getErrorDetails());
+ assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), rawresp.getStatus());
+ assertEquals("cannot find policy: my-name 3", resp.getErrorDetails());
// verify it fails when no authorization info is included
checkUnauthRequest(uri, req -> req.delete());