summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl/rest
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-impl/rest')
-rw-r--r--models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java63
1 files changed, 32 insertions, 31 deletions
diff --git a/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java b/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java
index 52c0912e3..21df853f4 100644
--- a/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java
+++ b/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/RestTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* rest
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,6 +22,7 @@
package org.onap.policy.rest;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.lang.annotation.Documented;
@@ -146,55 +147,55 @@ public class RestTest {
Pair<Integer, String> result = mgr.get(getUri, null, null, null);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("GOT: " + EXPECT_STRING, result.getRight());
result = mgr.delete(deleteUri, null, null, null, null, null);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("DELETE: " + EXPECT_STRING, result.getRight());
result = mgr.delete(deleteUri, null, null, null);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("DELETE: " + EXPECT_STRING, result.getRight());
result = mgr.put(putUri, null, null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PUT: " + PAYLOAD + EXPECT_STRING, result.getRight());
result = mgr.put(putUriBlank, null, null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PUT: " + PAYLOAD + RETURN_STRING, result.getRight());
result = mgr.post(postUri, null, null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("POST: " + PAYLOAD + EXPECT_STRING, result.getRight());
result = mgr.post(postUriBlank, null, null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("POST: " + PAYLOAD + RETURN_STRING, result.getRight());
result = mgr.patch(patchUri, null, null, null, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PATCH: " + PAYLOAD + EXPECT_STRING, result.getRight());
result = mgr.patch(patchUriBlank, null, null, null, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PATCH: " + PAYLOAD + RETURN_STRING, result.getRight());
@@ -207,49 +208,49 @@ public class RestTest {
Pair<Integer, String> result = mgr.get(getUri, "", null, null);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("GOT: " + EXPECT_STRING, result.getRight());
result = mgr.delete(deleteUri, "", null, null, null, null);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("DELETE: " + EXPECT_STRING, result.getRight());
result = mgr.put(putUri, "", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PUT: " + PAYLOAD + EXPECT_STRING, result.getRight());
result = mgr.put(putUriBlank, "", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PUT: " + PAYLOAD + RETURN_STRING, result.getRight());
result = mgr.post(postUri, "", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("POST: " + PAYLOAD + EXPECT_STRING, result.getRight());
result = mgr.post(postUriBlank, "", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("POST: " + PAYLOAD + RETURN_STRING, result.getRight());
result = mgr.patch(patchUri, "", null, null, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PATCH: " + PAYLOAD + EXPECT_STRING, result.getRight());
result = mgr.patch(patchUriBlank, "", null, null, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PATCH: " + PAYLOAD + RETURN_STRING, result.getRight());
@@ -262,49 +263,49 @@ public class RestTest {
Pair<Integer, String> result = mgr.get(getUri, "user", null, null);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("GOT: " + EXPECT_STRING, result.getRight());
result = mgr.delete(deleteUri, "user", null, null, null, null);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("DELETE: " + EXPECT_STRING, result.getRight());
result = mgr.put(putUri, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PUT: " + PAYLOAD + EXPECT_STRING, result.getRight());
result = mgr.put(putUriBlank, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PUT: " + PAYLOAD + RETURN_STRING, result.getRight());
result = mgr.post(postUri, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("POST: " + PAYLOAD + EXPECT_STRING, result.getRight());
result = mgr.post(postUriBlank, "user", null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("POST: " + PAYLOAD + RETURN_STRING, result.getRight());
result = mgr.patch(patchUri, "user", null, null, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PATCH: " + PAYLOAD + EXPECT_STRING, result.getRight());
result = mgr.patch(patchUriBlank, "user", null, null, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PATCH: " + PAYLOAD + RETURN_STRING, result.getRight());
@@ -339,33 +340,33 @@ public class RestTest {
Pair<Integer, String> result = mgr.get(baseUri + "RestTest/GetHello/" + NAME_PARAM, null, null, null);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("GOT: " + RETURN_STRING + NAME_PARAM + " aged 90", result.getRight());
result = mgr.delete(baseUri + "RestTest/DeleteHello/" + NAME_PARAM, null, null, null, null, null);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("DELETE: " + RETURN_STRING + NAME_PARAM + " aged 90", result.getRight());
result = mgr.put(baseUri + "RestTest/PutHello/" + NAME_PARAM, null, null, null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PUT: " + PAYLOAD + RETURN_STRING + NAME_PARAM + " aged 90", result.getRight());
result = mgr.post(baseUri + "RestTest/PostHello/" + NAME_PARAM, null, null,
null, MediaType.TEXT_PLAIN, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("POST: " + PAYLOAD + RETURN_STRING + NAME_PARAM + " aged 90", result.getRight());
result = mgr.patch(baseUri + "RestTest/PatchHello/" + NAME_PARAM, null, null,
null, PAYLOAD);
assertEquals((Integer) 200, result.getLeft());
- assertTrue(result.getRight() != null);
+ assertNotNull(result.getRight());
assertTrue(result.getRight().length() > 0);
assertEquals("PATCH: " + PAYLOAD + RETURN_STRING + NAME_PARAM + " aged 90", result.getRight());