Annotation Type BeforeTransaction


  • @Target({METHOD,ANNOTATION_TYPE})
    @Retention(RUNTIME)
    @Documented
    public @interface BeforeTransaction

    Test annotation which indicates that the annotated void method should be executed before a transaction is started for a test method configured to run within a transaction via Spring's @Transactional annotation.

    @BeforeTransaction methods declared in superclasses or as interface default methods will be executed before those of the current test class.

    As of Spring Framework 4.0, this annotation may be used as a meta-annotation to create custom composed annotations.

    As of Spring Framework 4.3, @BeforeTransaction may also be declared on Java 8 based interface default methods.

    Since:
    2.5
    Author:
    Sam Brannen
    See Also:
    Transactional, AfterTransaction