@AfterTransaction
@AfterTransaction
表明经过注释的 void
方法应在事务结束之后立即运行,测试方法已通过使用 Spring 的 @Transactional
注解配置为在一个事务内运行。@AfterTransaction
方法不必是 public
,并且可以在基于 Java 8 的接口默认方法中声明。
@AfterTransaction
indicates that the annotated void
method should be run after a
transaction is ended, for test methods that have been configured to run within a
transaction by using Spring’s @Transactional
annotation. @AfterTransaction
methods
are not required to be public
and may be declared on Java 8-based interface default
methods.
- Java
-
@AfterTransaction (1) void afterTransaction() { // logic to be run after a transaction has ended }
1 | Run this method after a transaction.
|
2 | Run this method after a transaction. |