Commit 5c8fc72b authored by Andy Wilkinson's avatar Andy Wilkinson

Merge pull request #9965 from Philippe Sam-Long

* gh-9965:
  Clarify docs on effect RANDOM_PORT or DEFINED_PORT has on transactions
parents 9f9cef1e c9faefc5
...@@ -5357,9 +5357,10 @@ how your tests will run: ...@@ -5357,9 +5357,10 @@ how your tests will run:
_any_ servlet environment (mock or otherwise). _any_ servlet environment (mock or otherwise).
NOTE: If your test is `@Transactional`, it will rollback the transaction at the end of 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 each test method by default. However, as using this arrangement with either `RANDOM_PORT`
`RANDOM_PORT` or `DEFINED_PORT`, any transaction initiated on the server won't rollback as or `DEFINED_PORT` implicitly provides a real servlet environment, HTTP client and
the test is running in a different thread than the server processing. server will run in separate threads, thus separate transactions. Any transaction
initiated on the server won't rollback in this case.
NOTE: In addition to `@SpringBootTest` a number of other annotations are also 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. provided for testing more specific slices of an application. See below for details.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment