diff options
author | 2022-02-01 13:19:55 +0530 | |
---|---|---|
committer | 2022-02-01 13:20:37 +0530 | |
commit | 879acbfe12b637bc32a5632f5c20bd2a09378e15 (patch) | |
tree | 34518cefdcb3fd4f060b1eafaaa8200ec4a9d274 /sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java | |
parent | 9912e1626d93afeb4f7148dd5d826ae1caa1ef8a (diff) |
Update adapter-manager devicemanager
Include latest yang files
Issue-ID: CCSDK-3578
Change-Id: I39e2acd096df1a1a3ade7965486fa75e21cd27d1
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java')
2 files changed, 11 insertions, 9 deletions
diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElement.java b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElement.java index d067d538f..5b4306093 100644 --- a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElement.java +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElement.java @@ -33,7 +33,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServic 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.TransactionUtils; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.network.topology.simulator.rev191025.SimulatorStatus; +import org.opendaylight.yang.gen.v1.urn.o.ran.sc.params.xml.ns.yang.nts.manager.rev210608.simulation.NetworkFunctions; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; import org.opendaylight.yangtools.yang.common.QName; @@ -55,6 +55,7 @@ public class TestAdapterManagerNetworkElement { when(accessor.getCapabilites()).thenReturn(capabilities); when(accessor.getNodeId()).thenReturn(nNodeId); when(accessor.getTransactionUtils()).thenReturn(mock(TransactionUtils.class)); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(accessor)); DataProvider dataProvider = mock(DataProvider.class); when(serviceProvider.getDataProvider()).thenReturn(dataProvider); @@ -63,10 +64,10 @@ public class TestAdapterManagerNetworkElement { @Test public void test() { Optional<NetworkElement> adapterManagerNe; - when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(true); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkFunctions.QNAME)).thenReturn(true); AdapterManagerNetworkElementFactory factory = new AdapterManagerNetworkElementFactory(); adapterManagerNe = factory.create(accessor, serviceProvider); - assertTrue(factory.create(accessor, serviceProvider).isPresent()); + assertTrue(adapterManagerNe.isPresent()); adapterManagerNe.get().register(); adapterManagerNe.get().deregister(); adapterManagerNe.get().getAcessor(); diff --git a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElementFactory.java b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElementFactory.java index fce5f6b88..9f67e188e 100644 --- a/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-onap/adapter-manager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/adaptermanager/test/TestAdapterManagerNetworkElementFactory.java @@ -17,10 +17,12 @@ */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.adaptermanager.test; +import static org.junit.Assert.assertFalse; 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; @@ -28,7 +30,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.adaptermanager.impl.Adapter 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.NetconfBindingAccessor; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.network.topology.simulator.rev191025.SimulatorStatus; +import org.opendaylight.yang.gen.v1.urn.o.ran.sc.params.xml.ns.yang.nts.manager.rev210608.simulation.NetworkFunctions; import org.opendaylight.yangtools.yang.common.QName; public class TestAdapterManagerNetworkElementFactory { @@ -45,23 +47,22 @@ public class TestAdapterManagerNetworkElementFactory { serviceProvider = mock(DeviceManagerServiceProvider.class); when(accessor.getCapabilites()).thenReturn(capabilities); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(accessor)); when(serviceProvider.getDataProvider()).thenReturn(null); - - } @Test public void testCreateSimulator() throws Exception { - when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(true); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkFunctions.QNAME)).thenReturn(true); AdapterManagerNetworkElementFactory factory = new AdapterManagerNetworkElementFactory(); assertTrue(factory.create(accessor, serviceProvider).isPresent()); } @Test public void testCreateNone() throws Exception { - when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(false); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkFunctions.QNAME)).thenReturn(false); AdapterManagerNetworkElementFactory factory = new AdapterManagerNetworkElementFactory(); - assertTrue(!(factory.create(accessor, serviceProvider).isPresent())); + assertFalse(factory.create(accessor, serviceProvider).isPresent()); } @After |