@Test
public void testRollback() throws Exception {

    try {
        Transaction.execute(new TransactionCallback<Object>() {
            @Override
            public Object doInTransaction(TransactionStatus status) {
                throw new RuntimeException("Panic!");
            }
        });
        fail();
    } catch (RuntimeException e) {
        assertEquals("Panic!", e.getMessage());
    }
    verify(conn).setAutoCommit(false);
    verify(conn, times(0)).commit();
    verify(conn, times(1)).rollback();
    verify(conn, times(1)).close();
}