diff options
author | 2021-02-03 15:43:35 +0100 | |
---|---|---|
committer | 2021-02-05 22:57:46 +0000 | |
commit | 95cae7ce9aa09198bd46eee556da468a57657017 (patch) | |
tree | fe95f6851f106cafc19dc396bd1d307840828662 /sdnr/wt/devicemanager-oran/provider/src/test | |
parent | ece5215df091114be3bffee073c8d3b0bc1ee1bc (diff) |
Migrate devicemanager-oran mountpoint-registrar and mountpoint-state-provider
Migrate devicemanager-oran mountpoint-registrar and mountpoint-state-provider to Aluminium
Issue-ID: CCSDK-3135
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: I6f9ebcf9b41157e04f6a82cbdc01cd1a32331cf6
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-oran/provider/src/test')
4 files changed, 41 insertions, 24 deletions
diff --git a/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanChangeNotificationListener.java b/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanChangeNotificationListener.java index 59fb72705..052b5a711 100644 --- a/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanChangeNotificationListener.java +++ b/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanChangeNotificationListener.java @@ -29,7 +29,7 @@ import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.ORanChangeNotificationListener; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorCfgService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorService; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.base._1._0.rev110601.EditOperationType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfConfigChange; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.netconf.config.change.Edit; @@ -48,7 +48,7 @@ public class TestORanChangeNotificationListener { @Test public void test() { - NetconfAccessor netconfAccessor = mock(NetconfAccessor.class); + NetconfBindingAccessor netconfAccessor = mock(NetconfBindingAccessor.class); DataProvider databaseService = mock(DataProvider.class); VESCollectorService vesCollectorService = mock(VESCollectorService.class); VESCollectorCfgService vesCfgService = mock(VESCollectorCfgService.class); diff --git a/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanNetworkElement.java b/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanNetworkElement.java index be3cde2ef..a0321206c 100644 --- a/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanNetworkElement.java +++ b/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanNetworkElement.java @@ -32,24 +32,30 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.ORanNetworkElemen import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.test.mock.TransactionUtilsMock; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.yang.gen.v1.urn.o.ran.hardware._1._0.rev190328.ORANHWCOMPONENT; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; -import org.opendaylight.yangtools.yang.common.QName; public class TestORanNetworkElement { - static NetconfAccessor accessor; - static DeviceManagerServiceProvider serviceProvider; - static Capabilities capabilities; - QName qCapability; + private static String NODEIDSTRING = "nSky"; + + private static NetconfBindingAccessor accessor; + private static DeviceManagerServiceProvider serviceProvider; + private static Capabilities capabilities; @BeforeClass public static void init() throws InterruptedException, IOException { capabilities = mock(Capabilities.class); - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); + NetconfBindingAccessor bindingCommunicator = mock(NetconfBindingAccessor.class); + NodeId nodeId = new NodeId(NODEIDSTRING); + when(bindingCommunicator.getTransactionUtils()).thenReturn(mock(TransactionUtils.class)); + when(bindingCommunicator.getNodeId()).thenReturn(nodeId); + NodeId nNodeId = new NodeId("nSky"); when(accessor.getCapabilites()).thenReturn(capabilities); when(accessor.getNodeId()).thenReturn(nNodeId); @@ -57,10 +63,18 @@ public class TestORanNetworkElement { DataProvider dataProvider = mock(DataProvider.class); when(serviceProvider.getDataProvider()).thenReturn(dataProvider); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(bindingCommunicator)); + + } @Test public void test() { + NetconfBindingAccessor bindingCommunicator = mock(NetconfBindingAccessor.class); + NodeId nodeId = new NodeId(NODEIDSTRING); + when(bindingCommunicator.getTransactionUtils()).thenReturn(mock(TransactionUtils.class)); + when(bindingCommunicator.getNodeId()).thenReturn(nodeId); + Optional<NetworkElement> oRanNe; when(accessor.getCapabilites().isSupportingNamespace(ORANHWCOMPONENT.QNAME)).thenReturn(true); ORanNetworkElementFactory factory = new ORanNetworkElementFactory(); diff --git a/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanNetworkElementFactory.java b/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanNetworkElementFactory.java index a349598a2..f6ca70ad1 100644 --- a/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanNetworkElementFactory.java @@ -21,30 +21,39 @@ import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.IOException; +import java.util.Optional; import org.junit.After; import org.junit.BeforeClass; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.ORanNetworkElementFactory; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.yang.gen.v1.urn.o.ran.hardware._1._0.rev190328.ORANHWCOMPONENT; -import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; public class TestORanNetworkElementFactory { - static NetconfAccessor accessor; - static DeviceManagerServiceProvider serviceProvider; - static Capabilities capabilities; - QName qCapability; + private static String NODEIDSTRING = "nSky"; + + private static NetconfBindingAccessor accessor; + private static DeviceManagerServiceProvider serviceProvider; + private static Capabilities capabilities; @BeforeClass public static void init() throws InterruptedException, IOException { + NetconfBindingAccessor bindingCommunicator = mock(NetconfBindingAccessor.class); + NodeId nodeId = new NodeId(NODEIDSTRING); + when(bindingCommunicator.getTransactionUtils()).thenReturn(mock(TransactionUtils.class)); + when(bindingCommunicator.getNodeId()).thenReturn(nodeId); + capabilities = mock(Capabilities.class); - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); when(accessor.getCapabilites()).thenReturn(capabilities); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(bindingCommunicator)); when(serviceProvider.getDataProvider()).thenReturn(null); diff --git a/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanToInternalDataModel.java b/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanToInternalDataModel.java index e5efb1b40..c33926bd8 100644 --- a/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanToInternalDataModel.java +++ b/sdnr/wt/devicemanager-oran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/test/TestORanToInternalDataModel.java @@ -20,13 +20,9 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.test; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - -import java.util.List; -import java.util.Optional; import java.io.IOException; import java.util.ArrayList; - -import org.eclipse.jdt.annotation.Nullable; +import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -37,15 +33,13 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.hardware.re import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.test.TestHardwareClass; public class TestORanToInternalDataModel { NodeId nodeId; Component component; - @SuppressWarnings("unchecked") - @Before + @Before public void init() throws InterruptedException, IOException { nodeId = mock(NodeId.class); component = mock(Component.class); |