From 0089e8bc429001eca2997b44168b05889cb75d38 Mon Sep 17 00:00:00 2001 From: mmis Date: Wed, 5 Sep 2018 17:12:03 +0100 Subject: Refactored reception handler parameter handling Refactored parameter handling for configuration of reception handlers as the previous implementation does not align with the plugin architecture (.e. plugin specific parameters being handled in core code) Issue-ID: POLICY-1094 Change-Id: I31a9fc7f712ca43f0f69c42a6d99fa481b02cd4b Signed-off-by: mmis --- .../reception/handling/sdc/TestSdcConfiguration.java | 9 ++++----- .../reception/handling/sdc/TestSdcReceptionHandler.java | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'plugins/reception-plugins/src/test/java/org') diff --git a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcConfiguration.java b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcConfiguration.java index e1ba00cf..65d7ca10 100644 --- a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcConfiguration.java +++ b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcConfiguration.java @@ -34,7 +34,6 @@ import java.util.Arrays; import org.junit.Test; import org.onap.policy.common.parameters.GroupValidationResult; -import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup; /** * Class to perform unit test of {@link SdcConfiguration}. @@ -44,11 +43,11 @@ public class TestSdcConfiguration { @Test public void testSdcConfiguration() throws IOException { - PssdConfigurationParametersGroup configParameters = null; + SdcReceptionHandlerConfigurationParameterGroup configParameters = null; try { final Gson gson = new GsonBuilder().create(); configParameters = gson.fromJson(new FileReader("src/test/resources/handling-sdc.json"), - PssdConfigurationParametersGroup.class); + SdcReceptionHandlerConfigurationParameterGroup.class); } catch (final Exception e) { fail("test should not thrown an exception here: " + e.getMessage()); } @@ -74,11 +73,11 @@ public class TestSdcConfiguration { @Test public void testInvalidSdcConfiguration() throws IOException { - PssdConfigurationParametersGroup configParameters = null; + SdcReceptionHandlerConfigurationParameterGroup configParameters = null; try { final Gson gson = new GsonBuilder().create(); configParameters = gson.fromJson(new FileReader("src/test/resources/handling-sdcInvalid.json"), - PssdConfigurationParametersGroup.class); + SdcReceptionHandlerConfigurationParameterGroup.class); } catch (final Exception e) { fail("test should not thrown an exception here: " + e.getMessage()); } diff --git a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandler.java b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandler.java index 02b83849..c876f99c 100644 --- a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandler.java +++ b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/handling/sdc/TestSdcReceptionHandler.java @@ -42,7 +42,6 @@ import org.onap.policy.common.logging.flexlogger.Logger; import org.onap.policy.common.parameters.ParameterService; import org.onap.policy.distribution.reception.decoding.PluginInitializationException; import org.onap.policy.distribution.reception.decoding.PluginTerminationException; -import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup; import org.onap.sdc.api.results.IDistributionClientResult; import org.onap.sdc.impl.mock.DistributionClientStubImpl; import org.onap.sdc.utils.DistributionActionResultEnum; @@ -64,7 +63,7 @@ public class TestSdcReceptionHandler { @Mock private DistributionClientStubImpl distributionClient; - private PssdConfigurationParametersGroup pssdConfigParameters; + private SdcReceptionHandlerConfigurationParameterGroup pssdConfigParameters; private SdcReceptionHandler sypHandler; /** @@ -76,7 +75,7 @@ public class TestSdcReceptionHandler { public final void init() throws IOException { final Gson gson = new GsonBuilder().create(); pssdConfigParameters = gson.fromJson(new FileReader("src/test/resources/handling-sdc.json"), - PssdConfigurationParametersGroup.class); + SdcReceptionHandlerConfigurationParameterGroup.class); ParameterService.register(pssdConfigParameters); final SdcReceptionHandler sdcHandler = new SdcReceptionHandler(); sypHandler = Mockito.spy(sdcHandler); -- cgit 1.2.3-korg