Equivalent for @RunWith(JUnitPlatform.class) for JUnit5

老子叫甜甜 提交于 2021-02-19 02:08:55

问题


In my project I'm doing some cleanup and decided to move everything to JUnit5.

Till this time, I was using

@RunWith(JUnitPlatform.class)

Now I want to migrate it to @ExtendWith. Is there any equivalent for this JUnitPlatform.class in JUnit5?


回答1:


You don't need it anymore when using junit 5.

In the junit documentation it states:

Annotating a class with @RunWith(JUnitPlatform.class) allows it to be run with IDEs and build systems that support JUnit 4 but do not yet support the JUnit Platform directly.

So since you are migrating to junit 5 I suppose your build system/IDE supports it. Hence, you don't need the annotation anymore.



来源:https://stackoverflow.com/questions/57462395/equivalent-for-runwithjunitplatform-class-for-junit5

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