@Test
public void testDropTableColumnsIfExistWhenThreeKeysAreSuppliedAnOneDoesnotExist() throws Exception {

    Connection conn = connectionMock;
    String tableName = "tableName";
    String column1 = "column1";
    String column2 = "column2";
    String column3 = "column3";
    when(daoMock.columnExists(conn, tableName, column1)).thenReturn(true);
    when(daoMock.columnExists(conn, tableName, column2)).thenReturn(false);
    when(daoMock.columnExists(conn, tableName, column3)).thenReturn(true);
    List<String> keys = Arrays.asList(new String[] {column1, column2, column3});
    DbUpgradeUtils.dropTableColumnsIfExist(conn, tableName, keys);
    verify(daoMock, times(1)).columnExists(conn, tableName, column1);
    verify(daoMock, times(1)).dropColumn(conn, tableName, column1);
    verify(daoMock, times(1)).columnExists(conn, tableName, column2);
    verify(daoMock, times(0)).dropColumn(conn, tableName, column2);
    verify(daoMock, times(1)).columnExists(conn, tableName, column3);
    verify(daoMock, times(1)).dropColumn(conn, tableName, column3);
}