From: Joana Pires, back-end lead, Fernhill Garden Supply
"We're moving the order service to a new framework next quarter, and I want its rules written down as plain Java first, with tests, so the move can't change behavior by accident.
Build an Api class that answers request lines: list, create and read orders, validate sku and quantity, make creates safe to retry with an idempotency key, return JSON, and give every error the same problem-details body. No framework and no database: a map is fine."
Done looks like: every scripted request gets the right status and body, from routing through problem-details errors.
This project builds the part of a web service that frameworks don't write for you: the rules. A request arrives as a line of text; your Api class answers it with a status and a body. Each step adds one behavior and keeps everything before it, so your own code carries forward.
You will route requests to 200, 201, 404 and 405, validate the order fields, store orders with ids, make POST safe to retry with idempotency keys, return JSON bodies, and finish with one error format for every failure.
The tests send short scripts of requests and compare every answer, so a change that breaks an earlier rule shows up at once.
Each request is one line: method, path, then parameters.