aboutsummaryrefslogtreecommitdiffstats
path: root/services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpStateChangeListener.java
diff options
context:
space:
mode:
Diffstat (limited to 'services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpStateChangeListener.java')
-rw-r--r--services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpStateChangeListener.java17
1 files changed, 6 insertions, 11 deletions
diff --git a/services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpStateChangeListener.java b/services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpStateChangeListener.java
index c6ed44556..fc7bd8fb2 100644
--- a/services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpStateChangeListener.java
+++ b/services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpStateChangeListener.java
@@ -22,7 +22,6 @@ package org.onap.policy.apex.services.onappf.comm;
import static org.junit.Assert.assertEquals;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@@ -44,6 +43,7 @@ import org.onap.policy.apex.services.onappf.exception.ApexStarterException;
import org.onap.policy.apex.services.onappf.parameters.ApexStarterParameterGroup;
import org.onap.policy.apex.services.onappf.parameters.ApexStarterParameterHandler;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
+import org.onap.policy.common.endpoints.utils.ParameterUtils;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.pdp.concepts.PdpStatus;
@@ -75,10 +75,9 @@ public class TestPdpStateChangeListener {
pdpUpdateMessageListener = new PdpUpdateListener();
pdpStateChangeListener = new PdpStateChangeListener();
Registry.newRegistry();
- final String[] apexStarterConfigParameters = { "-c", "src/test/resources/ApexStarterConfigParameters.json",
- "-p", "src/test/resources/topic.properties" };
+ final String[] apexStarterConfigParameters = { "-c", "src/test/resources/ApexStarterConfigParameters.json" };
final ApexStarterCommandLineArguments arguments = new ApexStarterCommandLineArguments();
- ApexStarterParameterGroup apexStarterParameterGroup;
+ ApexStarterParameterGroup parameterGroup;
// The arguments return a string if there is a message to print and we should
// exit
final String argumentMessage = arguments.parse(apexStarterConfigParameters);
@@ -89,15 +88,11 @@ public class TestPdpStateChangeListener {
arguments.validate();
// Read the parameters
- apexStarterParameterGroup = new ApexStarterParameterHandler().getParameters(arguments);
+ parameterGroup = new ApexStarterParameterHandler().getParameters(arguments);
// Read the properties
- final Properties topicProperties = new Properties();
- final String propFile = arguments.getFullPropertyFilePath();
- try (FileInputStream stream = new FileInputStream(propFile)) {
- topicProperties.load(stream);
- }
- activator = new ApexStarterActivator(apexStarterParameterGroup, topicProperties);
+ Properties topicProperties = ParameterUtils.getTopicProperties(parameterGroup.getTopicParameterGroup());
+ activator = new ApexStarterActivator(parameterGroup, topicProperties);
Registry.register(ApexStarterConstants.REG_APEX_STARTER_ACTIVATOR, activator);
activator.initialize();
}