Where should I put interface class for Junit @Category?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 19:38:57

Create a new Maven module and put the interface under src/main/java/. Make sure junit is available as a compile time dependency (<scope>compile</scope>) - you're basically building a dependency that other tests can use. So your code that helps other tests must go into main while the tests for this go in the src/test/java, as usual.

This step feels a bit weird but think about how you would package junit itself. From the point of view of junit, it's just a normal Java library, so all its code goes into main.

When you need this module, use it as a test dependency with <scope>test</scope>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!