Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this adds unit test support to the project through
Maven Surefire Plugin (unit test execution)
JUnit5 (unit test framework)
Mockito (mocking framework)
so that future changes can just simply add (unit) tests without needing to set everything up
i choose those 3 as they appear to the most widly used within the java eco system
the example test is just a placeholder to make sure everything works and to serve as a minimal example for future tests. this can be removed once actual tests have been added later
junit-platform.properties is setup to run all tests in parallel and random order. both to help uncover (hidden) dependencies between tests (that should not be there), parallel may also improve execution time (not that unit tests should take that long to begin with). should the need for sequential or ordered test execution arise, there are annotations from junit to control this on a per test(class) bases see here and here
an additional github workflow was not added, as the existing build workflow runs package which already includes the test phase
one unfortunate thing with mockito is that the mock method produces an unchecked warning. and based on this 2018 issue its not super high on their list. this could be sidestepped by have the mockobject as a class member using @Mock, but that requires more boilerplate