summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/mountpoint-registrar/provider/src/test
diff options
context:
space:
mode:
authorRafal Wrzesniak <r.wrzesniak@partner.samsung.com>2021-09-14 12:43:14 +0200
committerRafal Wrzesniak <r.wrzesniak@partner.samsung.com>2021-09-20 11:43:45 +0000
commit19f6abb1f996a6a31b6f330c7f4a998ba4f554da (patch)
tree97a85907eaa943fa1ccf0c0e8de2bc27a75d6f28 /sdnr/wt/mountpoint-registrar/provider/src/test
parenta3e6a159d3df2ac16295a4bd50935160c0f65264 (diff)
Create MessageConfig and move there common config class code
Move most of code from fault and pnf config classes to common one Issue-ID: CCSDK-3455 Signed-off-by: Rafal Wrzesniak <r.wrzesniak@partner.samsung.com> Change-Id: Iff7e29b33e7ff9c6b16e9d161abc3ce0718ed93c
Diffstat (limited to 'sdnr/wt/mountpoint-registrar/provider/src/test')
-rw-r--r--sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPVESMsgConsumerMain.java22
-rw-r--r--sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/impl/DummyFaultVESMsgConsumer.java31
-rw-r--r--sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/impl/DummyPNFRegVESMsgConsumer.java32
3 files changed, 8 insertions, 77 deletions
diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPVESMsgConsumerMain.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPVESMsgConsumerMain.java
index 032850afb..11fb2f3b9 100644
--- a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPVESMsgConsumerMain.java
+++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPVESMsgConsumerMain.java
@@ -3,6 +3,7 @@
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * Copyright (C) 2021 Samsung Electronics Intellectual Property. 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
@@ -27,18 +28,12 @@ import java.util.List;
import java.util.Map;
import org.junit.After;
import org.junit.Test;
-import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration;
import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
-import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.DMaaPVESMsgConsumer;
-import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.DMaaPVESMsgConsumerMain;
-import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.FaultConfig;
-import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.GeneralConfig;
-import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.PNFRegistrationConfig;
+import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.*;
public class TestDMaaPVESMsgConsumerMain {
private static final String CONFIGURATIONFILE = "test1.properties";
- // @formatter:off
private static final String TESTCONFIG_GENERAL = "[general]\n"
+ "dmaapEnabled=false\n"
+ "baseUrl=http://localhost:8181\n"
@@ -46,7 +41,7 @@ public class TestDMaaPVESMsgConsumerMain {
+ "sdnrPasswd=admin\n"
+ "\n"
+ "[pnfRegistration]\n"
- + "pnfRegConsumerClass=org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test.impl.DummyPNFRegVESMsgConsumer\n"
+ + "pnfRegConsumerClass=org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test.impl.DMaaPPNFRegVESMsgConsumer\n"
+ "TransportType=HTTPNOAUTH\n"
+ "host=onap-dmap:3904\n"
+ "topic=unauthenticated.VES_PNFREG_OUTPUT\n"
@@ -57,7 +52,7 @@ public class TestDMaaPVESMsgConsumerMain {
+ "limit=10000\n"
+ "\n"
+ "[fault]\n"
- + "faultConsumerClass=org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test.impl.DummyFaultVESMsgConsumer\n"
+ + "faultConsumerClass=org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.DMaaPFaultVESMsgConsumer.java\n"
+ "TransportType=HTTPNOAUTH\n"
+ "host=onap-dmap:3904\n"
+ "topic=unauthenticated.SEC_FAULT_OUTPUT\n"
@@ -77,7 +72,7 @@ public class TestDMaaPVESMsgConsumerMain {
+ "sdnrPasswd=admin\n"
+ "\n"
+ "[pnfRegistration]\n"
- + "pnfRegConsumerClass=org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test.impl.DummyPNFRegVESMsgConsumer\n"
+ + "pnfRegConsumerClass=org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.DMaaPPNFRegVESMsgConsumer.java\n"
+ "TransportType=HTTPNOAUTH\n"
+ "host=onap-dmap:3904\n"
+ "topic=unauthenticated.VES_PNFREG_OUTPUT\n"
@@ -88,7 +83,7 @@ public class TestDMaaPVESMsgConsumerMain {
+ "limit=10000\n"
+ "\n"
+ "[fault]\n"
- + "faultConsumerClass=org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test.impl.DummyFaultVESMsgConsumer\n"
+ + "faultConsumerClass=org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.DMaaPFaultVESMsgConsumer.java\n"
+ "TransportType=HTTPNOAUTH\n"
+ "host=onap-dmap:3904\n"
+ "topic=unauthenticated.SEC_FAULT_OUTPUT\n"
@@ -100,12 +95,11 @@ public class TestDMaaPVESMsgConsumerMain {
+ "fetchPause=WORLD\n"
+ "\n"
+ "";
- // @formatter:on
public GeneralConfig generalConfig;
- Map<String, Configuration> configMap = new HashMap<String, Configuration>();
+ Map<String, MessageConfig> configMap = new HashMap<>();
DMaaPVESMsgConsumerMain dmaapMain;
- // @Before
+
public void preTest1() {
try {
Files.asCharSink(new File(CONFIGURATIONFILE), StandardCharsets.UTF_8).write(TESTCONFIG_GENERAL);
diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/impl/DummyFaultVESMsgConsumer.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/impl/DummyFaultVESMsgConsumer.java
deleted file mode 100644
index d1e9015e7..000000000
--- a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/impl/DummyFaultVESMsgConsumer.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. 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.
- * ============LICENSE_END==========================================================================
- */
-
-package org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test.impl;
-
-import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.DMaaPVESMsgConsumerImpl;
-
-public class DummyFaultVESMsgConsumer extends DMaaPVESMsgConsumerImpl {
-
- @Override
- public void processMsg(String msg) throws Exception {
- System.out.println("Message received is - " + msg);
-
- }
-
-}
diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/impl/DummyPNFRegVESMsgConsumer.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/impl/DummyPNFRegVESMsgConsumer.java
deleted file mode 100644
index a165182c0..000000000
--- a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/impl/DummyPNFRegVESMsgConsumer.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * ============LICENSE_START========================================================================
- * ONAP : ccsdk feature sdnr wt
- * =================================================================================================
- * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. 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.
- * ============LICENSE_END==========================================================================
- */
-
-package org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.test.impl;
-
-import org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl.DMaaPVESMsgConsumerImpl;
-
-public class DummyPNFRegVESMsgConsumer extends DMaaPVESMsgConsumerImpl {
-
-
- @Override
- public void processMsg(String msg) throws Exception {
- System.out.println("Message received is - " + msg);
-
- }
-
-}