public void testActionAlwaysBeginAndSuspendXaTxAndRollbackNewTx() throws Exception
{
TransactionCoordination.getInstance().bindTransaction(mockTransaction);
mockTransaction.setXA(true);
when(mockTransaction.isRollbackOnly()).thenReturn(true);
MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_ALWAYS_BEGIN);
ExecutionTemplate executionTemplate = createExecutionTemplate(config);
config.setFactory(new TestTransactionFactory(mockNewTransaction));
Object result = executionTemplate.execute(getRollbackTransactionCallback());
assertThat((MuleEvent) result, is(RETURN_VALUE));
verify(mockNewTransaction).rollback();
verify(mockNewTransaction, VerificationModeFactory.times(0)).commit();
verify(mockTransaction).suspend();