A modern Java project

This group takes one small service from the model to a container image, with the JDK and nothing else. The domain is a book-loan desk: loans with due dates, a state that says whether a loan is on time, due soon, overdue or returned, and four routes that answer JSON. It is deliberately not capstone 3: the tasks there have a boolean, the loans here have a date and a sealed state, the port is 8091, and every output is pinned to one day so two runs print the same thing.

The service is one source file that grows across the pages, plus a test class. A project of four files would be more realistic and would also break the page checker, which builds every block on its own; the pages say which part is new at each step, and the last pages show the whole file as the project ships it. Every command here was run in the container that wrote the page, and the outputs are the runs.

Model The model: loans and sealed states A record for a loan, a sealed state with four records, and the rule that turns a due date into one of them. Open JSON JSON written by hand Two character constants, a quote method, the state object and the array, with no library. Open Route The routes and their replies A reply record, the path table, the 200 and the 404, and the overdue filter. Open Server The HTTP server HttpServer on port 8091, one handler, the response length and a self test with HttpClient. Open Test Tests through the launcher Nine JUnit tests of the model, the JSON and the routes, and one request over a real socket. Open Jar The jar and the three tools A jar with a Main-Class, java -jar, and checkstyle, PMD and SpotBugs on the same sources. Open Pom The pom that is not run here The pom of the project and the offline plugin failure that stops the Maven build in this image. Open Docker The container image, shown only The Dockerfile of the jar, the serve mode it starts, and the reason no image is built here. Open