Bump upstreams
[netconf.git] / restconf / restconf-nb / src / test / java / org / opendaylight / restconf / nb / rfc8040 / databind / JsonResourceBodyTest.java
index f1c3dcb122854e627b42b6720606df694e7a8cc4..5efba38bb415039425e03937eda151df3a9f47be 100644 (file)
@@ -8,8 +8,6 @@
 package org.opendaylight.restconf.nb.rfc8040.databind;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Map;
 import org.junit.jupiter.api.Test;
@@ -109,14 +107,17 @@ class JsonResourceBodyTest extends AbstractResourceBodyTest {
 
     @Test
     void testMissingKeys() {
-        final var ex = assertThrows(IllegalArgumentException.class,
-            () -> parse("nested-module:depth1-cont/depth2-list2=one,two", """
+        final var error = assertError(() -> parse("nested-module:depth1-cont/depth2-list2=one,two", """
                 {
                   "depth2-list2" : {
                     "depth3-lf1-key" : "one"
                   }
                 }"""));
-        assertNull(ex.getMessage());
+        assertEquals("""
+            Error parsing input: List entry (urn:nested:module?revision=2014-06-03)depth2-list2 is missing leaf values \
+            for [depth3-lf2-key]""", error.getErrorMessage());
+        assertEquals(ErrorType.PROTOCOL, error.getErrorType());
+        assertEquals(ErrorTag.MALFORMED_MESSAGE, error.getErrorTag());
     }
 
     @Test