use of org.mule.runtime.core.api.MuleContext in project mule by mulesoft.
the class XaTransactionFactoryTestCase method setsTransactionTimeout.
@Test
public void setsTransactionTimeout() throws Exception {
final int timeout = 1000;
final XaTransactionFactory transactionFactory = new XaTransactionFactory();
transactionFactory.setTimeout(timeout);
final MuleContext muleContext = mockContextWithServices();
final TransactionManager transactionManager = mock(TransactionManager.class);
when(muleContext.getTransactionManager()).thenReturn(transactionManager);
final Transaction transaction = transactionFactory.beginTransaction(muleContext);
assertThat(transaction.getTimeout(), equalTo(timeout));
}
Aggregations