@Test
public void testExecuteDDLUpdates() throws Exception {

  setupIoCContext();
  final DBAccessor dbAccessor = createNiceMock(DBAccessor.class);
  Configuration configuration = createNiceMock(Configuration.class);
  Connection connection = createNiceMock(Connection.class);
  Statement statement = createNiceMock(Statement.class);
  ResultSet resultSet = createNiceMock(ResultSet.class);
  expect(configuration.getDatabaseUrl()).andReturn(Configuration.JDBC_IN_MEMORY_URL).anyTimes();
  dbAccessor.getConnection();
  expectLastCall().andReturn(connection).anyTimes();
  connection.createStatement();
  expectLastCall().andReturn(statement).anyTimes();
  statement.executeQuery(anyObject(String.class));
  expectLastCall().andReturn(resultSet).anyTimes();
  // Create DDL sections with their own capture groups
  HostRoleCommandDDL hostRoleCommandDDL = new HostRoleCommandDDL();
  // Execute any DDL schema changes
  hostRoleCommandDDL.execute(dbAccessor);
  // Replay sections
  replay(dbAccessor, configuration, resultSet, connection, statement);
  AbstractUpgradeCatalog upgradeCatalog = getUpgradeCatalog(dbAccessor);
  Class<?> c = AbstractUpgradeCatalog.class;
  Field f = c.getDeclaredField("configuration");
  f.setAccessible(true);
  f.set(upgradeCatalog, configuration);
  upgradeCatalog.executeDDLUpdates();
  verify(dbAccessor, configuration, resultSet, connection, statement);
  // Verify sections
  hostRoleCommandDDL.verify(dbAccessor);
}