⚙️ Setup & Project Structure
Setup & Project Structure: The pom.xml + BaseTest class is like the "jig frame" on a car assembly line: once the frame is set, every car in the production run passes through it —
The pom.xml + BaseTest class is like the "jig frame" on a car assembly line: once the frame is set, every car in the production run passes through it — the welding robot does not rebuild the frame from scratch each time. "I can write baseUri directly in every test — why extract it to a separate BaseTest?" Because if you repeat the baseUri, auth header, and logging config in every test class, the day the staging URL swaps with the production URL you will have to fix 70 test files one by one — that is the difference between 70 edits and 1. In Java, when you wire up a JUnit test fixture with @BeforeAll, the `RestAssured.baseURI` line in BaseTest does the same thing: write once, always valid. The critical QA point: in a CI/CD pipeline, staging and production must be tested with the same code; a single `System.getenv("BASE_URL")` in BaseTest achieves this and prevents the wrong test hitting the wrong environment.
Maven pom.xml — All Dependencies
Micro Lab: REST Assured assertion writing
Replace the TODO line with the critical line from the expected solution. This is not a real runtime; the goal is to reinforce writing the correct structure in a controlled way.
What Role Does Each of the 8 pom.xml Dependencies Play?
The rest-assured + json-path +…
The `rest-assured` + `json-path` + `json-schema-validator` TRIO handles the request/response chain, value extraction, and contract validation respectively — all ` test `, never leaking into the production jar.
junit-jupiter RUNS the tests…
`junit-jupiter` RUNS the tests, `hamcrest` writes assertions READABLY — two different jobs, one is meaningless without the other.
jackson-databind is NOT optional…
`jackson-databind` is NOT optional despite the comment saying so: it is EXACTLY the library that converts POJOs to JSON — without it, `body(request)` compiles but blows up at runtime.
lombok is provided …
`lombok` is ` provided ` — it generates getters/setters only at COMPILE time, it ADDS no code to the running application.
Project Folder Structure