Why do JUnit 5 tests not inherit @Test annotation from abstract classes?

烈酒焚心 提交于 2019-12-04 05:20:32
Sormuras

That's an unintentional difference between JUnit 4 and JUnit Jupiter.

See details at https://github.com/junit-team/junit5/issues/960

Edit: after further investigation it seems that this (convenient) behavior from JUnit 4 is actually unintended. See Sam's latest comment at https://github.com/junit-team/junit5/issues/960#issuecomment-316114648

I suppose you are trying to build some sort of relationship among your test methods. Try if you can use @Nested.
You can find a sample here

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