-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spock Spring module does not work with Spring Test 6 #1539
Comments
This workaround helped me. Thanks. |
by using its replacement TestContextAnnotationUtils. fixes spockframework#1539
by using its replacement TestContextAnnotationUtils. fixes spockframework#1539
* Add SpringBoot 3 integration test * Fix issue with removed MetaAnnotationUtils by using its replacement TestContextAnnotationUtils. * Raise required JDK version for the gradle build to 17 to accommodate Spring Boot 3. fixes #1539
VEO-1782
@leonard84 I assume that many Spock users are desperately waiting for your fix. Do you have any idea about when a new Spock version including your fix will be released? |
@winne42 The fix has already been released. I was able to successfully use it few weeks ago. https://mvnrepository.com/artifact/org.spockframework/spock-spring/2.4-M1-groovy-4.0 |
@sbhuju61 but is the "M1" release supposed to be stable? Sounds like a "milestone" to me? |
This has been stuck in a Milestone Release for 6 months. Any chance it can be released or backport to 2.3. Currently, the only options appear to be not upgrading to Boot 3.x or having to depend on a Milestone dependency. |
스프링6에서 작동이 안되므로 2.4-M1 이상 버전을 사용해야함 참조 - spockframework/spock#1539
Describe the bug
When using Spring Test 6 (used by Spring 6/Boot 3) then the Spock Spring module does not detect the Spring tests. The tests are still picked up and an attempt to execute them is made, but the Spring Application Context is never started.
The issue seems to be caused by the class
org.springframework.test.util.MetaAnnotationUtils
which was deprecated in 5.3 being removed in 6. It looks like Spock used this utility class to discover the@BootstrapWith
meta-annotation on the@SpringBootTest
annotation.There are separate checks for
@ContextHierarchy
and@ContextConfiguration
, so if a Spec is using these directly then the Application Context starts as expected.Workaround
Add an empty
@ContextConfiguration
annotation to the Spec.To Reproduce
Expected behavior
Application context starts
Actual behavior
Application context doesn't start
Java version
All
Buildtool version
All
What operating system are you using
Linux
Dependencies
?
Additional context
No response
The text was updated successfully, but these errors were encountered: