Annotation Interface Rollback
@Rollbackis a test annotation that is used to indicate whether a test-managed transaction should be rolled back after the test method has completed.
Consult the class-level Javadoc for
for an explanation of test-managed transactions.
When declared as a class-level annotation,
the default rollback semantics for all test methods within the test class
hierarchy. When declared as a method-level annotation,
defines rollback semantics for the specific test method, potentially
overriding class-level default commit or rollback semantics.
As of Spring Framework 4.2,
@Commit can be used as direct
on the same test method or on the same test class is unsupported and may
lead to unpredictable results.
This annotation may be used as a meta-annotation to create
custom composed annotations. Consult the source code for
@Commit for a concrete example.
As of Spring Framework 5.3, this annotation will be inherited from an
enclosing test class by default. See
Optional Element SummaryModifier and TypeOptional ElementDescription
booleanWhether the test-managed transaction should be rolled back after the test method has completed.
valueboolean valueWhether the test-managed transaction should be rolled back after the test method has completed.
true, the transaction will be rolled back; otherwise, the transaction will be committed.