From 1c4ad2b1a689d309d456a6ada894d1e8b1971b3c Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Mon, 9 Aug 2021 16:03:02 +0530 Subject: Update devicemanager-openroadm unit tests and some minor changes Issue-ID: CCSDK-3419 Signed-off-by: Ravi Pendurty Change-Id: I3382de7a9b1f863c0eb31eb4787b402330ce6516 Signed-off-by: Ravi Pendurty --- .../sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElement.java | 2 +- .../devicemanager/openroadm/impl/OpenroadmNetworkElementFactory.java | 2 +- .../sdnr/wt/devicemanager/openroadm/impl/PmDataBuilderOpenRoadm.java | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'sdnr/wt/devicemanager-onap/openroadm/provider/src/main') diff --git a/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElement.java b/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElement.java index cc406d843..45490a8b7 100644 --- a/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElement.java +++ b/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElement.java @@ -62,7 +62,7 @@ import org.slf4j.LoggerFactory; public class OpenroadmNetworkElement extends OpenroadmNetworkElementBase { // variables - private final long equipmentLevel = 1; + private final long equipmentLevel = 0; private static final Logger log = LoggerFactory.getLogger(OpenroadmNetworkElement.class); private Hashtable circuitPacksRecord; private Hashtable shelfProvisionedcircuitPacks; diff --git a/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementFactory.java b/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementFactory.java index cc8eaa68e..f4f486578 100644 --- a/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/OpenroadmNetworkElementFactory.java @@ -63,7 +63,7 @@ public class OpenroadmNetworkElementFactory implements NetworkElementFactory { if (bindingAccessor.isPresent()) { return Optional.of(new OpenroadmNetworkElementBase(bindingAccessor.get(), serviceProvider)); } - } + } return Optional.empty(); } // end of public methods diff --git a/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/PmDataBuilderOpenRoadm.java b/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/PmDataBuilderOpenRoadm.java index f1fd4471f..b032348ca 100644 --- a/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/PmDataBuilderOpenRoadm.java +++ b/sdnr/wt/devicemanager-onap/openroadm/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/impl/PmDataBuilderOpenRoadm.java @@ -94,6 +94,9 @@ public class PmDataBuilderOpenRoadm { // Build PM entity for writing into the database public List buildPmDataEntity(HistoricalPmList historicalPmEnitityList) { List pmEntitiyList = new ArrayList<>(); + if(historicalPmEnitityList==null) { + return pmEntitiyList; + } Collection pmDataEntryList = YangHelper.getCollection(historicalPmEnitityList.getHistoricalPmEntry()); for (HistoricalPmEntry pmDataEntry : pmDataEntryList) { -- cgit 1.2.3-korg