sageserpent-open / americium

Generation of test case data for Scala and Java, in the spirit of QuickCheck. When your test fails, it gives you a minimised failing test case and a way of reproducing the failure immediately.
MIT License
15 stars 1 forks source link

Running a Trials in a nested Junit5 test class #44

Closed rpolton closed 2 years ago

rpolton commented 2 years ago

When Trials is initialised inside a junit5 nested test class, the junit5-integration annotations can't find the class-local Trials because they can't be static

sageserpent-open commented 2 years ago

@rpolton - checking here, is this simply due to not using the correct lifecycle, as described here: https://github.com/sageserpent-open/americium/blob/905a5dde719096d0446f2f98e6ac66fba15de6f6/README.markdown?plain=1#L903 ?

I'm unsure as to whether this is simply an instance versus static field issue engendered by the use of a nested class, or down to some other aspect, possibly reflection looking on the wrong place.

Would you add a minimal reproduction to this ticket, please?

rpolton commented 2 years ago

I can confirm that this is due to the @TestInstance annotation being missing from the @Nested test class. Not an issue, therefore 👍

sageserpent-open commented 2 years ago

Thanks for checking @rpolton - dodged a bullet there. 😄