spockframework / spockframework/spock
EmbeddedSpecRunner.runWithImports() throws MissingMethodException
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 483
- PR merge metrics
- No merged PRs in 30d
Description
Using EmbeddedSpecRunner.runWithImports() throws groovy.lang.MissingMethodException: No signature of method: spock.util.EmbeddedSpecRunner.runWithImports() is applicable for argument types: (String) values: ...
Locating the reason was difficult, but new EmbeddedSpecRunner().class.declaredMethods reveals the culprit: java.lang.NoClassDefFoundError: org/junit/platform/testkit/engine/EngineExecutionResults
The reason is that junit-platform-testkit needs to be explicitly depended on. This is now an optional dependency.
A workaround might be to replace EngineExecutionResults with def in spock-core/src/main/groovy/spock/util/EmbeddedSpecRunner.groovy
More info in https://github.com/spockframework/spock/issues/1073#issuecomment-617009915
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with spock-core/src/main/groovy/spock/util/EmbeddedSpecRunner.groovy and inspect the runWithImports() signature and its EngineExecutionResults reference. Check how junit-platform-testkit is declared as an optional dependency, then verify that EmbeddedSpecRunner.runWithImports() can be called with a String without the MissingMethodException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy, java
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100