-
Notifications
You must be signed in to change notification settings - Fork 470
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
Context not properly loaded with Spring Boot 3 for WebMvcTest with OpenFeign clients #1561
Comments
And this works with prior Spring Boot versions? As you can see by the error message:
This means that Spock did correctly invoke the Spring testing infrastructure. |
It might be related to the old thread: spring-projects/spring-boot#7270 (comment). |
I've bumped into that case recently. The weird thing is, it worked fine with Spring Boot 2 and Spock 2.3. However, I clearly see that in SB2 the Feign client ( @lmouline Could you write one test with JUnit Jupiter and the aforementioned |
Yep it does :) plugins {
id("org.springframework.boot") version "2.7.8"
}
extra["springCloudVersion"] = "2021.0.5"
dependencies {
testImplementation(platform("org.spockframework:spock-bom:2.3-groovy-4.0"))
}
The test with Junit works :( Here a new version of a demo with both the Spock test and the JUnit one. They are strictly identical. But you can see that only the JUnit one works :/ |
Honestly, not sure what the cause is, as Spock is not really involved in that part. It just instantiates Spring's |
Describe the bug
When migration Spring Boot to version 3 and Spock framework to version 2.4-M1 with OpenFeign client(s), tests with the
WebMvcTest
annotation fail to properly load the context.Please note that the tests with
@SpringBootTest
are executed successfully.Seems that the issue also happens for tests with the
@DataMongoTest
annotation.To Reproduce
Minimal example with a failing test: demo.zip
Expected behavior
The test should pass
Actual behavior
The test fails with the following cause:
(Note that the test with the
@SpringBootTest
annotation passes :))Java version
17
Buildtool version
Gradle 7.6
What operating system are you using
Mac
Dependencies
Root project 'demo'
A web-based, searchable dependency report is available by adding the --scan option.
Additional context
No response
The text was updated successfully, but these errors were encountered: