diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2022-04-06 09:53:27 +0100 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2022-04-06 14:22:31 +0100 |
commit | f93a6c0ab006258628fc2da69dcfe65010baf848 (patch) | |
tree | 5a4d4ac30ad54ccae69dd33cadce4ce8d22af6bd /reception/src/test/java | |
parent | 6a1a74e2284397060191a8e543f853725c0f22f9 (diff) |
Error handling when a decoder fails to parse policy
- catch exception only if it was a parse error (still raises
exception when no decoder found)
- reducing of complexity on acm decoding for sonar
- added some debug logging and exception messages for better
tracking of issues
Issue-ID: POLICY-4006
Change-Id: Ie09aaf541fc06244b84477ecbfe70fc837438a86
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'reception/src/test/java')
-rw-r--r-- | reception/src/test/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandlerTest.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/reception/src/test/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandlerTest.java b/reception/src/test/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandlerTest.java index 2f2d42c3..1dc4bfe0 100644 --- a/reception/src/test/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandlerTest.java +++ b/reception/src/test/java/org/onap/policy/distribution/reception/handling/AbstractReceptionHandlerTest.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2022 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -118,10 +119,10 @@ public class AbstractReceptionHandlerTest { handler.inputReceived(new DummyPolicyInput()); } - class DummyPolicyInput implements PolicyInput { + static class DummyPolicyInput implements PolicyInput { } - class DummyPolicy1 extends ToscaEntity { + static class DummyPolicy1 extends ToscaEntity { @Override public String getName() { @@ -129,7 +130,7 @@ public class AbstractReceptionHandlerTest { } } - class DummyPolicy2 extends ToscaEntity { + static class DummyPolicy2 extends ToscaEntity { @Override public String getName() { @@ -161,7 +162,7 @@ public class AbstractReceptionHandlerTest { } private Map<String, PolicyDecoderParameters> getPolicyDecoders() { - final Map<String, PolicyDecoderParameters> policyDecoders = new HashMap<String, PolicyDecoderParameters>(); + final Map<String, PolicyDecoderParameters> policyDecoders = new HashMap<>(); final PolicyDecoderParameters pDParameters = new PolicyDecoderParameters(DECODER_TYPE, DECODER_CLASS_NAME, DECODER_CONFIGURATION_PARAMETERS); policyDecoders.put(DECODER_KEY, pDParameters); @@ -170,7 +171,7 @@ public class AbstractReceptionHandlerTest { private Map<String, PolicyForwarderParameters> getPolicyForwarders() { final Map<String, PolicyForwarderParameters> policyForwarders = - new HashMap<String, PolicyForwarderParameters>(); + new HashMap<>(); final PolicyForwarderParameters pFParameters = new PolicyForwarderParameters(FORWARDER_TYPE, FORWARDER_CLASS_NAME, FORWARDER_CONFIGURATION_PARAMETERS); policyForwarders.put(FORWARDER_KEY, pFParameters); @@ -180,9 +181,7 @@ public class AbstractReceptionHandlerTest { private PluginHandlerParameters getPluginHandlerParameters() { final Map<String, PolicyDecoderParameters> policyDecoders = getPolicyDecoders(); final Map<String, PolicyForwarderParameters> policyForwarders = getPolicyForwarders(); - final PluginHandlerParameters pluginHandlerParameters = - new PluginHandlerParameters(policyDecoders, policyForwarders); - return pluginHandlerParameters; + return new PluginHandlerParameters(policyDecoders, policyForwarders); } } |