diff options
author | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2021-02-03 15:16:43 +0100 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2021-02-05 22:57:19 +0000 |
commit | f2b7adc8df29246e154011293c7a4afdd242df60 (patch) | |
tree | 1ae3829f1b51c030f74c13619d62268b66948269 /sdnr/wt/devicemanager-onf/provider/src/test | |
parent | 95264d6d078e4d07e147369b007ae2c9791769c8 (diff) |
Migrate devicemanager-adapter-manager and devicemanager-onf
Migrate devicemanager-adapter-manager and devicemanager-onf to Aluminium
Issue-ID: CCSDK-3133
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: I172bd97c0a79f0ee80bf27326dc39b38e306102a
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-onf/provider/src/test')
8 files changed, 45 insertions, 71 deletions
diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestONFCoreNetworkElement12Equipment.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestONFCoreNetworkElement12Equipment.java index 095446f0b..30cd7647a 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestONFCoreNetworkElement12Equipment.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestONFCoreNetworkElement12Equipment.java @@ -32,7 +32,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment.ONFCore import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment.WrapperEquipmentPacRev170402; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; 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.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -45,7 +45,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestONFCoreNetworkElement12Equipment { - NetconfAccessor netconfAccessor; + NetconfBindingAccessor netconfAccessor; Capabilities capabilities; NetworkElementCoreData coreData; FaultData faultData; @@ -57,7 +57,7 @@ public class TestONFCoreNetworkElement12Equipment { @Before public void init() throws Exception { - netconfAccessor = mock(NetconfAccessor.class); + netconfAccessor = mock(NetconfBindingAccessor.class); capabilities = mock(Capabilities.class); coreData = mock(NetworkElementCoreData.class); faultData = mock(FaultData.class); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java index 96c3c757d..bee34b5b5 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java @@ -32,7 +32,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Wrapper import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; -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.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -82,7 +82,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestWrapperMicrowaveModelRev170324 { - NetconfAccessor accessor; + NetconfBindingAccessor accessor; DeviceManagerServiceProvider serviceProvider; FaultData resultList; UniversalId uid; @@ -99,7 +99,7 @@ public class TestWrapperMicrowaveModelRev170324 { @Before public void init() { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); resultList = mock(FaultData.class); transactionUtils = mock(TransactionUtils.class); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java index dec443519..4c4c9734a 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java @@ -33,7 +33,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolNa import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; -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.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; @@ -82,7 +82,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestWrapperMicrowaveModelRev180907 { - NetconfAccessor accessor; + NetconfBindingAccessor accessor; DeviceManagerServiceProvider serviceProvider; FaultData resultList; UniversalId uid; @@ -98,7 +98,7 @@ public class TestWrapperMicrowaveModelRev180907 { @Before public void init() { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); resultList = mock(FaultData.class); transactionUtils = mock(TransactionUtils.class); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java index 94f8e6c19..0259fea5e 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java @@ -33,7 +33,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolNa import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; -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.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -84,7 +84,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @SuppressWarnings("deprecation") public class TestWrapperMicrowaveModelRev181010 { - NetconfAccessor accessor; + NetconfBindingAccessor accessor; DeviceManagerServiceProvider serviceProvider; FaultData resultList; UniversalId uid; @@ -101,7 +101,7 @@ public class TestWrapperMicrowaveModelRev181010 { @Before public void init() { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); resultList = mock(FaultData.class); transactionUtils = mock(TransactionUtils.class); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/test/TestWrapperPTPModelRev170208.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/test/TestWrapperPTPModelRev170208.java index 42f7de1d6..0694bcecc 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/test/TestWrapperPTPModelRev170208.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/test/TestWrapperPTPModelRev170208.java @@ -23,7 +23,7 @@ import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.WrapperPTPModelRev170208; 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.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -48,14 +48,14 @@ import static org.mockito.Mockito.*; public class TestWrapperPTPModelRev170208 { private static final String NODEID = "node1"; - NetconfAccessor netconfAccessor; + NetconfBindingAccessor netconfAccessor; Capabilities capabilities; TransactionUtils transactionUtils; DataBroker dataBroker; @Before public void init() { - netconfAccessor = mock(NetconfAccessor.class); + netconfAccessor = mock(NetconfBindingAccessor.class); capabilities = mock(Capabilities.class); dataBroker = mock(DataBroker.class); transactionUtils = mock(TransactionUtils.class); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/test/TestONFCoreNetworkElementFactory.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/test/TestONFCoreNetworkElementFactory.java index 909a67edc..14bd1bd91 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/test/TestONFCoreNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/test/TestONFCoreNetworkElementFactory.java @@ -20,9 +20,9 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.test; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - import java.io.File; import java.io.IOException; +import java.util.Optional; import org.junit.After; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -35,7 +35,8 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.DeviceManagerOnfCo import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.ONFCoreNetworkElementFactory; 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.NetconfNotifications; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; @@ -43,7 +44,7 @@ import org.opendaylight.yangtools.yang.common.QName; public class TestONFCoreNetworkElementFactory { - static NetconfAccessor accessor; + static NetconfBindingAccessor accessor; static DeviceManagerServiceProvider serviceProvider; static Capabilities capabilities; static DataBroker dataBroker; @@ -57,7 +58,7 @@ public class TestONFCoreNetworkElementFactory { public static void init() throws InterruptedException, IOException { capabilities = mock(Capabilities.class); - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); dataBroker = mock(DataBroker.class); @@ -68,8 +69,14 @@ public class TestONFCoreNetworkElementFactory { when(accessor.getCapabilites()).thenReturn(capabilities); //when(serviceProvider.getDataProvider()).thenReturn(dataProvider); nNodeId = new NodeId("nSky"); - when(accessor.getNodeId()).thenReturn(nNodeId); + NetconfBindingAccessor bindingAccessor = mock(NetconfBindingAccessor.class); + when(bindingAccessor.getNodeId()).thenReturn(nNodeId); + when(bindingAccessor.getNotificationAccessor()).thenReturn(Optional.of(mock(NetconfNotifications.class))); + when(bindingAccessor.getCapabilites()).thenReturn(capabilities); + when(accessor.getNodeId()).thenReturn(nNodeId); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(bindingAccessor)); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElement.QNAME)).thenReturn(true); } @@ -80,9 +87,6 @@ public class TestONFCoreNetworkElementFactory { @Test public void testCreateMWModelRev170324() throws Exception { - - - when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElement.QNAME)).thenReturn(true); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev170324.QNAME)) .thenReturn(true); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev180907.QNAME)) @@ -95,7 +99,6 @@ public class TestONFCoreNetworkElementFactory { @Test public void testCreateMWModelRev180907() throws Exception { - when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElement.QNAME)).thenReturn(true); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev170324.QNAME)) .thenReturn(false); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev180907.QNAME)) @@ -108,7 +111,6 @@ public class TestONFCoreNetworkElementFactory { @Test public void testCreateMWModelRev181010() throws Exception { - when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElement.QNAME)).thenReturn(true); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev170324.QNAME)) .thenReturn(false); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev180907.QNAME)) diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Basic.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Basic.java index 027ad2405..0749823a2 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Basic.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Basic.java @@ -19,46 +19,29 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - -import java.util.List; -import org.eclipse.jdt.annotation.Nullable; +import java.util.Optional; import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.OnfMicrowaveModel; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.DeviceManagerOnfConfiguration; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.ONFCoreNetworkElement12Basic; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.ONFCoreNetworkElement12Microwave; 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.FaultService; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfNotifications; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.AdministrativeControl; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.AdministrativeState; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.LifecycleState; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.OperationalState; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.extension.g.Extension; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.global._class.g.LocalId; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.label.g.Label; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.name.g.Name; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.network.element.Fd; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.network.element.Ltp; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.NetworkElementPac; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; -import org.opendaylight.yangtools.yang.binding.Augmentation; -import org.opendaylight.yangtools.yang.binding.DataContainer; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestONFCoreNetworkElement12Basic { - NetconfAccessor accessor; + NetconfBindingAccessor accessor; DeviceManagerServiceProvider serviceProvider; Capabilities capabilities; TransactionUtils transactionUtils; @@ -73,7 +56,7 @@ public class TestONFCoreNetworkElement12Basic { @Before public void init() { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); capabilities = mock(Capabilities.class); transactionUtils = mock(TransactionUtils.class); @@ -90,6 +73,10 @@ public class TestONFCoreNetworkElement12Basic { when(accessor.getNodeId()).thenReturn(nNodeId); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElementPac.QNAME)).thenReturn(true); when(accessor.getTransactionUtils()).thenReturn(transactionUtils); + when(accessor.getNotificationAccessor()).thenReturn(Optional.of(mock(NetconfNotifications.class))); + NetconfBindingAccessor bindingAccessor = mock(NetconfBindingAccessor.class); + when(bindingAccessor.getNodeId()).thenReturn(nNodeId); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(bindingAccessor)); } @@ -105,7 +92,7 @@ public class TestONFCoreNetworkElement12Basic { EventlogEntity eventlogEntity = mock(EventlogEntity.class); when(eventlogEntity.getObjectId()).thenReturn("ABCD"); when(eventlogEntity.getAttributeName()).thenReturn("/equipment-pac/equipment-current-problems"); - + onfCoreNetworkElement12MW.notificationActor(eventlogEntity); } diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Microwave.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Microwave.java index 5f101b031..3e743ca3b 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Microwave.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Microwave.java @@ -19,9 +19,7 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - -import java.util.List; -import org.eclipse.jdt.annotation.Nullable; +import java.util.Optional; import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.OnfMicrowaveModel; @@ -30,34 +28,20 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.ONFCoreNetworkElemen 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.FaultService; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfNotifications; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.AdministrativeControl; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.AdministrativeState; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.LifecycleState; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.OperationalState; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.extension.g.Extension; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.global._class.g.LocalId; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.label.g.Label; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.name.g.Name; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.network.element.Fd; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.network.element.Ltp; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.NetworkElementPac; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; -import org.opendaylight.yangtools.yang.binding.Augmentation; -import org.opendaylight.yangtools.yang.binding.DataContainer; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestONFCoreNetworkElement12Microwave { - NetconfAccessor accessor; + NetconfBindingAccessor accessor; DeviceManagerServiceProvider serviceProvider; Capabilities capabilities; TransactionUtils transactionUtils; @@ -72,7 +56,7 @@ public class TestONFCoreNetworkElement12Microwave { @Before public void init() { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); capabilities = mock(Capabilities.class); transactionUtils = mock(TransactionUtils.class); @@ -89,6 +73,7 @@ public class TestONFCoreNetworkElement12Microwave { when(accessor.getNodeId()).thenReturn(nNodeId); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElementPac.QNAME)).thenReturn(true); when(accessor.getTransactionUtils()).thenReturn(transactionUtils); + when(accessor.getNotificationAccessor()).thenReturn(Optional.of(mock(NetconfNotifications.class))); } |