Migrate concepts tests to use assertThrows()
[yangtools.git] / common / concepts / src / test / java / org / opendaylight / yangtools / concepts / AbstractIllegalArgumentCodecTest.java
index da8b624fc7d620f84cff2e6a2ce9b44d246790ef..fe11a9b4843fa3487ef0d752ea85a49c7e7e65de 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.yangtools.concepts;
 
+import static org.junit.Assert.assertThrows;
+
 import org.junit.Test;
 
 public class AbstractIllegalArgumentCodecTest {
@@ -24,13 +26,13 @@ public class AbstractIllegalArgumentCodecTest {
 
     private final TestCodec codec = new TestCodec();
 
-    @Test(expected = NullPointerException.class)
+    @Test
     public void testNullDeserialize() {
-        codec.deserialize(null);
+        assertThrows(NullPointerException.class, () -> codec.deserialize(null));
     }
 
-    @Test(expected = NullPointerException.class)
+    @Test
     public void testNullSerialize() {
-        codec.serialize(null);
+        assertThrows(NullPointerException.class, () -> codec.serialize(null));
     }
 }