Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unit test framework #171

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

StillGreen-san
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant