I used Spock, and there is this brilliant @Unroll
annotation, which makes all the runs of test method look like separate tests.
Is there something like that for JUnit @Theory
? When @Theory
test method is run multiple times (with different parameters), it still looks like one method run in the IDE. I'd like to see each run separately.
this github project does this.
junit-theory-suite is a simple library that replaces the default JUnit theories runner with one that treats each individual combination of parameters as a distinct test case.
There is now a small JUnit tool tellingly called spockito from tools4j which offers an Unroll annotation similar to Spock's unroll feature.
Disclaimer: I am involved in tools4j and the spockito project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With