I have a a test class which is named xxxTest.java so the test class if found. But the unit tests within the class are not run when I execute mvn test.
I am using JUnit 4 and the test method’s are annotated with @Test. eg.
@Test
public void shouldDoSomeAsserting() {
// unit test impl
}
If I rename that test method so it is name testShouldDoSomeAsserting() then mvn test does find and execute that unit test.
I was under the impression that when I use @Test as long as the method was public and void that it would be considered a test method.
Have I missed something?
Thanks.
I’ve got it working by manually specifying a provider; more details here: Surefire JUnit 4 config