DTOs for anydata/anyxml are not generated within a list
[mdsal.git] / binding / mdsal-binding-generator-impl / src / test / java / org / opendaylight / mdsal / binding / generator / impl / CodecTypeUtilsTest.java
index aefc3f386aabe42ea0ca25a81e3e2368e2a6014b..5e16092dd6174984f85435c0206e9a745c0bec5d 100644 (file)
@@ -8,6 +8,8 @@
 package org.opendaylight.mdsal.binding.generator.impl;
 
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import static org.mockito.Mockito.mock;
 
 import java.lang.reflect.Constructor;
@@ -19,18 +21,19 @@ import org.opendaylight.yangtools.yang.binding.Identifier;
 public class CodecTypeUtilsTest {
 
     @Test
-    public void newIdentifiableItem() throws Exception {
+    public void newIdentifiableItem() {
         assertNotNull(CodecTypeUtils.newIdentifiableItem(Identifiable.class, mock(Identifier.class)));
     }
 
-    @Test(expected = UnsupportedOperationException.class)
-    public void privateConstructTest() throws Throwable {
+    @Test
+    public void privateConstructTest() throws NoSuchMethodException, ReflectiveOperationException {
         final Constructor<?> constructor = CodecTypeUtils.class.getDeclaredConstructor();
         constructor.setAccessible(true);
         try {
             constructor.newInstance();
+            fail();
         } catch (InvocationTargetException e) {
-            throw e.getCause();
+            assertTrue(e.getCause() instanceof UnsupportedOperationException);
         }
     }
 }
\ No newline at end of file