Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
634e70fb
Commit
634e70fb
authored
May 15, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update docs on using Spock following release of Spock 1.1
parent
2e94fd44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
21 deletions
+4
-21
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+4
-21
No files found.
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
634e70fb
...
@@ -6036,27 +6036,10 @@ automatically generate the default snippets:
...
@@ -6036,27 +6036,10 @@ automatically generate the default snippets:
==== Using Spock to test Spring Boot applications
==== Using Spock to test Spring Boot applications
If you wish to use Spock to test a Spring Boot application you should add a dependency
If you wish to use Spock to test a Spring Boot application you should add a dependency
on Spock's `spock-spring` module to your application's build. `spock-spring` integrates
on Spock's `spock-spring` module to your application's build. `spock-spring` integrates
Spring's test framework into Spock. Exactly how you can use Spock to test a Spring Boot
Spring's test framework into Spock. It is recommended that you use Spock 1.1 or later to
application depends on the version of Spock that you are using.
benefit from a number of recent improvements to Spock's Spring Framework and Spring Boot
integration. Please refer to http://spockframework.org/spock/docs/1.1/modules.html[the
NOTE: Spring Boot provides dependency management for Spock 1.0. If you wish to use Spock
documentation for Spock's Spring module] for further details.
1.1 you should <<howto.adoc#howto-customize-dependency-versions,override the
`spock.version` property>> in your `build.gradle` or `pom.xml` file.
When using Spock 1.1, the annotations <<boot-features-testing-spring-boot-applications,
described above>> can only be used and you can annotate your `Specification` with
`@SpringBootTest` to suit the needs of your tests.
When using Spock 1.0, `@SpringBootTest` will not work for a web project. You need to use
`@SpringApplicationConfiguration` and `@WebIntegrationTest(randomPort = true)`. Being
unable to use `@SpringBootTest` means that you also lose the auto-configured
`TestRestTemplate` bean. You can create an equivalent bean yourself using the following
configuration:
[source,java,indent=0]
----
include::{code-examples}/test/spock/SpockTestRestTemplateExample.java[tag=test-rest-template-configuration]
----
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment