@Test
public void testShouldPerformPreDMLLogicIfClusterNameColumnExists() throws Exception {

  // GIVEN
  reset(dbAccessor);
  expect(dbAccessor.getConnection()).andReturn(connection).anyTimes();
  expect(connection.createStatement()).andReturn(statement);
  Capture<String> tableNameCaptor = newCapture();
  Capture<String> columnNameCaptor = newCapture();
  expect(dbAccessor.tableHasColumn(capture(tableNameCaptor), capture(columnNameCaptor))).andReturn(true);
  expect(statement.executeQuery(anyString())).andReturn(resultSet);
  statement.close();
  expect(resultSet.next()).andReturn(false);
  resultSet.close();
  replay(dbAccessor, connection, statement, resultSet);
  // WHEN
  testSubject.executePreDMLUpdates();
  // THEN
  Assert.assertNotNull("The table name hasn't been captured", tableNameCaptor.getValue());
  Assert.assertEquals("The table name is not as expected", TOPOLOGY_REQUEST_TABLE, tableNameCaptor.getValue());
  Assert.assertNotNull("The column name hasn't been captured", columnNameCaptor.getValue());
  Assert.assertEquals("The column name is not as expected", TOPOLOGY_REQUEST_CLUSTER_NAME_COLUMN,
      columnNameCaptor.getValue());
  verify(dbAccessor, statement, resultSet);
}