JtaConfigurer implements InitializingBean, DisposableBean { public void setTransactionManager(TransactionManager transactionManager) { this.transactionManager = transactionManager; }  @Override void afterPropertiesSet(); void setTransactionManager(TransactionManager transactionManager); void setUserTransaction(UserTransaction userTransaction); void setJndiTemplate(JndiTemplate jndiTemplate); @Override void destroy();  }
@Test public void testSetTransactionManager() throws Exception { initializeJtaObjectConfig(); JtaConfigurer configurer = new JtaConfigurer(); TransactionManager newMockTransactionManager = mock(TransactionManager.class); configurer.setTransactionManager(newMockTransactionManager); configurer.afterPropertiesSet(); assertNotSame(newMockTransactionManager, transactionManager); assertEquals(newMockTransactionManager, Jta.getTransactionManager()); assertEquals(userTransaction, Jta.getUserTransaction()); }