|
|
|
@ -2000,6 +2000,8 @@ in order to run your integration tests using random ports. For example: |
|
|
|
See <<howto-discover-the-http-port-at-runtime>> for a description of how you can discover |
|
|
|
See <<howto-discover-the-http-port-at-runtime>> for a description of how you can discover |
|
|
|
the actual port that was allocated for the duration of the tests. |
|
|
|
the actual port that was allocated for the duration of the tests. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[boot-features-testing-spring-boot-applications-with-spock]] |
|
|
|
[[boot-features-testing-spring-boot-applications-with-spock]] |
|
|
|
==== Using Spock to test Spring Boot applications |
|
|
|
==== Using Spock to test Spring Boot applications |
|
|
|
|
|
|
|
|
|
|
|
@ -2007,9 +2009,9 @@ If you wish to use Spock to test a Spring Boot application then you cannot use t |
|
|
|
`@SpringApplicationConfiguration` annotation that was |
|
|
|
`@SpringApplicationConfiguration` annotation that was |
|
|
|
<<boot-features-testing-spring-boot-applications,described above>> as Spock |
|
|
|
<<boot-features-testing-spring-boot-applications,described above>> as Spock |
|
|
|
https://code.google.com/p/spock/issues/detail?id=349[does not find the |
|
|
|
https://code.google.com/p/spock/issues/detail?id=349[does not find the |
|
|
|
`@ContextConfiguration` meta-annotation]. To work around |
|
|
|
`@ContextConfiguration` meta-annotation]. To work around this limitation, you should use |
|
|
|
this limitation, you should use the `@ContextConfiguration` annotation directly and |
|
|
|
the `@ContextConfiguration` annotation directly and configure it to use the Spring |
|
|
|
configure it to use the Spring Boot-specfic context loader: |
|
|
|
Boot specific context loader: |
|
|
|
|
|
|
|
|
|
|
|
[source,groovy,indent=0] |
|
|
|
[source,groovy,indent=0] |
|
|
|
---- |
|
|
|
---- |
|
|
|
|