I took the liberty to "destaticise" the main static methods so that it was easier to target inside of the tests. Take note that some of the styling changes were automatically applied by Intellij so I apologise in advance for that, if it needs to be rolled back let me know.
I leveraged Parameterized testing to allow for a broader spectrum of coverage without too much fixture setup
The tests are laid out in the division of options and type, I have split the named types from the noarg types
Let me know if the coverage is not good enough and I can add more usecases to the tests, these tests are just covering the "happy path". Also I did not test every permutation of options.
What did I do?
As per this comment: https://github.com/cowtowncoder/java-uuid-generator/issues/87#issuecomment-2155763312, I wrote some tests for Jug.
I took the liberty to "destaticise" the main static methods so that it was easier to target inside of the tests. Take note that some of the styling changes were automatically applied by Intellij so I apologise in advance for that, if it needs to be rolled back let me know.
The general gist of the work is, run through the
run
method, swap out the System.out and System.err outputStreams using: https://stackoverflow.com/questions/1119385/junit-test-for-system-out-printlnExtra notes
Let me know if the coverage is not good enough and I can add more usecases to the tests, these tests are just covering the "happy path". Also I did not test every permutation of options.