How to specify which @Tag should be used for JUnit in IntelliJ IDEA

拟墨画扇 提交于 2019-12-17 20:45:09

问题


Is there a way to specify from the build in JUnit5 Runner of IntelliJ that only test methods with specific @Tag should be tested (or the opposite, that all tests except those with a specific @Tag, should be executed)?

I know how to do it with maven, but is it possible with just the IntelliJ UI?

Best regards, Dieter


回答1:


With https://youtrack.jetbrains.com/issue/IDEA-163481 fixed, it is now possible since IJ 2018.1 -- for details see @Nicolau 's answer.




回答2:


Now it is possible with Intellij IDEA 2018.1:

See Tag Expressions to select which tests to execute according with their tagging.


Also, you can take a look at this answer for details on how to achieve the same goal using maven-surefire-plugin.



来源:https://stackoverflow.com/questions/44294074/how-to-specify-which-tag-should-be-used-for-junit-in-intellij-idea

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