aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-gran/provider/src
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2020-02-18 09:55:09 +0100
committerRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2020-02-18 11:51:56 +0100
commit3b5d372ed15ccd9af58756b6d4dcaf30377ddd3e (patch)
treeab07797bc67f90405e0709170c12201f98600727 /sdnr/wt/devicemanager-gran/provider/src
parent635d0ff476db287c1d9ffe50e44e02d8326c2995 (diff)
Fix code smells
Fix code smells based on SonarCloud report Issue-ID: SDNC-1075 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> Change-Id: I98be47a2c75f80aa5593aab2ed63e7abf1dcccc9 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-gran/provider/src')
-rw-r--r--sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java2
-rw-r--r--sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java9
-rw-r--r--sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java10
-rw-r--r--sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java6
4 files changed, 7 insertions, 20 deletions
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<GRanNetworkElementFactory> 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();