Closed madorb closed 9 years ago
I don't know that this is specifically spock related though. This fellow mentions the same issue: http://stackoverflow.com/questions/32742344/contextconfiguration-annotation-exception/32830706#32830706
@madorb Can you try with the latest SNAPSHOT (and make sure you are using Spring Framework 4.2.2 SNAPSHOT as well). I think you might be hitting SPR-13345 but I though that was fixed before M5 was released.
Please note that Spring Boot 1.3.0.M5 depends explicitly on Spring Framework 4.2.1, not 4.2.0.
The exception you are seeing was addressed in Spring Framework 4.2.1, specifically in the following issues.
And changes made to @SpringApplicationConfiguration
in Spring Boot 1.3.0 M5 require Spring Framework 4.2.1. See https://github.com/spring-projects/spring-boot/issues/3635 for details.
Thus, ensuring that you are running against Spring Framework 4.2.1 should resolve your problem.
Regards,
Sam
@philwebb @sbrannen thanks for the feedback, you're correct, using Spring 4.2.1 resolves the issue
@madorb, you're welcome, and thanks for letting us know that 4.2.1 solves your issue!
@madorb I'd recommend not specifying the version of any Spring Framework dependencies in your build.gradle
or pom.xml
and letting Boot's dependency management take care of it for you. It's a nice way to avoid problems like this and know that you're running on a combination of versions that's been thoroughly tested.
My Spock integration tests are no longer working after upgrading from M3 to M5.
When I run them I get the exception:
the tests look like:
I tried it both with and without
locations=
and it fails the same way in either case.In the meantime i had to revert to:
@ContextConfiguration(loader = SpringApplicationContextLoader.class, classes = Application.class)
for my tests to execute successfully