JUnit 5 in practice
Five lessons that put the parts together. A calculator is taken end to end: the class, one test per operation, a failing case, the fix and the whole report. A generic stack comes next, with push, pop and the exception of an empty stack, and a parameterised test that runs the same cases over two types. Text and Unicode follow, where a line ending and an invisible character make an assertion fail for a reason the reader cannot see. A service and its fake show a test that runs without the slow implementation and counts the calls it made. The capstone is a task tracker: a model, a store, a service, a parameterised test, an exception test and one red run that is read and fixed.