public class TestWorkTransactionPreparer
{
@Test
public void shouldSetNoTransactionIfNoTxIdAndNotTransactional()
{
WorkTransactionPreparer prepper = new WorkTransactionPreparer();
TransactionWork txWork = mock(TransactionWork.class);
when(txWork.getTransactionId()).thenReturn(-1l);
when(txWork.isTransactional()).thenReturn(false);
prepper.prepare(txWork);
verify(txWork).setTransactionMode(WorkTransactionMode.NO_TRANSACTION);
// TODO: Is it necessary that it generates a tx id for non-transactional work?
verify(txWork).setTransactionId(0l);