TLDR
Improving unit test coverage for multiple Actions and Transitions. Introducing the structure for acceptance / integration tests, to cover various game scenarios that should / should not be legal.

Main work
- Using ChatGPT to scaffold integration test files based off of existing test files and JUnit docs.
- Adding first test for
Transitions. - Mocking the random number generator that used during player rolls.
Challenges
- Java has a billion integration testing frameworks. I decided to just make HTTP requests directly against my controller class, then I manually assert the results I expect.
- I could probably find a dependency for integration testing that would make this quicker in the long term, but that research could also be the nail in the coffin that makes me lose interest in this project. :O
- Always burdensome trying to mock static methods. Luckily, my first attempt worked.
Learnings
- There is a
try-with-resourcesyntax in Java that will automatically handle.close()calls on objects that need teardown. For example, mocking the static methodgenerateRandomNumber()requires cleanup so that other tests are not impacted by the mock unintentionally.