JUnit 集成测试的 'IT.java' 文件名后缀(而不是 'Test.java')是一种约定吗?

Is the 'IT.java' filename Suffix (instead of 'Test.java') for JUnit Integration Tests a convention?

我习惯于在末尾使用 *Test.java 命名我的 JUnit 集成测试,例如 DatabaseConnectionTest.java 并将它们放在它们自己的集成测试目录中:例如 test/integration/com...

在加入一个新项目时,我得到了指导

No, all the Tests go in the one directory, and we distinguish the Unit Tests from the Integration tests by pattern matching on the file name suffix.

所以我上面的文件会变成 DatabaseConnectionIT.java

现在我明白其中的逻辑了。测试运行脚本可以只对它正在寻找的文件进行模式匹配,所有的测试都在一个位置。

但我从未听说过该公约。

我的问题是:JUnit 集成测试的 'IT.java' 文件名后缀(而不是 'Test.java')是一种约定吗?

IT.java后缀是Maven Failsafe Plugin. All classes in the test directory that have the suffix IT are executed by this plugin in the integragion-test phase. (Tests with suffix Test are exectued by the Maven Surefire Plugintest阶段使用的约定。)