diff options
author | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2021-05-25 18:57:29 +0530 |
---|---|---|
committer | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2021-06-14 10:22:54 +0530 |
commit | 17614362f2550c29dcd746ee2c1bc01d0df5de65 (patch) | |
tree | 97930a14a08c610efceb4aebb4f457e0cf42b2f8 /sdnr/wt/devicemanager-onap/openroadm/provider/src/test | |
parent | db9f267b3930a28054e967c75db228e27663aedc (diff) |
Improve Websocket notification interface
Improve websocket notification interface
Issue-ID: CCSDK-3315
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: I0ded865adddb546ade98df4760e0a32ec964295a
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-onap/openroadm/provider/src/test')
-rw-r--r-- | sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmAlarmNotification.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmAlarmNotification.java b/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmAlarmNotification.java index ff0ddb43c..cd54b6c20 100644 --- a/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmAlarmNotification.java +++ b/sdnr/wt/devicemanager-onap/openroadm/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/openroadm/test/TestOpenRoadmAlarmNotification.java @@ -31,7 +31,7 @@ import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.devicemanager.openroadm.impl.OpenroadmFaultNotificationListener; 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.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.websocketmanager.model.WebsocketManagerService; import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.AlarmNotification; import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev191129.Severity; @@ -44,6 +44,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.probablecause.rev191129.P import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev191129.resource.Device; import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev191129.resource.DeviceBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; public class TestOpenRoadmAlarmNotification { private static final String myCircuitId = "Test_Id"; @@ -52,18 +53,25 @@ public class TestOpenRoadmAlarmNotification { ProbableCause myProbableCause = new ProbableCauseBuilder().setCause(ProbableCauseEnum.AutomaticLaserShutdown).build(); Device device = new DeviceBuilder().setNodeId(NodeIdType.getDefaultInstance("zNhe2i5")).build(); - Resource myResource = new ResourceBuilder().setDevice(device).build(); + org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev191129.resource.resource.resource.CircuitPack resVal = + new org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev191129.resource.resource.resource.CircuitPackBuilder() + .setCircuitPackName("Slot-0-Port-A").build(); + org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev191129.resource.Resource affectedResource = + new org.opendaylight.yang.gen.v1.http.org.openroadm.resource.rev191129.resource.ResourceBuilder().setResource(resVal).build(); + Resource myResource = new ResourceBuilder().setResource(affectedResource).setDevice(device).build(); + + static DeviceManagerServiceProvider serviceProvider; static @NonNull FaultService faultService; static AlarmNotification notification; Severity severity; - static NetconfAccessor accessor; + static NetconfBindingAccessor accessor; static WebsocketManagerService notificationService; - + static NodeId nNodeId = new NodeId("nSky"); @BeforeClass public static void init() throws InterruptedException, IOException { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); faultService = mock(FaultService.class); notificationService = mock(WebsocketManagerService.class); @@ -74,10 +82,11 @@ public class TestOpenRoadmAlarmNotification { @Test public void testNotification() { severity = Severity.Critical; + when(accessor.getNodeId()).thenReturn(nNodeId); when(serviceProvider.getFaultService()).thenReturn(faultService); when(serviceProvider.getWebsocketService()).thenReturn(notificationService); OpenroadmFaultNotificationListener alarmListener = - new OpenroadmFaultNotificationListener(serviceProvider); + new OpenroadmFaultNotificationListener(accessor, serviceProvider); notification = mock(AlarmNotification.class); when(notification.getId()).thenReturn(myId); |