@Target([AnnotationTarget.CLASS, AnnotationTarget.FILE, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER]) @Inherited class Rollback
@Rollback is 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 org.springframework.test.context.transaction.TransactionalTestExecutionListener for an explanation of test-managed transactions.
When declared as a class-level annotation, @Rollback defines the default rollback semantics for all test methods within the test class hierarchy. When declared as a method-level annotation, @Rollback 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 replacement for @Rollback(false).
Warning: Declaring @Commit and @Rollback 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.
Author
Sam Brannen
Since
2.5
See Also
Commitorg.springframework.test.context.transaction.TransactionalTestExecutionListener
Rollback(value: Boolean)
Consult the class-level Javadoc for org.springframework.test.context.transaction.TransactionalTestExecutionListener for an explanation of test-managed transactions. When declared as a class-level annotation, As of Spring Framework 4.2, Warning: Declaring This annotation may be used as a meta-annotation to create custom composed annotations. Consult the source code for Commit for a concrete example. |
val value: Boolean
Whether the test-managed transaction should be rolled back after the test method has completed. If Defaults to |