Remove topic.properties and incorporate into overall properties 58/90658/1
authora.sreekumar <ajith.sreekumar@est.tech>
Fri, 28 Jun 2019 11:36:58 +0000 (11:36 +0000)
committera.sreekumar <ajith.sreekumar@est.tech>
Fri, 28 Jun 2019 11:36:58 +0000 (11:36 +0000)
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: Ifc25185c8f717c95a226b2db25c1a8e96b9bbff9
Issue-ID: POLICY-1744
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
20 files changed:
pom.xml
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterCommandLineArguments.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterMain.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/ApexStarterParameterGroup.java
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/RestServerParameters.java [deleted file]
services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/ApexStarterRestServer.java
services/services-onappf/src/main/resources/config/OnapPfConfig.json
services/services-onappf/src/main/resources/config/topic.properties [deleted file]
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/TestApexStarterActivator.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/TestApexStarterMain.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpStateChangeListener.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/comm/TestPdpUpdateListener.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/parameters/CommonTestData.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/parameters/TestApexStarterParameterGroup.java
services/services-onappf/src/test/java/org/onap/policy/apex/services/onappf/rest/CommonApexStarterRestServer.java
services/services-onappf/src/test/resources/ApexStarterConfigParameters.json
services/services-onappf/src/test/resources/ApexStarterConfigParameters_sim.json
services/services-onappf/src/test/resources/TestConfigParameters.json
services/services-onappf/src/test/resources/topic.properties [deleted file]
services/services-onappf/src/test/resources/topic_sim.properties [deleted file]

diff --git a/pom.xml b/pom.xml
index b4e25d7..99e6069 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -44,7 +44,7 @@
         <version.kafka>1.1.1</version.kafka>
         <version.jersey>2.26</version.jersey>
         <version.hibernate>5.3.7.Final</version.hibernate>
-        <version.policy.common>1.5.0</version.policy.common>
+        <version.policy.common>1.5.1-SNAPSHOT</version.policy.common>
         <version.policy.models>2.1.0</version.policy.models>
         <!-- sonar/jacoco overrides -->
         <!-- Overriding oparent default sonar/jacoco settings Combine all our reports
