diff options
author | s00370346 <swarup.nayak1@huawei.com> | 2019-03-19 16:22:00 +0530 |
---|---|---|
committer | s00370346 <swarup.nayak1@huawei.com> | 2019-03-19 19:43:26 +0530 |
commit | 82c26b5b8e7e92dfd9108684290e3a596b800e62 (patch) | |
tree | 3c7c308df7ee1b1e6637b1b9730ad662abf8c17c /src/main/java/org/onap/dcae/common/RestapiCallNode.java | |
parent | be11dee889f5a740d584458b62804e5fd4296e53 (diff) |
Issue-ID: DCAEGEN2-1055 RestConfCollector UnitTest
Change-Id: I513ddb61d710f12ab3ccc6fca2329f3f74b4e39c
Signed-off-by: s00370346 <swarup.nayak1@huawei.com>
Diffstat (limited to 'src/main/java/org/onap/dcae/common/RestapiCallNode.java')
-rwxr-xr-x | src/main/java/org/onap/dcae/common/RestapiCallNode.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/onap/dcae/common/RestapiCallNode.java b/src/main/java/org/onap/dcae/common/RestapiCallNode.java index af0245d..01da72d 100755 --- a/src/main/java/org/onap/dcae/common/RestapiCallNode.java +++ b/src/main/java/org/onap/dcae/common/RestapiCallNode.java @@ -265,7 +265,7 @@ public class RestapiCallNode { byte[] encoded = Files.readAllBytes(Paths.get(fileName)); return new String(encoded, "UTF-8"); } catch (IOException | SecurityException e) { - throw new Exception("Unable to read file " + fileName + e.getLocalizedMessage(), e); + throw new IOException("Unable to read file " + fileName + e.getLocalizedMessage(), e); } } @@ -289,14 +289,14 @@ public class RestapiCallNode { if (p.restapiUser != null && p.restapiPassword != null) { client.addFilter(new HTTPDigestAuthFilter(p.restapiUser, p.restapiPassword)); } else { - throw new Exception("oAUTH authentication type selected but all restapiUser and restapiPassword " + + throw new SecurityException("oAUTH authentication type selected but all restapiUser and restapiPassword " + "parameters doesn't exist", new Throwable()); } } else if (p.authtype == AuthType.BASIC) { if (p.restapiUser != null && p.restapiPassword != null) { client.addFilter(new HTTPBasicAuthFilter(p.restapiUser, p.restapiPassword)); } else { - throw new Exception("oAUTH authentication type selected but all restapiUser and restapiPassword " + + throw new SecurityException("oAUTH authentication type selected but all restapiUser and restapiPassword " + "parameters doesn't exist", new Throwable()); } } else if (p.authtype == AuthType.OAUTH) { @@ -310,7 +310,7 @@ public class RestapiCallNode { .consumerSecret(p.oAuthConsumerSecret); client.addFilter(new OAuthClientFilter(client.getProviders(), params, secrets)); } else { - throw new Exception("oAUTH authentication type selected but all oAuthConsumerKey, voAuthConsumerSecret " + + throw new SecurityException("oAUTH authentication type selected but all oAuthConsumerKey, voAuthConsumerSecret " + "and oAuthSignatureMethod parameters doesn't exist", new Throwable()); } } |