*
* @return the transaction manager name or null if one hasn't been set
*/
private String getTransactionManager(TestEvent testEvent) {
Transactional transactional;
String transactionManager = "";
// tries to retrieve the name of the manager from annotated test method
transactional = testEvent.getTestMethod().getAnnotation(Transactional.class);
if (transactional != null) {
transactionManager = transactional.manager();
}
// if the transaction manager name hasn't been set then tries to
// retrieve it from class level annotation
if (transactionManager.length() == 0) {
transactional = testEvent.getTestClass().getAnnotation(Transactional.class);
if (transactional != null) {
transactionManager = transactional.manager();
}
}
if (transactionManager.length() == 0) {
transactionManager = obtainTranscationManagerFromConfiguration(transactionManager);