index 3697374..6f57859 100644 (file)
@@ -163,7 +163,6 @@ public class ApexStarterCommandLineArguments {
      */
     public void validate() throws ApexStarterException {
         validateReadableFile("apex starter configuration", configurationFilePath);
-        validateReadableFile("apex starter properties", propertyFilePath);
     }
 
     /**
index 4813eb3..dcd7972 100644 (file)
 
 package org.onap.policy.apex.services.onappf;
 
-import java.io.FileInputStream;
 import java.util.Arrays;
 import java.util.Properties;
-
 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.utils.ParameterUtils;
 import org.onap.policy.common.utils.services.Registry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -78,16 +77,7 @@ public class ApexStarterMain {
         }
 
         // Read the properties
-        final Properties topicProperties = new Properties();
-        try {
-            final String propFile = arguments.getFullPropertyFilePath();
-            try (FileInputStream stream = new FileInputStream(propFile)) {
-                topicProperties.load(stream);
-            }
-        } catch (final Exception e) {
-            LOGGER.error(APEX_STARTER_FAIL_MSG, e);
-            return;
-        }
+        Properties topicProperties = ParameterUtils.getTopicProperties(parameterGroup.getTopicParameterGroup());
 
         // create the activator
         activator = new ApexStarterActivator(parameterGroup, topicProperties);
index db51803..1d1b247 100644 (file)
@@ -21,7 +21,8 @@
 package org.onap.policy.apex.services.onappf.parameters;
 
 import lombok.Getter;
-
+import org.onap.policy.common.endpoints.parameters.RestServerParameters;
+import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
 import org.onap.policy.common.parameters.ParameterGroupImpl;
 import org.onap.policy.common.parameters.annotations.NotBlank;
 import org.onap.policy.common.parameters.annotations.NotNull;
@@ -37,7 +38,7 @@ import org.onap.policy.common.parameters.annotations.NotNull;
 public class ApexStarterParameterGroup extends ParameterGroupImpl {
     private RestServerParameters restServerParameters;
     private PdpStatusParameters pdpStatusParameters;
-
+    private TopicParameterGroup topicParameterGroup;
     /**
      * Create the apex starter parameter group.
      *
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/RestServerParameters.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/parameters/RestServerParameters.java
deleted file mode 100644 (file)
index fafca0c..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.apex.services.onappf.parameters;
-
-import lombok.Getter;
-
-import org.onap.policy.common.parameters.ParameterGroupImpl;
-import org.onap.policy.common.parameters.annotations.Min;
-import org.onap.policy.common.parameters.annotations.NotBlank;
-import org.onap.policy.common.parameters.annotations.NotNull;
-
-/**
- * Class to hold all parameters needed for services-onappf rest server.
- *
- * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
- */
-@NotNull
-@NotBlank
-@Getter
-public class RestServerParameters extends ParameterGroupImpl {
-    private String host;
-
-    @Min(value = 1)
-    private int port;
-
-    private String userName;
-    private String password;
-    private boolean https;
-    private boolean aaf;
-
-    public RestServerParameters() {
-        super("RestServerParameters");
-    }
-}
index 3f2ca72..ba5585b 100644 (file)
@@ -24,9 +24,9 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
-import org.onap.policy.apex.services.onappf.parameters.RestServerParameters;
 import org.onap.policy.common.capabilities.Startable;
 import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.parameters.RestServerParameters;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
 import org.onap.policy.common.gson.GsonMessageBodyHandler;
 import org.slf4j.Logger;
index 22e544a..95e28a3 100644 (file)
         "pdpType":"apex",
         "description":"Pdp Heartbeat",
         "supportedPolicyTypes":[{"name":"onap.policies.controlloop.operational.Apex","version":"1.0.0"}]
+    },
+    "topicParameterGroup": {
+        "topicSources" : [{
+            "topic" : "POLICY-PDP-PAP",
+            "servers" : [ "message-router" ],
+            "topicCommInfrastructure" : "dmaap"
+        }],
+        "topicSinks" : [{
+            "topic" : "POLICY-PDP-PAP",
+            "servers" : [ "message-router" ],
+            "topicCommInfrastructure" : "dmaap"
+        }]
     }
 }
\ No newline at end of file
diff --git a/services/services-onappf/src/main/resources/config/topic.properties b/services/services-onappf/src/main/resources/config/topic.properties
deleted file mode 100644 (file)
index b61626b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# ============LICENSE_START=======================================================
-# Copyright (C) 2019 Nordix Foundation.
-# ================================================================================
-# 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=========================================================
-
-dmaap.source.topics=POLICY-PDP-PAP
-dmaap.sink.topics=POLICY-PDP-PAP
-
-dmaap.source.topics.POLICY-PDP-PAP.servers= message-router
-dmaap.sink.topics.POLICY-PDP-PAP.servers= message-router
\ No newline at end of file
index 238a89f..e4dd3d9 100644 (file)
@@ -27,7 +27,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.io.FileInputStream;
 import java.util.Properties;
 
 import org.junit.After;
@@ -40,6 +39,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.apex.services.onappf.parameters.CommonTestData;
+import org.onap.policy.common.endpoints.utils.ParameterUtils;
 import org.onap.policy.common.utils.services.Registry;
 import org.onap.policy.models.pdp.concepts.PdpStatus;
 
