It’s funny beacause it happened to me before, so I knew how to fix this problem.
Instead, when calling from the command line
mvn test, Maven uses the maven-surefire-plugin to execute the tests. In its documentation it says that the default configuration, which I can’t be bothered to change, is to pick up every file name that matches this expressions:
A typo like NullCheckerTests, instead of NullCheckerTest prevents the tests in the class from being executed because the class it’s just ignored during test execution.
The solution it’s easy, following naming conventions, I think it’s nice to call all my test with an ending *Test in the name of the file and class, after all if you’re declaring an xxx test class, so it should be called
XxxTest in a file named
An example of the problem and the relative solution can be found here.
I thought that sharing this issue could be useful if anybody encountered the same problem.
By the way, because of this issue I released version 1.0.5 of utils.