You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is unclear at the moment how dynamic tests should by supported by JGiven, as JUnit 5 provides no life-cycle hooks for them. Any suggestions are welcome!
JGiven could first prepare whatever is necessary, then call the lambda, and afterwards clear up after the lambda. This could offer some basic lifecycle handling. But I how would you take it from here? But I see that you might want to grab the first parameter "1st dynamic test", wouldn't you?
Activity
ahus1 commentedon Jan 2, 2017
Suggestion No 1: open a bug with JUnit5 :-) but maybe suggestion No 2 could allow to explore some scenarios first to make a point.
Suggestion No 2: I had cases where I wrapped lambdas with a static function. It would look like this:
dynamicTest("1st dynamic test", wrapForJGiven(() -> assertTrue(true)))JGiven could first prepare whatever is necessary, then call the lambda, and afterwards clear up after the lambda. This could offer some basic lifecycle handling. But I how would you take it from here? But I see that you might want to grab the first parameter "1st dynamic test", wouldn't you?
janschaefer commentedon Jan 2, 2017
Maybe JGiven could provide a method
dynamicJGivenTestthat is just a wrapper arounddynamicTest. That might even be easy to implement.ahus1 commentedon Jan 2, 2017
Like that - and you can capture the first argument as well.
janschaefer commentedon Jan 4, 2017
PR #289