Add BindingTypes.augmentation()
[mdsal.git] / binding / mdsal-binding-generator-util / src / test / java / org / opendaylight / mdsal / binding / model / util / BindingTypesTest.java
index 79876b771b15ff4fddd0ee9c00311a8991809791..f271337f9f897e485c1c37a0059a6a15ff1ce2dd 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertNotNull;
 import static org.opendaylight.mdsal.binding.model.util.Types.typeForClass;
 
 import org.junit.Test;
+import org.opendaylight.mdsal.binding.model.api.ParameterizedType;
 import org.opendaylight.yangtools.yang.binding.Augmentable;
 import org.opendaylight.yangtools.yang.binding.Augmentation;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
@@ -54,11 +55,23 @@ public class BindingTypesTest {
 
     @Test
     public void testAugmentable() {
-        assertNotNull(BindingTypes.augmentable(Types.objectType()));
+        ParameterizedType augmentableType = BindingTypes.augmentable(Types.objectType());
+        assertEquals("Augmentable", augmentableType.getName());
     }
 
     @Test
     public void testChildOf() {
         assertNotNull(BindingTypes.childOf(Types.objectType()));
     }
+
+    @Test(expected = NullPointerException.class)
+    public void testAugmentationNull() {
+        BindingTypes.augmentation(null);
+    }
+
+    @Test
+    public void testAugmentation() {
+        ParameterizedType augmentationType = BindingTypes.augmentation(Types.objectType());
+        assertEquals("Augmentation", augmentationType.getName());
+    }
 }
\ No newline at end of file