From dffa54c9a27bcd9524e2aa75684ff02d70507b59 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Thu, 26 Mar 2020 10:03:11 -0400 Subject: Remove unused imports and clean logs Unused imports and marked an unused variable. Added m2e eclipse settings (other repos have this). Added some test logback.xml to clear out jetty debug messages. Replaced deprecated newInstance with getDeclaredConstructor. newInstance Either log or throw Exception - chose throw Added some assertions to JUnit test. Issue-ID: POLICY-2305 Change-Id: Ia4e9ce62dc7fb45aea247d470ca7245e694fc26e Signed-off-by: Pamela Dragosh --- .../policy/distribution/forwarding/file/FilePolicyForwarder.java | 2 +- .../forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'plugins/forwarding-plugins/src/main') diff --git a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/file/FilePolicyForwarder.java b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/file/FilePolicyForwarder.java index 55735662..e88f7eb9 100644 --- a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/file/FilePolicyForwarder.java +++ b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/file/FilePolicyForwarder.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Intel Crop. All rights reserved. + * Modifications Copyright (C) 2020 AT&T Inc. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,7 +98,6 @@ public class FilePolicyForwarder implements PolicyForwarder { LOGGER.debug("Sucessfully forwarded the policy to store into file {}.", path); } catch (final InvalidPathException | IOException exp) { final String message = "Error sending policy to file under path:" + fileForwarderParameters.getPath(); - LOGGER.error(message, exp); throw new PolicyForwardingException(message, exp); } } diff --git a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java index 5cd9966d..e3c013ad 100644 --- a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java +++ b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2020 AT&T Inc. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -153,10 +154,8 @@ public class LifecycleApiPolicyForwarder implements PolicyForwarder { throw new PolicyForwardingException("Failed creating the entity - " + entity); } } catch (final HttpClientConfigException exception) { - LOGGER.error( - "Invocation of path " + path + " failed for entity " + entity + " due to error opening Http client", + throw new PolicyForwardingException("Invocation of path " + path + " failed for entity " + entity, exception); - throw new PolicyForwardingException("Failed creating the entity - " + entity, exception); } return response; } -- cgit 1.2.3-korg