@Test
public void testExecuteUpgradePreDMLUpdates() throws Exception {

  Method executeStackPreDMLUpdates = UpgradeCatalog220.class.getDeclaredMethod("executeUpgradePreDMLUpdates");
  Method executeStackUpgradeDDLUpdates = UpgradeCatalog220.class.getDeclaredMethod("executeStackUpgradeDDLUpdates");
  Method bootstrapRepoVersionForHDP21 = UpgradeCatalog220.class.getDeclaredMethod("bootstrapRepoVersionForHDP21");
  final UpgradeCatalog220 upgradeCatalog220 = createMockBuilder(UpgradeCatalog220.class)
    .addMockedMethod(executeStackUpgradeDDLUpdates)
    .addMockedMethod(bootstrapRepoVersionForHDP21)
    .addMockedMethod(executeStackPreDMLUpdates).createMock();
  final Injector mockInjector = Guice.createInjector(new AbstractModule() {
    @Override
    protected void configure() {
      bind(UpgradeCatalog220.class).toInstance(upgradeCatalog220);
      bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
      bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
      bind(EntityManager.class).toInstance(entityManager);
    }
  });
  upgradeCatalog220.executeUpgradePreDMLUpdates();
  expectLastCall().once();
  upgradeCatalog220.executeStackUpgradeDDLUpdates();
  expectLastCall().once();
  upgradeCatalog220.bootstrapRepoVersionForHDP21();
  expectLastCall().once();
  replay(upgradeCatalog220);
  mockInjector.getInstance(UpgradeCatalog220.class).executePreDMLUpdates();
  verify(upgradeCatalog220);
}