Feature Request: JUnit 5 TestSource (IDE "jump to source" feature)
See original GitHub issueKarate has a nice JUnit 5 support. IntelliJ has a nice JUnit 5 support. What is missing is support for JUnit 5 TestSource (https://junit.org/junit5/docs/current/user-guide/#writing-tests-dynamic-tests-uri-test-source) which would allow clicking on a failed test…

to jump to the corresponding scenario:
Currently we implement that feature on our own:
fun ScenarioResult.asTestSourceUri(): URI {
val workingDir = System.getProperty("user.dir")
val featurePath = scenario.feature.relativePath.replace("classpath:", "")
val line = scenario.line
return URI.create(File("$workingDir/src/test/resources/$featurePath").toURI().toString() + "?line=$line")
}
Though it works, implementation could be more robust and also for that to work we virtually had to turn Karate upside down as the URI is required during the DynamicTest instantiation.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (12 by maintainers)
Top Results From Across the Web
JUnit 5 TestSource (IDE "jump to source" feature) · Issue #1329
What is missing is support for JUnit 5 TestSource ... Feature Request: JUnit 5 TestSource (IDE "jump to source" feature) #1329.
Read more >JUnit 5 User Guide
The goal of this document is to provide comprehensive reference documentation for programmers writing tests, extension authors, and engine ...
Read more >Writing Tests with JUnit 5 | The IntelliJ IDEA Blog
In this tutorial we're going to look at features of JUnit 5 that can make it easier for us to write effective and...
Read more >How to Write Effective Unit Tests in Java - Twilio
How To Test Code With JUnit 5 · A Glance At The Test Source Set · Importing JUnit 5 With Gradle · Create...
Read more >Writing JUnit Tests in NetBeans IDE
java from the sample project JUnitSampleSol into the class library project that you created. In the Projects window, right-click the Source Packages node...
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 Free
Top 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
@chaudharydeepak this is great, I think the IDE auto experience is good enough
@chaudharydeepak yes I haven’t thought this through - actually we may be overthinking this - what if this was just yet another param we can pass into the
Runner
/RunnerOptions
etc and even CLI