I have written a custom JUnit 5 test engine for parameterized testing at the test class level. I have found an issue I can seem to resolve.
When using IntelliJ and running the test class, everything works...
IntelliJ test window when running test class
When I run a specific parameter, everything works...
IntelliJ test window when running test parameter
When I run a specific method for a specific parameter, all test methods run...
IntelliJ test window when running test method
Every node in the hierarchy has a UniqueId, so I would expect IntelliJ to use a UniqueIdSelector, but debugging shows that it's using a MethodSelector
If the method had parameters, then I could use the methodParameterType field to filter... but in this scenario, there are no test method parameters.
Thoughts? Anyone experience this issue? Is it a core IntelliJ issue/limitation or JUnit 5 issue/limitation?
I also encountered the same problem. By taking a look into the source code of IntelliJ, I discovered two solutions to make IntelliJ use the
UniqueIdSelector.MethodSourceorClassSourcewhich points to a method or class which is not annotated with@Testable.Both solutions have downsides, of course. Removing the
@Testableannotation means you can no-longer trigger the test from the source file in IntelliJ. Using the class as the test source for all nodes means you can no-longer jump to the method in the source code.PS: I assume you have created IDEA-317561? I also created IDEA-337243. Just for reference.