@Test public void shouldCallBeginRollBackCloseWhenTransactionIsExecutedAndFail() throws Exception{ when(content.call()).thenThrow(new Exception()); ftx.with(content).onRolledBack(rolledBackHandler).execute(); verify(txManager).begin(); verify(txManager).close(); verify(txManager).rollback(); verifyNoMoreInteractions(txManager); verify(content).call(); verifyNoMoreInteractions(content); verify(rolledBackHandler).rolledBack(any(Exception.class)); verifyZeroInteractions(rolledBackHandler); }
public Intermediate with(Callable<R> content){ txContent = content; return new Intermediate(); }
FluentTransaction { public Intermediate with(Callable<R> content){ txContent = content; return new Intermediate(); } }
FluentTransaction { public Intermediate with(Callable<R> content){ txContent = content; return new Intermediate(); } private  FluentTransaction(TransactionManager txManager); }
FluentTransaction { public Intermediate with(Callable<R> content){ txContent = content; return new Intermediate(); } private  FluentTransaction(TransactionManager txManager); static FluentTransaction transaction(TransactionManager txManager); TransactionManager getTransactionManager(); Intermediate with(Callable<R> content); }
FluentTransaction { public Intermediate with(Callable<R> content){ txContent = content; return new Intermediate(); } private  FluentTransaction(TransactionManager txManager); static FluentTransaction transaction(TransactionManager txManager); TransactionManager getTransactionManager(); Intermediate with(Callable<R> content);  }