From 072160863a15df219c86205fccd4895f4ae4f51a Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 12 Apr 2017 11:46:06 +0200 Subject: [PATCH] Add a note about transactional tests and `webEnvironment` Closes gh-8232 --- spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index e2ee3d50fa8..2a6fa3eb9ec 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -5062,6 +5062,11 @@ how your tests will run: * `NONE` -- Loads an `ApplicationContext` using `SpringApplication` but does not provide _any_ servlet environment (mock or otherwise). +NOTE: If your test is `@Transactional`, it will rollback the transaction at the end of +each test method by default. If you're using this arrangement in combination with either +`RANDOM_PORT` or `DEFINED_PORT`, any transaction initiated on the server won't rollback as +the test is running in a different thread than the server processing. + NOTE: In addition to `@SpringBootTest` a number of other annotations are also provided for testing more specific slices of an application. See below for details.