Remove DataContainer.getImplementedInterface()
[mdsal.git] / binding / mdsal-binding-java-api-generator / src / test / java / org / opendaylight / mdsal / binding / java / api / generator / TypeUtilsTest.java
index ab25a370f57584d958b27ac0b47835a4a0857f2f..52a730ebe811b6ea6be75bd76a84afd0596e9db3 100644 (file)
@@ -8,11 +8,14 @@
 package org.opendaylight.mdsal.binding.java.api.generator;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 
 import com.google.common.collect.ImmutableList;
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import org.junit.Test;
 import org.opendaylight.mdsal.binding.model.api.ConcreteType;
 import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
@@ -48,14 +51,15 @@ public class TypeUtilsTest {
         TypeUtils.getBaseYangType(innerType);
     }
 
-    @Test(expected = UnsupportedOperationException.class)
-    public void constructTest() throws Throwable {
+    @Test
+    public void constructTest() throws ReflectiveOperationException {
         final Constructor<TypeUtils> constructor = TypeUtils.class.getDeclaredConstructor();
         constructor.setAccessible(true);
         try {
             constructor.newInstance();
-        } catch (Exception e) {
-            throw e.getCause();
+            fail();
+        } catch (InvocationTargetException e) {
+            assertTrue(e.getCause() instanceof UnsupportedOperationException);
         }
     }
 }
\ No newline at end of file