spring-framework / org.springframework.test.context.transaction / TestTransaction / flagForRollback

flagForRollback

open static fun flagForRollback(): Unit

Flag the current test-managed transaction for rollback.

Invoking this method will not end the current transaction. Rather, the value of this flag will be used to determine whether or not the current test-managed transaction should be rolled back or committed once it is ended.

Exceptions

IllegalStateException - if a transaction is not active for the current test

See Also
#isActive()#isFlaggedForRollback()#start()#end()