Skip to content

Introduce @TestInstance.Lifecycle mode for "per class template invocation" #5029

@t-o-n-y-p

Description

@t-o-n-y-p

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions