-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
Hi all.
I'm in the process of migrating from 5.11.3 to 6.0.0 right now, and I'm trying to implement class templates instead of test class inheritance.
Right now I'm able to have one test instance per child class with no issues using @TestInstance(TestInstance.Lifecycle.PER_CLASS) on a parent class.
The problem with class templates is that the annotation creates just one test instance for all invocations, which might cause concurrency issues because of different field values in a class template.
I wish I could have one more test lifecycle mode, PER_CLASS_INVOCATION.
For regular test classes it would work exactly like PER_CLASS, but for class templates it would create one test instance per invocation.