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