@Test
public void testExecuteDDLUpdates() throws Exception{

  final DBAccessor dbAccessor = createNiceMock(DBAccessor.class);
  dbAccessor.createIndex(eq("idx_stage_request_id"), eq("stage"), eq("request_id"));
  expectLastCall().once();
  dbAccessor.createIndex(eq("idx_hrc_request_id"), eq("host_role_command"), eq("request_id"));
  expectLastCall().once();
  dbAccessor.createIndex(eq("idx_rsc_request_id"), eq("role_success_criteria"), eq("request_id"));
  expectLastCall().once();
  Capture<DBAccessor.DBColumnInfo> capturedHostGroupComponentProvisionColumn = EasyMock.newCapture();
  dbAccessor.addColumn(eq("hostgroup_component"), capture(capturedHostGroupComponentProvisionColumn));
  expectLastCall().once();
  replay(dbAccessor);
  Module module = new Module() {
    @Override
    public void configure(Binder binder) {
      binder.bind(DBAccessor.class).toInstance(dbAccessor);
      binder.bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
      binder.bind(EntityManager.class).toInstance(entityManager);
    }
  };
  Injector injector = Guice.createInjector(module);
  UpgradeCatalog221 upgradeCatalog221 = injector.getInstance(UpgradeCatalog221.class);
  upgradeCatalog221.executeDDLUpdates();
  // verify that the column was added for provision_action to the hostgroup_component table
  assertEquals("Incorrect column name added", "provision_action", capturedHostGroupComponentProvisionColumn.getValue().getName());
  assertNull("Incorrect default value added", capturedHostGroupComponentProvisionColumn.getValue().getDefaultValue());
  assertEquals("Incorrect column type added", String.class, capturedHostGroupComponentProvisionColumn.getValue().getType());
  assertEquals("Incorrect column length added", 255, capturedHostGroupComponentProvisionColumn.getValue().getLength().intValue());
  assertTrue("Incorrect column nullable state added", capturedHostGroupComponentProvisionColumn.getValue().isNullable());
  verify(dbAccessor);
}