diff options
Diffstat (limited to 'controlloop/common/model-impl/rest/src/test')
-rwxr-xr-x | controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java | 10 | ||||
-rwxr-xr-x | controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java index a2252a046..a8301810c 100755 --- a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java +++ b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java @@ -45,6 +45,16 @@ public class TestGet { } @Test + public void testUsernameEmpty() { + RESTManager mgr = new RESTManager(); + + Pair<Integer, String> result = mgr.get("http://www.example.org", "", null, null); + assertEquals((Integer)200, result.a); + assertTrue(result.b != null); + assertTrue(result.b.length() > 0); + } + + @Test public void testUrlExampleOrg() { RESTManager mgr = new RESTManager(); diff --git a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java index de44dec6b..58ba5d247 100755 --- a/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java +++ b/controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java @@ -35,6 +35,13 @@ public class TestPost { } @Test + public void testUsernameEmpty() { + RESTManager mgr = new RESTManager(); + Pair<Integer, String> result = mgr.post("http://www.example.org", "", null, null, null, null); + assertEquals(null, result); + } + + @Test public void testBodyNull() { RESTManager mgr = new RESTManager(); Pair<Integer, String> result = mgr.post("http://www.example.org", "user", null, null, null, null); |