summaryrefslogtreecommitdiffstats
path: root/main/src/test
diff options
context:
space:
mode:
authormmis <michael.morris@ericsson.com>2018-09-05 17:12:03 +0100
committermmis <michael.morris@ericsson.com>2018-09-05 17:34:25 +0100
commit0089e8bc429001eca2997b44168b05889cb75d38 (patch)
tree943152987d7aa192fa35bdd76db713bec2463d55 /main/src/test
parent461cafda67a99f4cc27ea41539d1748b6c87a79c (diff)
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 <michael.morris@ericsson.com>
Diffstat (limited to 'main/src/test')
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java38
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/parameters/TestDistributionParameterGroup.java156
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/parameters/TestReceptionHandlerParameters.java85
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyReceptionHandlerParameterGroup.java98
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json10
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidDecoderAndForwarderParameters.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidForwarderConfigurationClassName.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerParameters.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerParameters.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json35
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json10
-rw-r--r--main/src/test/resources/parameters/DistributionConfigParameters_UnknownForwarderConfigurationClassName.json10
-rw-r--r--main/src/test/resources/parameters/MinimumParameters.json35
18 files changed, 402 insertions, 390 deletions
diff --git a/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java b/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java
index 186aa821..b1903152 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/parameters/CommonTestData.java
@@ -27,9 +27,11 @@ import java.util.Map;
import org.onap.policy.distribution.forwarding.parameters.PolicyForwarderParameters;
import org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup;
import org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup.DummyPolicyForwarderParameterGroupBuilder;
+import org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup;
+import org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup.DummyReceptionHandlerParameterGroupBuilder;
import org.onap.policy.distribution.reception.parameters.PluginHandlerParameters;
import org.onap.policy.distribution.reception.parameters.PolicyDecoderParameters;
-import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerParameters;
/**
@@ -54,6 +56,11 @@ public class CommonTestData {
public static final String RECEPTION_HANDLER_TYPE = "DummyReceptionHandler";
public static final String RECEPTION_HANDLER_CLASS_NAME =
"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler";
+ public static final String RECEPTION_CONFIGURATION_PARAMETERS = "dummyReceptionHandlerConfiguration";
+ public static final String MY_STRING_PARAMETER_VALUE = "aStringValue";
+ public static final Boolean MY_BOOLEAN_PARAMETER_VALUE = true;
+ public static final int MY_INTEGER_PARAMETER_VALUE = 1234;
+
public static final String DUMMY_RECEPTION_HANDLER_KEY = "DummyReceptionHandler";
public static final String DUMMY_ENGINE_FORWARDER_KEY = "DummyForwarder";
public static final String DUMMY_DECODER_KEY = "DummyDecoder";
@@ -87,38 +94,37 @@ public class CommonTestData {
if (!isEmpty) {
final Map<String, PolicyDecoderParameters> policyDecoders = getPolicyDecoders(isEmpty);
final Map<String, PolicyForwarderParameters> policyForwarders = getPolicyForwarders(isEmpty);
- final PssdConfigurationParametersGroup pssdConfiguration = getPssdConfigurationParametersGroup(isEmpty);;
final PluginHandlerParameters pHParameters = new PluginHandlerParameters(policyDecoders, policyForwarders);
final ReceptionHandlerParameters rhParameters = new ReceptionHandlerParameters(RECEPTION_HANDLER_TYPE,
- RECEPTION_HANDLER_CLASS_NAME, pssdConfiguration, pHParameters);
+ RECEPTION_HANDLER_CLASS_NAME, RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
receptionHandlerParameters.put(DUMMY_RECEPTION_HANDLER_KEY, rhParameters);
}
return receptionHandlerParameters;
}
/**
- * Returns an instance of PssdConfigurationParametersGroup for test cases.
+ * Returns ReceptionHandlerConfigurationParameterGroups for test cases.
*
* @param isEmpty boolean value to represent that object created should be empty or not
- * @return the PssdConfigurationParametersGroup object
+ * @return the ReceptionHandlerConfigurationParameterGroups
*/
- public PssdConfigurationParametersGroup getPssdConfigurationParametersGroup(final boolean isEmpty) {
- final PssdConfigurationParametersGroup pssdConfiguration;
+ public Map<String, ReceptionHandlerConfigurationParameterGroup> getReceptionHandlerConfigurationParameters(
+ final boolean isEmpty) {
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurationParameters =
+ new HashMap<String, ReceptionHandlerConfigurationParameterGroup>();
if (!isEmpty) {
final List<String> messageBusAddress = new ArrayList<>();
messageBusAddress.add("localhost");
final List<String> artifactTypes = new ArrayList<>();
artifactTypes.add("TOSCA_CSAR");
- pssdConfiguration = new PssdConfigurationParametersGroup.PssdConfigurationBuilder()
- .setAsdcAddress("localhost").setMessageBusAddress(messageBusAddress).setUser("policy")
- .setPassword("policy").setPollingInterval(20).setPollingTimeout(30).setConsumerId("policy-id")
- .setArtifactTypes(artifactTypes).setConsumerGroup("policy-group").setEnvironmentName("TEST")
- .setKeystorePath("").setKeystorePassword("").setActiveserverTlsAuth(false)
- .setIsFilterinEmptyResources(true).setIsUseHttpsWithDmaap(false).build();
- } else {
- pssdConfiguration = new PssdConfigurationParametersGroup.PssdConfigurationBuilder().build();
+ DummyReceptionHandlerParameterGroup dummyReceptionHandlerParameterGroup =
+ new DummyReceptionHandlerParameterGroupBuilder().setMyStringParameter(MY_STRING_PARAMETER_VALUE)
+ .setMyIntegerParameter(MY_INTEGER_PARAMETER_VALUE)
+ .setMyBooleanParameter(MY_BOOLEAN_PARAMETER_VALUE).build();
+ receptionHandlerConfigurationParameters.put(RECEPTION_CONFIGURATION_PARAMETERS,
+ dummyReceptionHandlerParameterGroup);
}
- return pssdConfiguration;
+ return receptionHandlerConfigurationParameters;
}
/**
diff --git a/main/src/test/java/org/onap/policy/distribution/main/parameters/TestDistributionParameterGroup.java b/main/src/test/java/org/onap/policy/distribution/main/parameters/TestDistributionParameterGroup.java
index 0c8c80d6..2df1cd47 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/parameters/TestDistributionParameterGroup.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/parameters/TestDistributionParameterGroup.java
@@ -29,6 +29,8 @@ import java.util.Map;
import org.junit.Test;
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup;
+import org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerParameters;
/**
@@ -42,36 +44,50 @@ public class TestDistributionParameterGroup {
@Test
public void testDistributionParameterGroup() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(false);
- final Map<String, ReceptionHandlerParameters> receptionHandlerParameters = commonTestData
- .getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerParameters> receptionHandlerParameters =
+ commonTestData.getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
final DistributionParameterGroup distributionParameters =
new DistributionParameterGroup(CommonTestData.DISTRIBUTION_GROUP_NAME, restServerParameters,
- receptionHandlerParameters, forwarderConfigurations);
+ receptionHandlerParameters, receptionHandlerConfigurations, forwarderConfigurations);
final GroupValidationResult validationResult = distributionParameters.validate();
assertTrue(validationResult.isValid());
assertEquals(restServerParameters.getHost(), distributionParameters.getRestServerParameters().getHost());
assertEquals(restServerParameters.getPort(), distributionParameters.getRestServerParameters().getPort());
assertEquals(restServerParameters.getUserName(),
- distributionParameters.getRestServerParameters().getUserName());
+ distributionParameters.getRestServerParameters().getUserName());
assertEquals(restServerParameters.getPassword(),
- distributionParameters.getRestServerParameters().getPassword());
+ distributionParameters.getRestServerParameters().getPassword());
assertEquals(CommonTestData.DISTRIBUTION_GROUP_NAME, distributionParameters.getName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerType(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerType());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
.getReceptionHandlerClassName(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerClassName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getPluginHandlerParameters(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters());
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerClassName());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getPluginHandlerParameters());
+ assertEquals(CommonTestData.MY_STRING_PARAMETER_VALUE,
+ ((DummyReceptionHandlerParameterGroup) distributionParameters
+ .getReceptionHandlerConfigurationParameters()
+ .get(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS)).getMyStringParameter());
+ assertEquals(CommonTestData.MY_INTEGER_PARAMETER_VALUE,
+ ((DummyReceptionHandlerParameterGroup) distributionParameters
+ .getReceptionHandlerConfigurationParameters()
+ .get(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS)).getMyIntegerParameter());
+ assertEquals(CommonTestData.MY_BOOLEAN_PARAMETER_VALUE,
+ ((DummyReceptionHandlerParameterGroup) distributionParameters
+ .getReceptionHandlerConfigurationParameters()
+ .get(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS)).getMyBooleanParameter());
assertEquals(CommonTestData.FORWARDER_HOST,
((DummyPolicyForwarderParameterGroup) distributionParameters.getPolicyForwarderConfigurationParameters()
.get(CommonTestData.FORWARDER_CONFIGURATION_PARAMETERS)).getHostname());
@@ -80,72 +96,80 @@ public class TestDistributionParameterGroup {
@Test
public void testDistributionParameterGroup_NullName() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(false);
- final Map<String, ReceptionHandlerParameters> receptionHandlerParameters = commonTestData
- .getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerParameters> receptionHandlerParameters =
+ commonTestData.getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
- final DistributionParameterGroup distributionParameters = new DistributionParameterGroup(null,
- restServerParameters, receptionHandlerParameters, forwarderConfigurations);
+ final DistributionParameterGroup distributionParameters =
+ new DistributionParameterGroup(null, restServerParameters, receptionHandlerParameters,
+ receptionHandlerConfigurations, forwarderConfigurations);
final GroupValidationResult validationResult = distributionParameters.validate();
assertFalse(validationResult.isValid());
assertEquals(null, distributionParameters.getName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerType(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerType());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
.getReceptionHandlerClassName(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerClassName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getPluginHandlerParameters(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters());
- assertTrue(validationResult.getResult()
- .contains("field \"name\" type \"java.lang.String\" value \"null\" INVALID, "
- + "must be a non-blank string"));
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerClassName());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getPluginHandlerParameters());
+ assertTrue(validationResult.getResult().contains(
+ "field \"name\" type \"java.lang.String\" value \"null\" INVALID, " + "must be a non-blank string"));
}
@Test
public void testDistributionParameterGroup_EmptyName() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(false);
- final Map<String, ReceptionHandlerParameters> receptionHandlerParameters = commonTestData
- .getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerParameters> receptionHandlerParameters =
+ commonTestData.getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
- final DistributionParameterGroup distributionParameters = new DistributionParameterGroup("",
- restServerParameters, receptionHandlerParameters, forwarderConfigurations);
+ final DistributionParameterGroup distributionParameters =
+ new DistributionParameterGroup("", restServerParameters, receptionHandlerParameters,
+ receptionHandlerConfigurations, forwarderConfigurations);
final GroupValidationResult validationResult = distributionParameters.validate();
assertFalse(validationResult.isValid());
assertEquals("", distributionParameters.getName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerType(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getReceptionHandlerType(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerType());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
.getReceptionHandlerClassName(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getReceptionHandlerClassName());
- assertEquals(receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
- .getPluginHandlerParameters(),
- distributionParameters.getReceptionHandlerParameters()
- .get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters());
- assertTrue(validationResult.getResult().contains("field \"name\" type \"java.lang.String\" value \"\" INVALID, "
- + "must be a non-blank string"));
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getReceptionHandlerClassName());
+ assertEquals(
+ receptionHandlerParameters.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters(),
+ distributionParameters.getReceptionHandlerParameters().get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY)
+ .getPluginHandlerParameters());
+ assertTrue(validationResult.getResult().contains(
+ "field \"name\" type \"java.lang.String\" value \"\" INVALID, " + "must be a non-blank string"));
}
@Test
public void testDistributionParameterGroup_NullReceptionHandlerParameters() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(false);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
try {
- final DistributionParameterGroup distributionParameters = new DistributionParameterGroup(
- CommonTestData.DISTRIBUTION_GROUP_NAME, restServerParameters, null, forwarderConfigurations);
+ final DistributionParameterGroup distributionParameters =
+ new DistributionParameterGroup(CommonTestData.DISTRIBUTION_GROUP_NAME, restServerParameters, null,
+ receptionHandlerConfigurations, forwarderConfigurations);
distributionParameters.validate();
fail("test should throw an exception here");
} catch (final Exception e) {
@@ -157,13 +181,15 @@ public class TestDistributionParameterGroup {
@Test
public void testDistributionParameterGroup_EmptyReceptionHandlerParameters() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(false);
- final Map<String, ReceptionHandlerParameters> receptionHandlerParameters = commonTestData
- .getReceptionHandlerParameters(true);
+ final Map<String, ReceptionHandlerParameters> receptionHandlerParameters =
+ commonTestData.getReceptionHandlerParameters(true);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
final DistributionParameterGroup distributionParameters =
new DistributionParameterGroup(CommonTestData.DISTRIBUTION_GROUP_NAME, restServerParameters,
- receptionHandlerParameters, forwarderConfigurations);
+ receptionHandlerParameters, receptionHandlerConfigurations, forwarderConfigurations);
distributionParameters.validate();
GroupValidationResult result = distributionParameters.validate();
assertFalse(result.isValid());
@@ -173,18 +199,20 @@ public class TestDistributionParameterGroup {
@Test
public void testDistributionParameterGroup_EmptyRestServerParameters() {
final RestServerParameters restServerParameters = commonTestData.getRestServerParameters(true);
- final Map<String, ReceptionHandlerParameters> receptionHandlerParameters = commonTestData
- .getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerParameters> receptionHandlerParameters =
+ commonTestData.getReceptionHandlerParameters(false);
+ final Map<String, ReceptionHandlerConfigurationParameterGroup> receptionHandlerConfigurations =
+ commonTestData.getReceptionHandlerConfigurationParameters(false);
final Map<String, PolicyForwarderConfigurationParameterGroup> forwarderConfigurations =
commonTestData.getPolicyForwarderConfigurationParameters(false);
final DistributionParameterGroup distributionParameters =
new DistributionParameterGroup(CommonTestData.DISTRIBUTION_GROUP_NAME, restServerParameters,
- receptionHandlerParameters, forwarderConfigurations);
+ receptionHandlerParameters, receptionHandlerConfigurations, forwarderConfigurations);
final GroupValidationResult validationResult = distributionParameters.validate();
assertFalse(validationResult.isValid());
assertTrue(validationResult.getResult()
- .contains("\"org.onap.policy.distribution.main.parameters.RestServerParameters\" INVALID, "
- + "parameter group has status INVALID"));
+ .contains("\"org.onap.policy.distribution.main.parameters.RestServerParameters\" INVALID, "
+ + "parameter group has status INVALID"));
}
}
diff --git a/main/src/test/java/org/onap/policy/distribution/main/parameters/TestReceptionHandlerParameters.java b/main/src/test/java/org/onap/policy/distribution/main/parameters/TestReceptionHandlerParameters.java
index ab86cb65..2dde9666 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/parameters/TestReceptionHandlerParameters.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/parameters/TestReceptionHandlerParameters.java
@@ -27,7 +27,6 @@ import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.onap.policy.common.parameters.GroupValidationResult;
import org.onap.policy.distribution.reception.parameters.PluginHandlerParameters;
-import org.onap.policy.distribution.reception.parameters.PssdConfigurationParametersGroup;
import org.onap.policy.distribution.reception.parameters.ReceptionHandlerParameters;
/**
@@ -41,15 +40,14 @@ public class TestReceptionHandlerParameters {
@Test
public void testReceptionHandlerParameters() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(
- CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
- pssdConfiguration, pHParameters);
+ CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals(CommonTestData.RECEPTION_HANDLER_TYPE, rHParameters.getReceptionHandlerType());
assertEquals(CommonTestData.RECEPTION_HANDLER_CLASS_NAME, rHParameters.getReceptionHandlerClassName());
- assertEquals(pssdConfiguration, rHParameters.getPssdConfigurationParametersGroup());
+ assertEquals(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS,
+ rHParameters.getReceptionHandlerConfigurationName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertTrue(validationResult.isValid());
}
@@ -57,84 +55,79 @@ public class TestReceptionHandlerParameters {
@Test
public void testReceptionHandlerParameters_NullReceptionHandlerType() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
- final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(null,
- CommonTestData.RECEPTION_HANDLER_CLASS_NAME, pssdConfiguration, pHParameters);
+ final ReceptionHandlerParameters rHParameters =
+ new ReceptionHandlerParameters(null, CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals(null, rHParameters.getReceptionHandlerType());
assertEquals(CommonTestData.RECEPTION_HANDLER_CLASS_NAME, rHParameters.getReceptionHandlerClassName());
- assertEquals(pssdConfiguration, rHParameters.getPssdConfigurationParametersGroup());
+ assertEquals(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS,
+ rHParameters.getReceptionHandlerConfigurationName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertFalse(validationResult.isValid());
assertTrue(validationResult.getResult()
- .contains("field \"receptionHandlerType\" type \"java.lang.String\" value \"null\" INVALID, "
- + "must be a non-blank string"));
+ .contains("field \"receptionHandlerType\" type \"java.lang.String\" value \"null\" INVALID, "
+ + "must be a non-blank string"));
}
@Test
public void testReceptionHandlerParameters_NullReceptionHandlerClassName() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
- final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(
- CommonTestData.RECEPTION_HANDLER_TYPE, null, pssdConfiguration, pHParameters);
+ final ReceptionHandlerParameters rHParameters =
+ new ReceptionHandlerParameters(CommonTestData.RECEPTION_HANDLER_TYPE, null,
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals(CommonTestData.RECEPTION_HANDLER_TYPE, rHParameters.getReceptionHandlerType());
assertEquals(null, rHParameters.getReceptionHandlerClassName());
- assertEquals(pssdConfiguration, rHParameters.getPssdConfigurationParametersGroup());
+ assertEquals(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS,
+ rHParameters.getReceptionHandlerConfigurationName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertFalse(validationResult.isValid());
- assertTrue(validationResult.getResult().contains(
- "field \"receptionHandlerClassName\" type \"java.lang.String\" value \"null\" INVALID, "
- + "must be a non-blank string containing full class name "
- + "of the reception handler"));
+ assertTrue(validationResult.getResult()
+ .contains("field \"receptionHandlerClassName\" type \"java.lang.String\" value \"null\" INVALID, "
+ + "must be a non-blank string containing full class name " + "of the reception handler"));
}
@Test
public void testReceptionHandlerParameters_EmptyReceptionHandlerType() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
- final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters("",
- CommonTestData.RECEPTION_HANDLER_CLASS_NAME, pssdConfiguration, pHParameters);
+ final ReceptionHandlerParameters rHParameters =
+ new ReceptionHandlerParameters("", CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals("", rHParameters.getReceptionHandlerType());
assertEquals(CommonTestData.RECEPTION_HANDLER_CLASS_NAME, rHParameters.getReceptionHandlerClassName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertFalse(validationResult.isValid());
assertTrue(validationResult.getResult()
- .contains("field \"receptionHandlerType\" type \"java.lang.String\" value \"\" INVALID, "
- + "must be a non-blank string"));
+ .contains("field \"receptionHandlerType\" type \"java.lang.String\" value \"\" INVALID, "
+ + "must be a non-blank string"));
}
@Test
public void testReceptionHandlerParameters_EmptyReceptionHandlerClassName() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
- final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(
- CommonTestData.RECEPTION_HANDLER_TYPE, "", pssdConfiguration, pHParameters);
+ final ReceptionHandlerParameters rHParameters =
+ new ReceptionHandlerParameters(CommonTestData.RECEPTION_HANDLER_TYPE, "",
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals(CommonTestData.RECEPTION_HANDLER_TYPE, rHParameters.getReceptionHandlerType());
assertEquals("", rHParameters.getReceptionHandlerClassName());
- assertEquals(pssdConfiguration, rHParameters.getPssdConfigurationParametersGroup());
+ assertEquals(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS,
+ rHParameters.getReceptionHandlerConfigurationName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertFalse(validationResult.isValid());
assertTrue(validationResult.getResult()
- .contains("field \"receptionHandlerClassName\" type \"java.lang.String\" value \"\" INVALID, "
- + "must be a non-blank string containing full class name "
- + "of the reception handler"));
+ .contains("field \"receptionHandlerClassName\" type \"java.lang.String\" value \"\" INVALID, "
+ + "must be a non-blank string containing full class name " + "of the reception handler"));
}
@Test
public void testReceptionHandlerParameters_EmptyPluginHandler() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(true);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(
- CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
- pssdConfiguration, pHParameters);
+ CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME,
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
GroupValidationResult result = rHParameters.validate();
assertFalse(result.isValid());
assertTrue(result.getResult().endsWith("must have at least one policy forwarder\n"));
@@ -143,16 +136,16 @@ public class TestReceptionHandlerParameters {
@Test
public void testReceptionHandlerParameters_InvalidReceptionHandlerClass() {
final PluginHandlerParameters pHParameters = commonTestData.getPluginHandlerParameters(false);
- final PssdConfigurationParametersGroup pssdConfiguration = commonTestData
- .getPssdConfigurationParametersGroup(false);
+
final ReceptionHandlerParameters rHParameters = new ReceptionHandlerParameters(
- CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME + "Invalid",
- pssdConfiguration, pHParameters);
+ CommonTestData.RECEPTION_HANDLER_TYPE, CommonTestData.RECEPTION_HANDLER_CLASS_NAME + "Invalid",
+ CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS, pHParameters);
final GroupValidationResult validationResult = rHParameters.validate();
assertEquals(CommonTestData.RECEPTION_HANDLER_TYPE, rHParameters.getReceptionHandlerType());
assertEquals(CommonTestData.RECEPTION_HANDLER_CLASS_NAME + "Invalid",
- rHParameters.getReceptionHandlerClassName());
- assertEquals(pssdConfiguration, rHParameters.getPssdConfigurationParametersGroup());
+ rHParameters.getReceptionHandlerClassName());
+ assertEquals(CommonTestData.RECEPTION_CONFIGURATION_PARAMETERS,
+ rHParameters.getReceptionHandlerConfigurationName());
assertEquals(pHParameters, rHParameters.getPluginHandlerParameters());
assertFalse(validationResult.isValid());
assertTrue(validationResult.getResult().contains("reception handler class not found in classpath"));
diff --git a/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyReceptionHandlerParameterGroup.java b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyReceptionHandlerParameterGroup.java
new file mode 100644
index 00000000..d452e96c
--- /dev/null
+++ b/main/src/test/java/org/onap/policy/distribution/main/testclasses/DummyReceptionHandlerParameterGroup.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2018 Ericsson. 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.distribution.main.testclasses;
+
+import org.onap.policy.common.parameters.GroupValidationResult;
+import org.onap.policy.distribution.reception.parameters.ReceptionHandlerConfigurationParameterGroup;
+
+public class DummyReceptionHandlerParameterGroup extends ReceptionHandlerConfigurationParameterGroup {
+
+ private String myStringParameter;
+ private int myIntegerParameter;
+ private boolean myBooleanParameter;
+
+ /**
+ * Inner static class is to used as a Builder.
+ *
+ */
+ public static class DummyReceptionHandlerParameterGroupBuilder {
+ private String myStringParameter;
+ private int myIntegerParameter;
+ private boolean myBooleanParameter;
+
+ public DummyReceptionHandlerParameterGroupBuilder setMyStringParameter(final String val) {
+ myStringParameter = val;
+ return this;
+ }
+
+ public DummyReceptionHandlerParameterGroupBuilder setMyIntegerParameter(final int val) {
+ myIntegerParameter = val;
+ return this;
+ }
+
+ public DummyReceptionHandlerParameterGroupBuilder setMyBooleanParameter(final boolean val) {
+ myBooleanParameter = val;
+ return this;
+ }
+
+ /**
+ * Creates a new DummyReceptionHandlerConfigurationParameterGroup instance.
+ */
+ public DummyReceptionHandlerParameterGroup build() {
+ return new DummyReceptionHandlerParameterGroup(this);
+ }
+ }
+
+ /**
+ * The constructor for instantiating PssdConfigurationParameterGroup. It is kept private so that
+ * it could only be called by PssdConfigurationBuilder.
+ *
+ * @param builder stores all the values used by PssdConfigurationParametersGroup
+ */
+ private DummyReceptionHandlerParameterGroup(final DummyReceptionHandlerParameterGroupBuilder builder) {
+ myStringParameter = builder.myStringParameter;
+ myIntegerParameter = builder.myIntegerParameter;
+ myBooleanParameter = builder.myBooleanParameter;
+ }
+
+ public String getMyStringParameter() {
+ return myStringParameter;
+ }
+
+ public int getMyIntegerParameter() {
+ return myIntegerParameter;
+ }
+
+ public boolean getMyBooleanParameter() {
+ return myBooleanParameter;
+ }
+
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Override
+ public GroupValidationResult validate() {
+ return new GroupValidationResult(this);
+ }
+
+}
+
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters.json b/main/src/test/resources/parameters/DistributionConfigParameters.json
index 7a557624..acf56764 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json
index d11ac9ea..e22af281 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyDecoder.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
},
@@ -47,6 +24,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json
index c534154c..4d271308 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyPolicyForwarder.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -46,6 +23,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json
index b8010f8d..c25b2e35 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_EmptyReceptionHandler.json
@@ -8,6 +8,16 @@
},
"receptionHandlerParameters":{
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidDecoderAndForwarderParameters.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidDecoderAndForwarderParameters.json
index 0c9caa6c..bd52e186 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidDecoderAndForwarderParameters.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidDecoderAndForwarderParameters.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -70,6 +47,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidForwarderConfigurationClassName.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidForwarderConfigurationClassName.json
index ba895a67..60c28e08 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidForwarderConfigurationClassName.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidForwarderConfigurationClassName.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json
index 7cafc266..46207204 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidName.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerParameters.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerParameters.json
index 793702fb..123ff203 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerParameters.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidReceptionHandlerParameters.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.InvalidSdcReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerParameters.json b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerParameters.json
index 0d650331..47528ce0 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerParameters.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_InvalidRestServerParameters.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json
index f9392db5..f78bb65f 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyDecoder.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyForwarders":{
"DummyForwarder":{
@@ -45,6 +22,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json
index 7d9a8af4..3ac54f73 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoPolicyForwarder.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -43,5 +20,15 @@
}
}
}
+ },
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
}
}
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json b/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json
index b91e95d8..7a9ecd15 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_NoReceptionHandler.json
@@ -5,5 +5,15 @@
"port":6969,
"userName":"healthcheck",
"password":"zb!XztG34"
+ },
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
}
} \ No newline at end of file
diff --git a/main/src/test/resources/parameters/DistributionConfigParameters_UnknownForwarderConfigurationClassName.json b/main/src/test/resources/parameters/DistributionConfigParameters_UnknownForwarderConfigurationClassName.json
index c189671d..3118631b 100644
--- a/main/src/test/resources/parameters/DistributionConfigParameters_UnknownForwarderConfigurationClassName.json
+++ b/main/src/test/resources/parameters/DistributionConfigParameters_UnknownForwarderConfigurationClassName.json
@@ -51,6 +51,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.Unknown",
diff --git a/main/src/test/resources/parameters/MinimumParameters.json b/main/src/test/resources/parameters/MinimumParameters.json
index 1b797def..fc6b16aa 100644
--- a/main/src/test/resources/parameters/MinimumParameters.json
+++ b/main/src/test/resources/parameters/MinimumParameters.json
@@ -10,30 +10,7 @@
"DummyReceptionHandler":{
"receptionHandlerType":"DummyReceptionHandler",
"receptionHandlerClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandler",
- "pssdConfiguration":{
- "asdcAddress": "localhost",
- "messageBusAddress": [
- "a.com",
- "b.com",
- "c.com"
- ],
- "user": "tbdsdc-1480",
- "password": "tbdsdc-1480",
- "pollingInterval":20,
- "pollingTimeout":30,
- "consumerId": "policy-id",
- "artifactTypes": [
- "TOSCA_CSAR",
- "HEAT"
- ],
- "consumerGroup": "policy-group",
- "environmentName": "environmentName",
- "keystorePath": "null",
- "keystorePassword": "null",
- "activeserverTlsAuth": false,
- "isFilterinEmptyResources": true,
- "isUseHttpsWithDmaap": false
- },
+ "receptionHandlerConfigurationName":"dummyReceptionHandlerConfiguration",
"pluginHandlerParameters":{
"policyDecoders":{
"DummyDecoder":{
@@ -51,6 +28,16 @@
}
}
},
+ "receptionHandlerConfigurationParameters":{
+ "dummyReceptionHandlerConfiguration":{
+ "parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyReceptionHandlerParameterGroup",
+ "parameters":{
+ "myStringParameter": "stringValue",
+ "myIntegerParameter":20,
+ "myBooleanParameter": true
+ }
+ }
+ },
"policyForwarderConfigurationParameters":{
"dummyConfiguration":{
"parameterClassName":"org.onap.policy.distribution.main.testclasses.DummyPolicyForwarderParameterGroup",