Explore use of InvocationInterceptor to disable (parameterized) tests
See original GitHub issueIn #163, I wrote:
We just updated to Jupiter 5.5 (#278) to use the new
InvocationInterceptor
API. If that API gets called for individual parameterized test invocations, it would be a very powerful way to implement disabling parameterized tests. The providedInvocation
allows skipping tests and theReflectiveInvocationContext
seems to give access to the actual arguments. Someone should look into that and possibly create an issue if the approach seems promising. 😊
Yes, someone should.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Disable Parameterized Test - JUnit Pioneer
This extension can be used to selectively disable parameterized tests based on their arguments (converted with toString() ). The extension comes with three ......
Read more >JUnit 5 User Guide
@Disabled. Used to disable a test class or test method; analogous to JUnit 4's @Ignore . Such annotations are not inherited. @Timeout.
Read more >Is it possible to disable a Parameterized test basis arguments ...
No, as of JUnit Jupiter 5.6 (pending GA release at the time of this writing), there is no way to access the arguments...
Read more >Guide to JUnit 5 Parameterized Tests - Baeldung
In this tutorial, we're going to explore parameterized tests in depth, ... Learn how to use the Parameterized JUnit test runner with a ......
Read more >Parameterized tests - ServiceNow Docs
Dependencies for custom applications · Application files ... Exploring App Engine Studio ... Disable component preset event mappings.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was told I need to make an executive decision - here it is:
@DisableIf
-check passes, the test is disabledcontains
andmatches
: disallow use of both in the same annotation for now - we can then revisit the decision laterAnd there’s more: We change
@DisableIfDisplayName
to also disallow use of bothcontains
andmatches
. That change needs to be highlighted in the new documentation (including the version where that change was added.)After wasting about an hour, I learned that while we could use Parameter#getName, it only works if the information was included during compilation (which can be checked with Parameter#isNamePresent).
I’ve created an alternate approach that’s index based. That’s always available, at least.