Fix checkstyle in mdsal-binding-generator-impl
[mdsal.git] / binding / mdsal-binding-generator-impl / src / test / java / org / opendaylight / mdsal / binding / generator / impl / YangTextTemplateTest.java
index facdb2a8ec47f4f43930cd2ad0f2ab4d7384901c..d499cea1eae8296d4a87c4d04440233d1900bf47 100644 (file)
@@ -7,21 +7,24 @@
  */
 package org.opendaylight.mdsal.binding.generator.impl;
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import org.junit.Test;
 import org.opendaylight.mdsal.binding.model.util.FormattingUtils;
 
 public class YangTextTemplateTest {
-
-    @Test(expected = UnsupportedOperationException.class)
-    public void privateConstructTest() throws Throwable {
+    @Test
+    public void privateConstructTest() throws ReflectiveOperationException  {
         final Constructor<FormattingUtils> constructor = FormattingUtils.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