@Test
public void shouldCommitIfExecuteQuerySucceeds() throws Exception {

    when(mockConnection.prepareStatement(anyString())).thenReturn(mockPreparedStatement);
    final JDBCBase.StatementWithReturnBlock<?> mockStatementWithReturnBlock = mock(JDBCBase.StatementWithReturnBlock.class);
    initializeJDBCTestSubclass();
    jdbcTestSubclass.executeQuery("SOME SQL", mockStatementWithReturnBlock);
    // and that we commit
    InOrder inOrder = inOrder(mockPreparedStatement, mockConnection);
    inOrder.verify(mockConnection).commit(); // the first was for the initialize() call
    inOrder.verify(mockPreparedStatement).close();
    inOrder.verify(mockConnection).commit(); // the second is for the actual query
    inOrder.verify(mockConnection, times(0)).close();
}