You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please follow these guidelines when so we better can classify the issue.
The more info you provide about your environment and how to reproduce the problem the easier and faster it will be to solve (win-win).
Please check existing issues (both open and closed) prior to opening any new issue.
Optionally make sure it is a bug by other users in forum, StackOverflow Spock questions, etc.
The block quotes can be omitted.
Most of the sections are only applicable for bugs.
Issue description
We have a couple of old unit tests, and now starting to work with Spock. I've started to integrate spock-spring, and now on my old Tests annotated with @ContextConfiguration I get an Exception.
I understand that the SpringMockTestExecutionListener should only apply to Spock tests, but i'm not sure if it actually should throw Exceptions for non-spock tests.
How to reproduce
Create a new Non-Spock-Test (Junit, with spring and @ContextConfiguration) that does not extend spock.lang.Specification
Trying to run a test from that class leads to an Exception:
java.lang.IllegalArgumentException: SpringMockTestExecutionListener is only applicable for spock specifications.
at org.spockframework.spring.SpringMockTestExecutionListener.beforeTestMethod(SpringMockTestExecutionListener.java:87)
at org.spockframework.spring.AbstractSpringTestExecutionListener.beforeTestMethod(AbstractSpringTestExecutionListener.java:39)
at org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:269)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Link to a gist or similar (optional)
Additional Environment information
Java/JDK
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Groovy version
Groovy Version: 2.4.7 JVM: 1.8.0_121 Vendor: Oracle Corporation OS: Mac OS X
Issue description
We have a couple of old unit tests, and now starting to work with Spock. I've started to integrate spock-spring, and now on my old Tests annotated with @ContextConfiguration I get an Exception.
I understand that the SpringMockTestExecutionListener should only apply to Spock tests, but i'm not sure if it actually should throw Exceptions for non-spock tests.
How to reproduce
Create a new Non-Spock-Test (Junit, with spring and @ContextConfiguration) that does not extend spock.lang.Specification
Trying to run a test from that class leads to an Exception:
java.lang.IllegalArgumentException: SpringMockTestExecutionListener is only applicable for spock specifications.
Link to a gist or similar (optional)
Additional Environment information
Java/JDK
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Groovy version
Groovy Version: 2.4.7 JVM: 1.8.0_121 Vendor: Oracle Corporation OS: Mac OS X
Build tool version
Apache Maven
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"
Operating System
Mac
IDE
IntelliJ
Build-tool dependencies used
Gradle/Grails
Apache Maven
The text was updated successfully, but these errors were encountered: