Maven test isn't picking up JUnit 4 Tests unless class ends with Test on a multi-module project

后端 未结 1 1076
粉色の甜心
粉色の甜心 2020-12-19 01:42

Apache Maven 3.0 (r1004208; 2010-10-04 12:50:56+0100)

running

mvn test

ignores any JUnit 4

相关标签:
1条回答
  • 2020-12-19 02:22

    That's the standard configuration in the maven surefire plugin.

    By default, the Surefire Plugin will automatically include all test classes with the following wildcard patterns:

    • "*/Test.java" - includes all of its subdirectories and all java filenames that start with "Test".
    • "**/*Test.java" - includes all of its subdirectories and all java filenames that end with "Test".
    • "**/*TestCase.java" - includes all of its subdirectories and all java filenames that end with "TestCase".

    Source: Inclusions and Exclusions of Tests (this article also shows how you can add additional test class patterns).

    0 讨论(0)
提交回复
热议问题