A scenario matrix for every endpoint
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
list the cases an endpoint needs before writing tests.
Planned topics
- For each endpoint list: success, validation failure, unauthenticated (401), unauthorized (403), not found (404), conflict or business-rule failure.
- Write the matrix as a table first; each row becomes a test.
- Check the error body shape too, not just the status code.
- Add boundary data: empty, too long, negative, duplicate.
- Keep the matrix in the repository next to the tests.
Draft outline details
Demonstration
a matrix for POST /api/orders: valid (201), empty cart (400), no token (401), other user's cart (403), unknown product (404), out of stock (409).
Check your understanding
Which two status codes separate "not logged in" from "not allowed"?
Show answer
401 and 403.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.