X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-generator-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fgenerator%2Fimpl%2FCodecTypeUtilsTest.java;h=5e16092dd6174984f85435c0206e9a745c0bec5d;hb=4df2f71dd1bfc29cd5773d1cd2609c91a002e2b1;hp=aefc3f386aabe42ea0ca25a81e3e2368e2a6014b;hpb=c4d02d92b7125cb5b0aa2e67e3a8b5a7c6f92b21;p=mdsal.git diff --git a/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/CodecTypeUtilsTest.java b/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/CodecTypeUtilsTest.java index aefc3f386a..5e16092dd6 100644 --- a/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/CodecTypeUtilsTest.java +++ b/binding/mdsal-binding-generator-impl/src/test/java/org/opendaylight/mdsal/binding/generator/impl/CodecTypeUtilsTest.java @@ -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