From 3b5d372ed15ccd9af58756b6d4dcaf30377ddd3e Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Tue, 18 Feb 2020 09:55:09 +0100 Subject: Fix code smells Fix code smells based on SonarCloud report Issue-ID: SDNC-1075 Signed-off-by: Ravi Pendurty Change-Id: I98be47a2c75f80aa5593aab2ed63e7abf1dcccc9 Signed-off-by: Ravi Pendurty --- sdnr/wt/devicemanager-gran/provider/pom.xml | 23 ---------------------- .../wt/devicemanager/gran/GRanNetworkElement.java | 2 ++ .../gran/impl/DeviceManagerGRanImpl.java | 9 ++------- .../gran/test/TestDeviceManagerGRanImpl.java | 10 ---------- .../gran/test/TestGRanNetworkElement.java | 6 +++--- 5 files changed, 7 insertions(+), 43 deletions(-) (limited to 'sdnr/wt/devicemanager-gran') diff --git a/sdnr/wt/devicemanager-gran/provider/pom.xml b/sdnr/wt/devicemanager-gran/provider/pom.xml index b8ef8637f..6cd317f01 100644 --- a/sdnr/wt/devicemanager-gran/provider/pom.xml +++ b/sdnr/wt/devicemanager-gran/provider/pom.xml @@ -131,29 +131,6 @@ - - org.codehaus.mojo - exec-maven-plugin - - - generateDTOs - generate-sources - - exec - - - bash - - ${basedir}/../../data-provider/provider/src/main/resources/es-init.sh - - initfile - -f - ${project.build.directory}/EsInit.script - - - - - diff --git a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java index d4932b93e..0f7266061 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java +++ b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java @@ -52,10 +52,12 @@ public class GRanNetworkElement implements NetworkElement { @Override public void deregister() { + log.info("deRegister actions should be here"); } @Override public void warmstart() { + log.info("Warmstart actions should be here"); } @Override diff --git a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java index d85515bb4..961a9b7ff 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java +++ b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java @@ -17,7 +17,6 @@ ******************************************************************************/ package org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.impl; -import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.GRanNetworkElementFactory; import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.factory.FactoryRegistration; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService; @@ -28,12 +27,10 @@ public class DeviceManagerGRanImpl implements AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(DeviceManagerGRanImpl.class); private static final String APPLICATION_NAME = "DeviceManagerGRan"; - private static final String CONFIGURATIONFILE = "etc/devicemanager-gran.properties"; - + private NetconfNetworkElementService netconfNetworkElementService; private Boolean devicemanagerInitializationOk; - private DataProvider dataProvider; private FactoryRegistration factoryRegistration; // Blueprint 1 @@ -43,7 +40,7 @@ public class DeviceManagerGRanImpl implements AutoCloseable { netconfNetworkElementService = null; factoryRegistration = null; - dataProvider = null; + } public void setNetconfNetworkElementService(NetconfNetworkElementService netconfNetworkElementService) { this.netconfNetworkElementService = netconfNetworkElementService; @@ -54,8 +51,6 @@ public class DeviceManagerGRanImpl implements AutoCloseable { LOG.info("Session Initiated start {}", APPLICATION_NAME); // Intialization factoryRegistration = netconfNetworkElementService.registerNetworkElementFactory(new GRanNetworkElementFactory()); - dataProvider = netconfNetworkElementService.getServiceProvider().getDataProvider(); - netconfNetworkElementService.writeToEventLog(APPLICATION_NAME, "startup", "done"); this.devicemanagerInitializationOk = true; diff --git a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java index bf0a098d8..c008986e0 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java +++ b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java @@ -17,24 +17,14 @@ ******************************************************************************/ package org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.test; -import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import org.eclipse.jdt.annotation.NonNull; import org.junit.Test; -import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.GRanNetworkElementFactory; import org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.impl.DeviceManagerGRanImpl; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.AaiService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.EquipmentService; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.EventHandlingService; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.MaintenanceService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NetconfNetworkElementService; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.PerformanceManager; public class TestDeviceManagerGRanImpl { GRanNetworkElementFactory factory = new GRanNetworkElementFactory(); diff --git a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java index 1b381ee00..ac232a008 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java +++ b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java @@ -39,9 +39,9 @@ public class TestGRanNetworkElement { when(netconfAccessor.getNodeId()).thenReturn(new NodeId(NODEID)); GRanNetworkElement gRanNe = new GRanNetworkElement(netconfAccessor, databaseService); - assertEquals(gRanNe.getDeviceType().getIntValue(), 3); - assertEquals(gRanNe.getDeviceType().getName(), "RAN3GPP"); - assertEquals(gRanNe.getNodeId().getValue(), NODEID); + assertEquals(3, gRanNe.getDeviceType().getIntValue()); + assertEquals("RAN3GPP", gRanNe.getDeviceType().getName()); + assertEquals(NODEID, gRanNe.getNodeId().getValue()); gRanNe.register(); gRanNe.deregister(); -- cgit 1.2.3-korg