From 19f6abb1f996a6a31b6f330c7f4a998ba4f554da Mon Sep 17 00:00:00 2001 From: Rafal Wrzesniak Date: Tue, 14 Sep 2021 12:43:14 +0200 Subject: 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 Change-Id: Iff7e29b33e7ff9c6b16e9d161abc3ce0718ed93c --- .../test/TestDMaaPVESMsgConsumerMain.java | 22 ++++++--------- .../test/impl/DummyFaultVESMsgConsumer.java | 31 --------------------- .../test/impl/DummyPNFRegVESMsgConsumer.java | 32 ---------------------- 3 files changed, 8 insertions(+), 77 deletions(-) delete mode 100644 sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/impl/DummyFaultVESMsgConsumer.java delete mode 100644 sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/impl/DummyPNFRegVESMsgConsumer.java (limited to 'sdnr/wt/mountpoint-registrar/provider/src/test') 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 configMap = new HashMap(); + Map 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); - - } - -} -- cgit 1.2.3-korg