@BeforeTransaction

@BeforeTransaction indicates that the annotated void method should be run before a transaction is started, for test methods that have been configured to run within a transaction by using Infra @Transactional annotation. @BeforeTransaction methods are not required to be public and may be declared on Java 8-based interface default methods.

The following example shows how to use the @BeforeTransaction annotation:

  • Java

@BeforeTransaction (1)
void beforeTransaction() {
  // logic to be run before a transaction is started
}
1 Run this method before a transaction.