From 0ebdd8cb9841fe4451d0c6879de249c6b0031ff1 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sun, 10 Sep 2023 19:06:54 +0200 Subject: [PATCH] Polishing --- .../testing/testcontext-framework/tx.adoc | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tx.adoc b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tx.adoc index 3d609bf25e..1f1a9c676a 100644 --- a/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tx.adoc +++ b/framework-docs/modules/ROOT/pages/testing/testcontext-framework/tx.adoc @@ -295,14 +295,18 @@ behavior after your test runs (if the test was configured to commit the transact `TransactionalTestExecutionListener` supports the `@BeforeTransaction` and `@AfterTransaction` annotations for exactly such scenarios. You can annotate any `void` method in a test class or any `void` default method in a test interface with one of these -annotations, and the `TransactionalTestExecutionListener` ensures that your before -transaction method or after transaction method runs at the appropriate time. - -TIP: Any before methods (such as methods annotated with JUnit Jupiter's `@BeforeEach`) -and any after methods (such as methods annotated with JUnit Jupiter's `@AfterEach`) are -run within a transaction. In addition, methods annotated with `@BeforeTransaction` or -`@AfterTransaction` are not run for test methods that are not configured to run within a -transaction. +annotations, and the `TransactionalTestExecutionListener` ensures that your +before-transaction method or after-transaction method runs at the appropriate time. + +[TIP] +==== +Any before methods (such as methods annotated with JUnit Jupiter's `@BeforeEach`) and any +after methods (such as methods annotated with JUnit Jupiter's `@AfterEach`) are run +within the test-managed transaction for a transactional test method. + +Similarly, methods annotated with `@BeforeTransaction` or `@AfterTransaction` are only +run for transactional test methods. +==== [[testcontext-tx-mgr-config]] == Configuring a Transaction Manager