Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lifecycle methods for parameterized containers #4352

Open
2 tasks
marcphilipp opened this issue Feb 27, 2025 · 1 comment
Open
2 tasks

Add lifecycle methods for parameterized containers #4352

marcphilipp opened this issue Feb 27, 2025 · 1 comment

Comments

@marcphilipp
Copy link
Member

Follow-up on #4320.

In addition to the existing @BeforeAll, @BeforeEach, @AfterEach, and @AfterAll lifecycle methods, we should add introduce @BeforeArgumentSet/@AfterArgumentSet annotations that can be declared on static (unless TestInstance.Lifecycle.PER_CLASS is used) methods of the test class that will be executed once per argument set before/after all test methods and nested classes in a @ParameterizedContainer class.

Since those methods are usually static, they won't have access to the resolved parameters. Therefore, and for compatibility with JUnit 4's @BeforeParams/@AfterParams methods, we should support injecting them as method parameters of those lifecycle methods.

Deliverables

  • Introduce @BeforeArgumentSet/@AfterArgumentSet lifecycle methods for @ParameterizedContainer classes
  • Add support for passing the resolved arguments of the current invocation to those lifecycle methods
@marcphilipp
Copy link
Member Author

Depends on #4320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant