Refactor NBINotification & add ServiceListener tests
[transportpce.git] / nbinotifications / src / test / java / org / opendaylight / transportpce / nbinotifications / impl / NbiNotificationsImplTest.java
index 9de03934c29522d7bc7a8c5fd9b8cf941cf81718..c121eb75a28c852bb7a4cd25420d353965700d8f 100644 (file)
@@ -16,6 +16,8 @@ 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.rev210628.GetNotificationsAlarmServiceInputBuilder;
+import org.opendaylight.yang.gen.v1.nbi.notifications.rev210628.GetNotificationsAlarmServiceOutput;
 import org.opendaylight.yang.gen.v1.nbi.notifications.rev210628.GetNotificationsServiceInputBuilder;
 import org.opendaylight.yang.gen.v1.nbi.notifications.rev210628.GetNotificationsServiceOutput;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -34,6 +36,7 @@ public class NbiNotificationsImplTest extends AbstractTest {
         nbiNotificationsImpl = new NbiNotificationsImpl(converter, converterAlarm,"localhost:8080");
     }
 
+    @Test
     public void getNotificationsServiceEmptyDataTest() throws InterruptedException, ExecutionException {
         ListenableFuture<RpcResult<GetNotificationsServiceOutput>> result =
                 nbiNotificationsImpl.getNotificationsService(new GetNotificationsServiceInputBuilder().build());
@@ -42,12 +45,23 @@ public class NbiNotificationsImplTest extends AbstractTest {
 
     @Test
     public void getNotificationsServiceTest() throws InterruptedException, ExecutionException {
-        GetNotificationsServiceInputBuilder builder = new GetNotificationsServiceInputBuilder();
-        builder.setGroupId("groupId");
-        builder.setIdConsumer("consumerId");
-        builder.setConnectionType(ConnectionType.Service);
+        GetNotificationsServiceInputBuilder builder = new GetNotificationsServiceInputBuilder()
+                .setGroupId("groupId")
+                .setIdConsumer("consumerId")
+                .setConnectionType(ConnectionType.Service);
         ListenableFuture<RpcResult<GetNotificationsServiceOutput>> result =
                 nbiNotificationsImpl.getNotificationsService(builder.build());
         assertNull("Should be null", result.get().getResult().getNotificationService());
     }
+
+    @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().getNotificationAlarmService());
+    }
 }