@Test
public void testDropPrimaryKeyWhenPrepareStatementResultsInException() throws Exception {

    SQLException sqlException = new SQLException();
    when(connectionMock.prepareStatement(contains("DROP PRIMARY KEY"))).thenThrow(sqlException);
    Connection conn = connectionMock;
    String tableName = null;
    dao.dropPrimaryKey(conn, tableName);
    verify(connectionMock, times(1)).prepareStatement(anyString());
    verify(preparedStatementMock, times(0)).executeUpdate();
    verify(preparedStatementMock, times(0)).close();
    verify(loggerMock, times(1)).debug(contains("Exception"));
}