@Nullable open static fun retrieveTransactionManager(testContext: TestContext, @Nullable name: String): PlatformTransactionManager
Retrieve the PlatformTransactionManager to use for the supplied TestContext.
The following algorithm is used to retrieve the transaction manager from the org.springframework.context.ApplicationContext of the supplied test context:
name is non-empty, throwing a BeansException if the named transaction manager does not exist.
testContext - the test context for which the transaction manager should be retrieved; never null
name - the name of the transaction manager to retrieve; may be null or empty
BeansException - if an error occurs while retrieving an explicitly named transaction manager
IllegalStateException - if more than one TransactionManagementConfigurer exists in the ApplicationContext
Return
the transaction manager to use, or null if not found