Support Propagation.NEVER for disabling test-managed transactions

Prior to this commit only Propagation.NOT_SUPPORTED was supported for
disabling test-managed transactions via the `propagation` attribute of
`@Transactional`.

This commit allows users to specify Propagation.NOT_SUPPORTED or
Propagation.NEVER to disable test-managed transactions.

Closes gh-25909
This commit is contained in:
Sam Brannen
2020-10-13 14:52:47 +02:00
parent 33fcba55d1
commit e5ae2cb0fe
3 changed files with 9 additions and 6 deletions

View File

@@ -5056,7 +5056,7 @@ hierarchy runs within a transaction. Test methods that are not annotated with
that `@Transactional` is not supported on test lifecycle methods — for example, methods
annotated with JUnit Jupiter's `@BeforeAll`, `@BeforeEach`, etc. Furthermore, tests that
are annotated with `@Transactional` but have the `propagation` attribute set to
`NOT_SUPPORTED` are not run within a transaction.
`NOT_SUPPORTED` or `NEVER` are not run within a transaction.
[[testcontext-tx-attribute-support]]
.`@Transactional` attribute support
@@ -5065,7 +5065,7 @@ are annotated with `@Transactional` but have the `propagation` attribute set to
|`value` and `transactionManager` |yes
|`propagation` |only `Propagation.NOT_SUPPORTED` is supported
|`propagation` |only `Propagation.NOT_SUPPORTED` and `Propagation.NEVER` are supported
|`isolation` |no