Use assertThrows() in more componments
[yangtools.git] / yang / rfc6643-parser-support / src / test / java / org / opendaylight / yangtools / rfc6643 / parser / ObjectIdentifierTest.java
index 0529558c990e87ff78a51e65f04d4989716659e1..7aa5334088315982147fd22f854132b6042845ad 100644 (file)
@@ -7,12 +7,14 @@
  */
 package org.opendaylight.yangtools.rfc6643.parser;
 
+import static org.junit.Assert.assertThrows;
+
 import org.junit.Test;
 import org.opendaylight.yangtools.rfc6643.model.api.ObjectIdentifier;
 
 public class ObjectIdentifierTest {
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testObjectIdentifierCreationWithBadOID() {
-        ObjectIdentifier.forString("bad oid");
+        assertThrows(IllegalArgumentException.class, () -> ObjectIdentifier.forString("bad oid"));
     }
 }