Report a dedicated exception on unique failure
[yangtools.git] / yang / yang-data-impl / src / test / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / UniqueConstraintTest.java
index 4db997ad8b11d1d6f7c7912407311a6f9e1a86b8..dbccc7be8ca6dd8ad259ae963b06588ff9abad58 100644 (file)
@@ -78,7 +78,8 @@ public class UniqueConstraintTest {
         final InMemoryDataTree inMemoryDataTree = emptyDataTree(TEST_MODEL, true);
 
 
-        verifyExceptionMessage(assertThrows(IllegalArgumentException.class, () -> writeMap(inMemoryDataTree, true)),
+        verifyExceptionMessage(assertThrows(UniqueValidationFailedException.class,
+            () -> writeMap(inMemoryDataTree, true)),
             "(foo?revision=2016-05-17)task[{(foo?revision=2016-05-17)task-id=",
             "}] violates unique constraint on [l2, l1] of ",
             "(foo?revision=2016-05-17)my-leaf-1",