TransactionStrategyProvider implements StrategyProvider<TransactionStrategyExecutor> { @Override public TransactionStrategyExecutor disabledStrategy() { return new TransactionStrategyExecutor() { @Override public void commit() { } @Override public void begin() { } }; } TransactionStrategyProvider(final EntityTransaction tx); @Override TransactionStrategyExecutor rollbackStrategy(); @Override TransactionStrategyExecutor commitStrategy(); @Override TransactionStrategyExecutor disabledStrategy();  }
@Test public void testNoTransactionStrategyExecution() throws Throwable { final TransactionStrategyExecutor executor = provider.disabledStrategy(); executor.begin(); executor.commit(); verifyZeroInteractions(tx); }