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

Introduce mechanism to enable specific global extensions in JUnit Jupiter #3717

Open
translatenix opened this issue Mar 8, 2024 Discussed in #3703 · 4 comments
Open

Introduce mechanism to enable specific global extensions in JUnit Jupiter #3717

translatenix opened this issue Mar 8, 2024 Discussed in #3703 · 4 comments

Comments

@translatenix
Copy link

translatenix commented Mar 8, 2024

Enabling all global extensions on the class/module path with junit.jupiter.extensions.autodetection.enabled=true is asking for surprises (and potentially trouble).

Instead, I'd like to explicitly enable the global extensions that I want to use.

I imagine that I'd do this by setting junit.jupiter.extensions.autodetection.enabled=foo.bar.Baz,foo.bar.Qux or a similar property.

If the JUnit team is open to this idea, I'd be happy to discuss further and send a PR.

@sbrannen
Copy link
Member

sbrannen commented Mar 9, 2024

Thanks for the proposal, @translatenix.

We'll discuss it within the team during an upcoming team call and get back to you.

@sbrannen sbrannen changed the title Enabling specific global extensions Introduce mechanism to enable specific global extensions in JUnit Jupiter Mar 9, 2024
@marcphilipp
Copy link
Member

Team decision: Introduce junit.jupiter.extensions.autodetection.include and junit.jupiter.extensions.autodetection.exclude configuration parameters with defaults of * and empty, respectively.

@marcphilipp
Copy link
Member

Addendum: The new properties should support the same pattern matching syntax supported for other configuration parameters.

@bjmi
Copy link
Contributor

bjmi commented Mar 22, 2024

One use case would be to enable org.mockito.junit.jupiter.MockitoExtension from org.mockito:mockito-junit-jupiter globally by default. This would activate strict stubbing then. mockito/mockito#769.

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

4 participants