Middle
Imagine you need to test a new GET endpoint that returns ID and name by ID. List the checks from the most to the least priority.
sobes.tech AI
Answer from AI
-
Verification of successful response with correct ID:
- Status code 200
- Response body contains fields
idandnamewith correct values
-
Verification of handling a non-existent ID:
- Status code 404 or other, according to the specification
- Correct error message
-
Verification of handling an incorrectly formatted ID:
- For example, a string instead of a number
- Status code 400 (Bad Request)
-
Verification of endpoint response time (performance)
-
Security verification:
- No leakage of unnecessary data
- Authorization/authentication if required
-
Verification of boundary values of ID (e.g., minimum and maximum allowed ID)
-
Verification that repeated requests with the same ID return the same result
-
Verification that there are no extra fields in the response
-
Verification of the correctness of response headers (Content-Type, CORS, etc.)
Example curl request:
curl -X GET "https://api.example.com/resource/123" -H "Accept: application/json"