@Test
public void testColumnExistsWhenColumnNameIsNull() throws Exception {

    SQLException sqlException = new SQLException();
    when(connectionMock.prepareStatement(contains("SELECT null"))).thenReturn(preparedStatementMock);
    when(preparedStatementMock.executeQuery()).thenThrow(sqlException);
    Connection conn = connectionMock;
    String tableName = "tableName";
    String columnName = null;
    dao.columnExists(conn, tableName, columnName);
    verify(connectionMock, times(1)).prepareStatement(anyString());
    verify(preparedStatementMock, times(1)).executeQuery();
    verify(preparedStatementMock, times(1)).close();
    verify(loggerMock, times(1)).debug(anyString());
}