- try {
- modificationTree.ready();
- fail("Should have failed with IAE");
- } catch (IllegalArgumentException e) {
- assertEquals("(urn:opendaylight:params:xml:ns:yang:list-constraints-validation-test-model?"
- + "revision=2015-02-02)unkeyed-list has too many elements (2), can have at most 1", e.getMessage());
- }
+ assertEquals("(urn:opendaylight:params:xml:ns:yang:list-constraints-validation-test-model?"
+ + "revision=2015-02-02)unkeyed-list has too many elements (2), can have at most 1",
+ assertThrows(MinMaxElementsValidationFailedException.class, () -> modificationTree.ready()).getMessage());