@@ -60,19 +60,12 @@ public class TestApexStarterActivator {
     @Before
     public void setUp() throws Exception {
         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(apexStarterConfigParameters);
         final ApexStarterParameterGroup parGroup = new ApexStarterParameterHandler().getParameters(arguments);
-
-        final Properties props = new Properties();
-        final String propFile = arguments.getFullPropertyFilePath();
-        try (FileInputStream stream = new FileInputStream(propFile)) {
-            props.load(stream);
-        }
-
-        activator = new ApexStarterActivator(parGroup, props);
+        Properties topicProperties = ParameterUtils.getTopicProperties(parGroup.getTopicParameterGroup());
+        activator = new ApexStarterActivator(parGroup, topicProperties);
     }
 
     /**
index 31c994c..68d3025 100644 (file)
@@ -67,8 +67,7 @@ public class TestApexStarterMain {
 
     @Test
     public void testApexStarter() throws ApexStarterException {
-        final String[] apexStarterConfigParameters = { "-c", "src/test/resources/ApexStarterConfigParameters.json",
-            "-p", "src/test/resources/topic.properties" };
+        final String[] apexStarterConfigParameters = { "-c", "src/test/resources/ApexStarterConfigParameters.json"};
         apexStarter = new ApexStarterMain(apexStarterConfigParameters);
         assertTrue(apexStarter.getParameters().isValid());
         assertEquals(CommonTestData.APEX_STARTER_GROUP_NAME, apexStarter.getParameters().getName());
index c6ed445..fc7bd8f 100644 (file)
@@ -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();
     }
index ebe0fc9..98ca3eb 100644 (file)
@@ -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;
@@ -45,6 +44,7 @@ import org.onap.policy.apex.services.onappf.handler.PdpMessageHandler;
 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.PdpStatus;
 import org.onap.policy.models.pdp.concepts.PdpUpdate;
@@ -71,10 +71,9 @@ public class TestPdpUpdateListener {
     @Before
     public void setUp() throws ApexStarterException, FileNotFoundException, IOException {
         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);
@@ -85,15 +84,11 @@ public class TestPdpUpdateListener {
         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();
         pdpUpdateMessageListener = new PdpUpdateListener();
index 7e668e9..c8d61f5 100644 (file)
@@ -24,7 +24,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-
+import org.onap.policy.common.endpoints.parameters.TopicParameters;
 import org.onap.policy.common.parameters.ParameterGroup;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
@@ -47,6 +47,7 @@ public class CommonTestData {
     public static final String POLICY_VERSION = "0.0.1";
     public static final List<ToscaPolicyTypeIdentifierParameters> SUPPORTED_POLICY_TYPES =
             Arrays.asList(getSupportedPolicyTypes(POLICY_NAME, POLICY_VERSION));
+    public static final List<TopicParameters> TOPIC_PARAMS = Arrays.asList(getTopicParams());
     private static final String REST_SERVER_PASSWORD = "zb!XztG34";
     private static final String REST_SERVER_USER = "healthcheck";
     private static final int REST_SERVER_PORT = 6969;
@@ -68,6 +69,19 @@ public class CommonTestData {
         return policyTypeIdentParameters;
     }
 
+    /**
+     * Returns topic parameters for test cases.
+     *
+     * @return topic parameters
+     */
+    public static TopicParameters getTopicParams() {
+        final TopicParameters topicParams = new TopicParameters();
+        topicParams.setTopic("POLICY-PDP-PAP");
+        topicParams.setTopicCommInfrastructure("dmaap");
+        topicParams.setServers(Arrays.asList("message-router"));
+        return topicParams;
+    }
+
     /**
      * Converts the contents of a map to a parameter class.
      *
@@ -97,7 +111,7 @@ public class CommonTestData {
         map.put("name", name);
         map.put("restServerParameters", getRestServerParametersMap(false));
         map.put("pdpStatusParameters", getPdpStatusParametersMap(false));
-
+        map.put("topicParameterGroup", getTopicParametersMap(false));
         return map;
     }
 
@@ -141,4 +155,19 @@ public class CommonTestData {
 
         return map;
     }
+
+    /**
+     * Returns a property map for a TopicParameters map for test cases.
+     *
+     * @param isEmpty boolean value to represent that object created should be empty or not
+     * @return a property map suitable for constructing an object
+     */
+    public Map<String, Object> getTopicParametersMap(final boolean isEmpty) {
+        final Map<String, Object> map = new TreeMap<>();
+        if (!isEmpty) {
+            map.put("topicSources", TOPIC_PARAMS);
+            map.put("topicSinks", TOPIC_PARAMS);
+        }
+        return map;
+    }
 }
index dd9e83f..e96b136 100644 (file)
@@ -27,6 +27,8 @@ import static org.junit.Assert.assertTrue;
 import java.util.Map;
 
 import org.junit.Test;
