import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
import org.opendaylight.restconf.common.errors.RestconfError;
import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
+import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.Revision;
import org.opendaylight.yangtools.yang.common.Uint8;
public void prepareQnameNotValidContainerNameNegativeTest() {
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> YangInstanceIdentifierDeserializer.create(SCHEMA_CONTEXT, "deserializer-test:contA/leafB"));
- assertEquals("Not expected error type", RestconfError.ErrorType.PROTOCOL, ex.getErrors().get(0).getErrorType());
+ assertEquals("Not expected error type", ErrorType.PROTOCOL, ex.getErrors().get(0).getErrorType());
assertEquals("Not expected error tag", RestconfError.ErrorTag.DATA_MISSING,
ex.getErrors().get(0).getErrorTag());
}
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> YangInstanceIdentifierDeserializer.create(SCHEMA_CONTEXT,
"deserializer-test:list-no-key/disabled=false"));
- assertEquals("Not expected error type", RestconfError.ErrorType.PROTOCOL, ex.getErrors().get(0).getErrorType());
+ assertEquals("Not expected error type", ErrorType.PROTOCOL, ex.getErrors().get(0).getErrorType());
assertEquals("Not expected error tag", RestconfError.ErrorTag.DATA_MISSING,
ex.getErrors().get(0).getErrorTag());
}
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> YangInstanceIdentifierDeserializer.create(SCHEMA_CONTEXT,
"deserializer-test:list-multiple-keys=%3Afoo/string-value"));
- assertEquals("Not expected error type", RestconfError.ErrorType.PROTOCOL, ex.getErrors().get(0).getErrorType());
+ assertEquals("Not expected error type", ErrorType.PROTOCOL, ex.getErrors().get(0).getErrorType());
assertEquals("Not expected error tag", RestconfError.ErrorTag.MISSING_ATTRIBUTE,
ex.getErrors().get(0).getErrorTag());
assertEquals("Not expected error status code", 400, ex.getErrors().get(0).getErrorTag().getStatusCode());
public void leafListMissingKeyNegativeTest() {
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> YangInstanceIdentifierDeserializer.create(SCHEMA_CONTEXT, "deserializer-test:leaf-list-0="));
- assertEquals("Not expected error type", RestconfError.ErrorType.PROTOCOL, ex.getErrors().get(0).getErrorType());
+ assertEquals("Not expected error type", ErrorType.PROTOCOL, ex.getErrors().get(0).getErrorType());
assertEquals("Not expected error tag", RestconfError.ErrorTag.MISSING_ATTRIBUTE,
ex.getErrors().get(0).getErrorTag());
assertEquals("Not expected error status code", 400, ex.getErrors().get(0).getErrorTag().getStatusCode());