Middle
What checklist of checks would you consider for testing a GET API, where instead of employee documents, company documents are requested?
sobes.tech AI
Answer from AI
To test the GET API, where documents are requested for a company instead of an employee, the following checklist should be considered:
- Verification of URL correctness and request parameters: ensure that requests are formed correctly, for example, with the correct company ID.
- Response status: should be 200 OK for a successful request.
- Response format and structure: verify that a list of documents related specifically to the company is returned, not to the employee.
- Content verification: ensure that the response does not contain employee documents, only company documents.
- Error handling: check behavior when a non-existent company ID is used (e.g., 404 or empty list).
- Pagination and filters: if supported by the API, verify their correct operation.
- Security tests: ensure that access to company documents is only granted to authorized users with the necessary rights.
- Performance testing: check the API response time with large volumes of data.
This checklist will help ensure that the API returns exactly the documents related to the company, not to an employee.