import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
import org.opendaylight.restconf.common.errors.RestconfError;
import org.opendaylight.restconf.common.errors.RestconfError.ErrorTag;
-import org.opendaylight.restconf.common.errors.RestconfError.ErrorType;
import org.opendaylight.restconf.common.schema.SchemaExportContext;
import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
import org.opendaylight.restconf.nb.rfc8040.utils.RestconfConstants;
+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.data.api.YangInstanceIdentifier;
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> ParserIdentifier.toInstanceIdentifier("/yang-ext:mount", SCHEMA_CONTEXT,
Optional.of(this.mountPointService)));
- 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", ErrorTag.RESOURCE_DENIED_TRANSPORT, ex.getErrors().get(0).getErrorTag());
}
public void makeQNameFromIdentifierInvalidIdentifierNegativeTest() {
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> ParserIdentifier.makeQNameFromIdentifier(TEST_MODULE_REVISION + "/" + TEST_MODULE_NAME));
- 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.INVALID_VALUE,
ex.getErrors().get(0).getErrorTag());
assertEquals("Not expected error status code", 400, ex.getErrors().get(0).getErrorTag().getStatusCode());
public void makeQNameFromIdentifierTooShortIdentifierNegativeTest() {
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> ParserIdentifier.makeQNameFromIdentifier(TEST_MODULE_NAME));
- 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.INVALID_VALUE,
ex.getErrors().get(0).getErrorTag());
assertEquals("Not expected error status code", 400, ex.getErrors().get(0).getErrorTag().getStatusCode());
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> ParserIdentifier.makeQNameFromIdentifier(
MOUNT_POINT_IDENT + "/" + TEST_MODULE_REVISION + "/" + TEST_MODULE_NAME));
- 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.INVALID_VALUE,
ex.getErrors().get(0).getErrorTag());
assertEquals("Not expected error status code", 400, ex.getErrors().get(0).getErrorTag().getStatusCode());
public void makeQNameFromIdentifierMountPointTooShortIdentifierNegativeTest() {
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> ParserIdentifier.makeQNameFromIdentifier(MOUNT_POINT_IDENT + "/" + TEST_MODULE_NAME));
- 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.INVALID_VALUE,
ex.getErrors().get(0).getErrorTag());
assertEquals("Not expected error status code", 400, ex.getErrors().get(0).getErrorTag().getStatusCode());
public void makeQNameFromIdentifierEmptyIdentifierNegativeTest() {
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> ParserIdentifier.makeQNameFromIdentifier(""));
- 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.INVALID_VALUE,
ex.getErrors().get(0).getErrorTag());
assertEquals("Not expected error status code", 400, ex.getErrors().get(0).getErrorTag().getStatusCode());
public void makeQNameFromIdentifierDoubleSlashNegativeTest() {
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> ParserIdentifier.makeQNameFromIdentifier(TEST_MODULE_NAME + "//" + TEST_MODULE_REVISION));
- 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.INVALID_VALUE,
ex.getErrors().get(0).getErrorTag());
assertEquals("Not expected error status code", 400, ex.getErrors().get(0).getErrorTag().getStatusCode());
RestconfDocumentedException ex = assertThrows(RestconfDocumentedException.class,
() -> ParserIdentifier.toSchemaExportContextFromIdentifier(
SCHEMA_CONTEXT, TEST_MODULE_REVISION + "/" + TEST_MODULE_NAME, null, sourceProvider));
- 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.INVALID_VALUE,
ex.getErrors().get(0).getErrorTag());
assertEquals("Not expected error status code", 400, ex.getErrors().get(0).getErrorTag().getStatusCode());
MOUNT_POINT_IDENT + "/" + TEST_MODULE_REVISION + "/" + TEST_MODULE_NAME, this.mountPointService,
sourceProvider));
- 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.INVALID_VALUE,
ex.getErrors().get(0).getErrorTag());
assertEquals("Not expected error status code", 400, ex.getErrors().get(0).getErrorTag().getStatusCode());