Remove support for composite NotificationListener
[yangtools.git] / binding / mdsal-binding-model-ri / src / test / java / org / opendaylight / mdsal / binding / model / ri / BindingTypesTest.java
index 1588d001ce4ac7003c3edf2935ec286795e7d826..ea22004eb9aeb4790549a7d9708617314ccf5f2f 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.mdsal.binding.model.ri;
 
+import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertThrows;
@@ -19,12 +20,10 @@ import org.opendaylight.yangtools.yang.binding.Augmentation;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.DataRoot;
-import org.opendaylight.yangtools.yang.binding.Identifiable;
-import org.opendaylight.yangtools.yang.binding.Identifier;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.Key;
+import org.opendaylight.yangtools.yang.binding.KeyAware;
 import org.opendaylight.yangtools.yang.binding.Notification;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 
 public class BindingTypesTest {
     @Test
@@ -34,13 +33,9 @@ public class BindingTypesTest {
         assertEquals("BASE_IDENTITY", typeForClass(BaseIdentity.class), BindingTypes.BASE_IDENTITY);
         assertEquals("DATA_OBJECT", typeForClass(DataObject.class), BindingTypes.DATA_OBJECT);
         assertEquals("DATA_ROOT", typeForClass(DataRoot.class), BindingTypes.DATA_ROOT);
-        assertEquals("IDENTIFIABLE", typeForClass(Identifiable.class), BindingTypes.IDENTIFIABLE);
-        assertEquals("IDENTIFIER", typeForClass(Identifier.class), BindingTypes.IDENTIFIER);
+        assertEquals("KEY_AWARE", typeForClass(KeyAware.class), BindingTypes.KEY_AWARE);
+        assertEquals("KEY", typeForClass(Key.class), BindingTypes.KEY);
         assertEquals("INSTANCE_IDENTIFIER", typeForClass(InstanceIdentifier.class), BindingTypes.INSTANCE_IDENTIFIER);
-        assertEquals("NOTIFICATION", typeForClass(Notification.class), BindingTypes.NOTIFICATION);
-        assertEquals("NOTIFICATION_LISTENER", typeForClass(NotificationListener.class),
-            BindingTypes.NOTIFICATION_LISTENER);
-        assertEquals("RPC_SERVICE", typeForClass(RpcService.class), BindingTypes.RPC_SERVICE);
     }
 
     @Test
@@ -74,4 +69,16 @@ public class BindingTypesTest {
         final ParameterizedType augmentationType = BindingTypes.augmentation(Types.objectType());
         assertEquals("Augmentation", augmentationType.getName());
     }
+
+    @Test
+    public void testNotificationNull() {
+        assertThrows(NullPointerException.class, () -> BindingTypes.notification(null));
+    }
+
+    @Test
+    public void testNotification() {
+        final ParameterizedType notificationType = BindingTypes.notification(Types.objectType());
+        assertEquals(Types.typeForClass(Notification.class), notificationType.getRawType());
+        assertArrayEquals(new Object[] { Types.objectType() }, notificationType.getActualTypeArguments());
+    }
 }
\ No newline at end of file