errors_test.go | |
---|---|
Copyright 2023 Red Hat, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
|
TestRouterMissingParamError checks the method Error() for data structure RouterMissingParamError |
|
expected error value |
|
construct an instance of error interface |
|
check if error value is correct |
|
TestRouterParsingError checks the method Error() for data structure RouterParsingError |
|
expected error value |
|
construct an instance of error interface |
|
check if error value is correct |
|
TestNoContentError checks the method Error() for data structure NoContentError |
|
expected error value |
|
construct an instance of error interface |
|
check if error value is correct |
|
TestUnauthorizedError checks the method Error() for data structure UnauthorizedError |
|
expected error value |
|
construct an instance of error interface |
|
check if error value is correct |
|
TestForbiddenError checks the method Error() for data structure ForbiddenError |
|
expected error value |
|
construct an instance of error interface |
|
check if error value is correct |
|
TestNoBodyError checks the method Error() for data structure NoBodyError |
|
expected error value |
|
construct an instance of error interface |
|
check if error value is correct |
|
TestValidationError checks the method Error() for data structure ValidationError |
|
expected error value |
|
construct an instance of error interface |
|
check if error value is correct |
|
TestItemNotFoundError checks the method Error() for data structure ItemNotFoundError. |
|
expected error value |
|
construct an instance of error interface |
|
check if error value is correct |
|
TestHandleServer error check the function HandleServerError defined in errors.go |
|
check the behaviour with all error types defined in this package |
|
we need to retriev json.UnmarshalTypeError so let's try to unmarshal "foo" string into an integer |
|
/ test with json.UnmarshalTypeError |
|
error can be nil |
|
testResponse function uses HTTP server mock to check server response handlers |
|