+import org.onap.policy.common.endpoints.parameters.RestServerParameters;
+import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
 import org.onap.policy.common.parameters.GroupValidationResult;
 
 /**
@@ -50,6 +52,7 @@ public class TestApexStarterParameterGroup {
                 ApexStarterParameterGroup.class);
         final RestServerParameters restServerParameters = apexStarterParameters.getRestServerParameters();
         final PdpStatusParameters pdpStatusParameters = apexStarterParameters.getPdpStatusParameters();
+        final TopicParameterGroup topicParameterGroup  = apexStarterParameters.getTopicParameterGroup();
         final GroupValidationResult validationResult = apexStarterParameters.validate();
         assertTrue(validationResult.isValid());
         assertEquals(CommonTestData.APEX_STARTER_GROUP_NAME, apexStarterParameters.getName());
@@ -57,6 +60,8 @@ public class TestApexStarterParameterGroup {
         assertEquals(CommonTestData.PDP_TYPE, pdpStatusParameters.getPdpType());
         assertEquals(CommonTestData.DESCRIPTION, pdpStatusParameters.getDescription());
         assertEquals(CommonTestData.SUPPORTED_POLICY_TYPES, pdpStatusParameters.getSupportedPolicyTypes());
+        assertEquals(CommonTestData.TOPIC_PARAMS, topicParameterGroup.getTopicSinks());
+        assertEquals(CommonTestData.TOPIC_PARAMS, topicParameterGroup.getTopicSources());
         assertEquals(restServerParameters.getHost(), apexStarterParameters.getRestServerParameters().getHost());
         assertEquals(restServerParameters.getPort(), apexStarterParameters.getRestServerParameters().getPort());
         assertEquals(restServerParameters.getUserName(), apexStarterParameters.getRestServerParameters().getUserName());
@@ -122,7 +127,23 @@ public class TestApexStarterParameterGroup {
         final GroupValidationResult validationResult = apexStarterParameters.validate();
         assertFalse(validationResult.isValid());
         assertTrue(validationResult.getResult()
-                .contains("\"org.onap.policy.apex.services.onappf.parameters.RestServerParameters\" INVALID, "
+                .contains("\"org.onap.policy.common.endpoints.parameters.RestServerParameters\" INVALID, "
+                        + "parameter group has status INVALID"));
+    }
+
+
+    @Test
+    public void testApexStarterParameterGroupp_EmptyTopicParameters() {
+        final Map<String, Object> map =
+                commonTestData.getApexStarterParameterGroupMap(CommonTestData.APEX_STARTER_GROUP_NAME);
+        map.put("topicParameterGroup", commonTestData.getTopicParametersMap(true));
+
+        final ApexStarterParameterGroup apexStarterParameters =
+                commonTestData.toObject(map, ApexStarterParameterGroup.class);
+        final GroupValidationResult validationResult = apexStarterParameters.validate();
+        assertFalse(validationResult.isValid());
+        assertTrue(validationResult.getResult()
+                .contains("\"org.onap.policy.common.endpoints.parameters.TopicParameterGroup\" INVALID, "
                         + "parameter group has status INVALID"));
     }
 }
index 72db6e0..006cad0 100644 (file)
@@ -186,12 +186,7 @@ public class CommonApexStarterRestServer {
         systemProps.put("javax.net.ssl.keyStorePassword", "Pol1cy_0nap");
         System.setProperties(systemProps);
 
-        // @formatter:off
-        final String[] apexStarterConfigParameters = {
-            "-c", "src/test/resources/TestConfigParams.json",
-            "-p", "src/test/resources/topic.properties"
-        };
-        // @formatter:on
+        final String[] apexStarterConfigParameters = { "-c", "src/test/resources/TestConfigParams.json" };
 
         main = new ApexStarterMain(apexStarterConfigParameters);
 
index 57ecb2c..2023685 100644 (file)
         "pdpType":"apex",
         "description":"Pdp Heartbeat",
         "supportedPolicyTypes":[{"name":"onap.policies.controlloop.operational.Apex","version":"1.0.0"}]
+    },
+    "topicParameterGroup": {
+        "topicSources" : [ {
+            "topic" : "ueb-source",
+            "servers" : [ "my-server" ],
+            "topicCommInfrastructure" : "ueb"
+        },{
+            "topic" : "POLICY-PDP-PAP1",
+            "servers" : [ "message-router1, message-router2" ],
+            "topicCommInfrastructure" : "dmaap"
+        },{
+            "topic" : "POLICY-PDP-PAP2",
+            "servers" : [ "message-router2, message-router3" ],
+            "topicCommInfrastructure" : "dmaap"
+        }],
+        "topicSinks" : [ {
+            "topic" : "ueb-sink",
+            "servers" : [ "my-server" ],
+            "topicCommInfrastructure" : "ueb"
+        },{
+            "topic" : "POLICY-PDP-PAP2",
+            "servers" : [ "message-router1, message-router2" ],
+            "topicCommInfrastructure" : "dmaap"
+        },{
+            "topic" : "POLICY-PDP-PAP3",
+            "servers" : [ "message-router2, message-router3" ],
+            "topicCommInfrastructure" : "dmaap"
+        }]
     }
 }
\ No newline at end of file
index 70ca137..c26a0a6 100644 (file)
         "pdpType":"apex",
         "description":"Pdp Heartbeat",
         "supportedPolicyTypes":[{"name":"onap.policies.controlloop.operational.Apex","version":"1.0.0"}]
+    },
+    "topicParameterGroup": {
+        "topicSources" : [{
+            "topic" : "POLICY-PDP-PAP",
+            "servers" : [ "localhost:6845" ],
+            "topicCommInfrastructure" : "dmaap"
+        }],
+        "topicSinks" : [{
+            "topic" : "POLICY-PDP-PAP",
+            "servers" : [ "localhost:6845" ],
+            "topicCommInfrastructure" : "dmaap"
+        }]
     }
-}
+}
\ No newline at end of file
index 1abb2e4..2023685 100644 (file)
     "pdpStatusParameters":{
         "timeIntervalMs": 120000,
         "pdpType":"apex",
-        "description":"Pdp heartbeat",
+        "description":"Pdp Heartbeat",
         "supportedPolicyTypes":[{"name":"onap.policies.controlloop.operational.Apex","version":"1.0.0"}]
+    },
+    "topicParameterGroup": {
+        "topicSources" : [ {
+            "topic" : "ueb-source",
+            "servers" : [ "my-server" ],
+            "topicCommInfrastructure" : "ueb"
+        },{
+            "topic" : "POLICY-PDP-PAP1",
+            "servers" : [ "message-router1, message-router2" ],
+            "topicCommInfrastructure" : "dmaap"
+        },{
+            "topic" : "POLICY-PDP-PAP2",
+            "servers" : [ "message-router2, message-router3" ],
+            "topicCommInfrastructure" : "dmaap"
+        }],
+        "topicSinks" : [ {
+            "topic" : "ueb-sink",
+            "servers" : [ "my-server" ],
+            "topicCommInfrastructure" : "ueb"
+        },{
+            "topic" : "POLICY-PDP-PAP2",
+            "servers" : [ "message-router1, message-router2" ],
+            "topicCommInfrastructure" : "dmaap"
+        },{
+            "topic" : "POLICY-PDP-PAP3",
+            "servers" : [ "message-router2, message-router3" ],
+            "topicCommInfrastructure" : "dmaap"
+        }]
     }
 }
\ No newline at end of file
diff --git a/services/services-onappf/src/test/resources/topic.properties b/services/services-onappf/src/test/resources/topic.properties
deleted file mode 100644 (file)
index 9f3c21d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# ============LICENSE_START=======================================================
-# Copyright (C) 2019 Nordix Foundation.
-# ================================================================================
-# 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=========================================================
-
-noop.sink.topics=POLICY-PDP-PAP
-noop.sink.topics.POLICY-PDP-PAP.servers=anyserver
-noop.source.topics=POLICY-PDP-PAP
-noop.source.topics.POLICY-PDP-PAP.servers=anyserver
\ No newline at end of file
diff --git a/services/services-onappf/src/test/resources/topic_sim.properties b/services/services-onappf/src/test/resources/topic_sim.properties
deleted file mode 100644 (file)
index 2bdf8c7..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# ============LICENSE_START=======================================================
-# Copyright (C) 2019 Nordix Foundation.
-# ================================================================================
-# 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=========================================================
-
-dmaap.sink.topics=POLICY-PDP-PAP
-dmaap.sink.topics.POLICY-PDP-PAP.servers=localhost:6845
-dmaap.source.topics=POLICY-PDP-PAP
-dmaap.source.topics.POLICY-PDP-PAP.servers=localhost:6845