diff options
Diffstat (limited to 'controlloop/common/model-impl/rest/src/test/java')
-rwxr-xr-x | controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestGet.java | 12 | ||||
-rwxr-xr-x | controlloop/common/model-impl/rest/src/test/java/org/onap/policy/rest/TestPost.java | 9 |
2 files changed, 13 insertions, 8 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 0bf1da8d5..a2252a046 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 @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * rest * ================================================================================ - * + * Copyright (C) 2017-2018 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. @@ -34,10 +34,14 @@ public class TestGet { mgr.get(null, "user", null, null); } - @Test(expected = IllegalArgumentException.class) + @Test public void testUsernameNull() { RESTManager mgr = new RESTManager(); - mgr.get("nothing", null, null, null); + + Pair<Integer, String> result = mgr.get("http://www.example.org", null, null, null); + assertEquals((Integer)200, result.a); + assertTrue(result.b != null); + assertTrue(result.b.length() > 0); } @Test 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 1cdde22e8..de44dec6b 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 @@ -1,8 +1,8 @@ -/*- +/* * ============LICENSE_START======================================================= * rest * ================================================================================ - * + * Copyright (C) 2017-2018 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. @@ -27,10 +27,11 @@ import org.onap.policy.rest.RESTManager.Pair; public class TestPost { - @Test(expected = IllegalArgumentException.class) + @Test public void testUsernameNull() { RESTManager mgr = new RESTManager(); - mgr.post("nothing", null, null, null, null, null); + Pair<Integer, String> result = mgr.post("http://www.example.org", null, null, null, null, null); + assertEquals(null, result); } @Test |