Update docs conf.yaml version to Sulfur
[transportpce.git] / nbinotifications / src / test / java / org / opendaylight / transportpce / nbinotifications / impl / NbiNotificationsImplTest.java
index da825509a7470b57800f44e0da56c9720bf7cc39..825193f01fdc95c221dd0d0d144321cdda322474 100644 (file)
@@ -15,9 +15,13 @@ import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.transportpce.common.converter.JsonStringConverter;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.ConnectionType;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev201130.GetNotificationsServiceInputBuilder;
-import org.opendaylight.yang.gen.v1.nbi.notifications.rev201130.GetNotificationsServiceOutput;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.ConnectionType;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.GetNotificationsAlarmServiceInputBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.GetNotificationsAlarmServiceOutput;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.GetNotificationsProcessServiceInputBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.GetNotificationsProcessServiceOutput;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.NotificationAlarmService;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.NotificationProcessService;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
 public class NbiNotificationsImplTest extends AbstractTest {
@@ -25,26 +29,40 @@ public class NbiNotificationsImplTest extends AbstractTest {
 
     @Before
     public void setUp() {
-        JsonStringConverter<org.opendaylight.yang.gen.v1
-            .nbi.notifications.rev201130.NotificationService> converter = new JsonStringConverter<>(
+        JsonStringConverter<NotificationProcessService> converter = new JsonStringConverter<>(
                 getDataStoreContextUtil().getBindingDOMCodecServices());
-        nbiNotificationsImpl = new NbiNotificationsImpl(converter, "localhost:8080");
+        JsonStringConverter<NotificationAlarmService> converterAlarm = new JsonStringConverter<>(
+                getDataStoreContextUtil().getBindingDOMCodecServices());
+        nbiNotificationsImpl = new NbiNotificationsImpl(converter, converterAlarm,"localhost:8080");
     }
 
+    @Test
     public void getNotificationsServiceEmptyDataTest() throws InterruptedException, ExecutionException {
-        ListenableFuture<RpcResult<GetNotificationsServiceOutput>> result =
-                nbiNotificationsImpl.getNotificationsService(new GetNotificationsServiceInputBuilder().build());
-        assertNull("Should be null", result.get().getResult().getNotificationService());
+        ListenableFuture<RpcResult<GetNotificationsProcessServiceOutput>> result =
+                nbiNotificationsImpl.getNotificationsProcessService(
+                        new GetNotificationsProcessServiceInputBuilder().build());
+        assertNull("Should be null", result.get().getResult().getNotificationsProcessService());
     }
 
     @Test
     public void getNotificationsServiceTest() throws InterruptedException, ExecutionException {
-        GetNotificationsServiceInputBuilder builder = new GetNotificationsServiceInputBuilder();
-        builder.setGroupId("groupId");
-        builder.setIdConsumer("consumerId");
-        builder.setConnectionType(ConnectionType.Service);
-        ListenableFuture<RpcResult<GetNotificationsServiceOutput>> result =
-                nbiNotificationsImpl.getNotificationsService(builder.build());
-        assertNull("Should be null", result.get().getResult().getNotificationService());
+        GetNotificationsProcessServiceInputBuilder builder = new GetNotificationsProcessServiceInputBuilder()
+                .setGroupId("groupId")
+                .setIdConsumer("consumerId")
+                .setConnectionType(ConnectionType.Service);
+        ListenableFuture<RpcResult<GetNotificationsProcessServiceOutput>> result =
+                nbiNotificationsImpl.getNotificationsProcessService(builder.build());
+        assertNull("Should be null", result.get().getResult().getNotificationsProcessService());
+    }
+
+    @Test
+    public void getNotificationsAlarmServiceTest() throws InterruptedException, ExecutionException {
+        GetNotificationsAlarmServiceInputBuilder builder = new GetNotificationsAlarmServiceInputBuilder()
+                .setGroupId("groupId")
+                .setIdConsumer("consumerId")
+                .setConnectionType(ConnectionType.Service);
+        ListenableFuture<RpcResult<GetNotificationsAlarmServiceOutput>> result =
+                nbiNotificationsImpl.getNotificationsAlarmService(builder.build());
+        assertNull("Should be null", result.get().getResult().getNotificationsAlarmService());
     }
 }