zerocode icon indicating copy to clipboard operation
zerocode copied to clipboard

org.junit.jupiter.api.Test support

Open FeiFelixPeng opened this issue 5 years ago • 2 comments

Hello, Thanks for the amazing framework. I'm rookie for java and zerocode.

And i found currently, looks like only org.junit.Test(Junit4) can work with @Scenario("xx/xx/xx.json") as below for contract test: @Test @Scenario("xx/xx/xx.json")

and will get the following error if we replace "org.junit.Test"(junit4) as "org.junit.jupiter.api.Test"(junit5) ==================clip=================== org.junit.runners.model.InvalidTestClassError: Invalid test class 'packages.tests.pub.api.xxx.xxx':

  1. No runnable methods =======================================

is there any plan to support org.junit.jupiter.api.Test with @Scenario("xx/xx/xx.json") ?

FeiFelixPeng avatar Jun 30 '20 11:06 FeiFelixPeng

Hi Rookie @FeiFelixPeng, You are right if you switch, you get the above error. Just trying to understand, why do you have to switch? Any use case which is compelling to switch?

Note:

Junit4/Jupiter also comes with the vintage engine out-of-the-box. Meaning: they are not mutually-exclusive.

Which means Junit5 JUnit4 tests can coexist without any problems.

Here are some pointers from the official guide:

Since all classes and annotations specific to JUnit Jupiter reside under a new org.junit.jupiter base package, having both JUnit 4 and JUnit Jupiter in the classpath does not lead to any conflicts.

Happy to hear about your usecase ✌️

authorjapps avatar Jun 30 '20 15:06 authorjapps

I would also like this feature. Having to maintain second configuration is a bit of a pain at times

bstoilov avatar Aug 20 '21 13:08 bstoilov