aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@est.tech>2019-07-01 14:50:01 +0000
committera.sreekumar <ajith.sreekumar@est.tech>2019-07-01 14:50:01 +0000
commit9ef4186f69ef694e6251161622a33d7bc1400f39 (patch)
tree054b74bdc1699e85555e65c2341265c6daf2b758 /main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java
parentd848416090efd6850ab25011d8518b15525a1bdb (diff)
Remove topic.properties and incorporate into overall config file
1) The properties in the topic.properties file is moved into overall config json file and the topic.properties file is removed. 2) Common parameters such as RestServer and Topic related parameters from policy-common is used. Change-Id: I390bbe3cda101a69e7ce614404ecdfbf98598dd2 Issue-ID: POLICY-1744 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java
index f15b2a04..cadae12b 100644
--- a/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java
+++ b/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java
@@ -26,8 +26,6 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import java.io.File;
-import java.io.FileInputStream;
import java.util.Properties;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Semaphore;
@@ -40,14 +38,17 @@ import org.junit.Test;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
import org.onap.policy.common.endpoints.event.comm.TopicListener;
+import org.onap.policy.common.endpoints.utils.ParameterUtils;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
-import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.pdp.concepts.PdpMessage;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.pap.main.PapConstants;
import org.onap.policy.pap.main.PolicyPapException;
+import org.onap.policy.pap.main.parameters.PapParameterGroup;
+import org.onap.policy.pap.main.parameters.PapParameterHandler;
+import org.onap.policy.pap.main.startstop.PapCommandLineArguments;
public class PublisherTest extends Threaded {
@@ -86,12 +87,10 @@ public class PublisherTest extends Threaded {
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
- Properties props = new Properties();
- File propFile = new File(ResourceUtils.getFilePath4Resource("parameters/topic.properties"));
- try (FileInputStream inp = new FileInputStream(propFile)) {
- props.load(inp);
- }
-
+ final String[] papConfigParameters = {"-c", "parameters/PapConfigParameters.json"};
+ final PapCommandLineArguments arguments = new PapCommandLineArguments(papConfigParameters);
+ final PapParameterGroup parameterGroup = new PapParameterHandler().getParameters(arguments);
+ Properties props = ParameterUtils.getTopicProperties(parameterGroup.getTopicParameterGroup());
TopicEndpoint.manager.shutdown();
TopicEndpoint.manager.addTopics(props);