UpgradeCatalog211 extends AbstractUpgradeCatalog { @Override protected void executePreDMLUpdates() throws AmbariException, SQLException { } @Inject  UpgradeCatalog211(Injector injector); @Override String getTargetVersion(); @Override String getSourceVersion();  }
@Test public void testExecutePreDMLUpdates() throws Exception { final UpgradeCatalog211 upgradeCatalog211 = createMockBuilder(UpgradeCatalog211.class) .createMock(); final Injector injector = Guice.createInjector(new AbstractModule() { @Override protected void configure() { bind(UpgradeCatalog211.class).toInstance(upgradeCatalog211); bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class)); bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class)); } }); setInjector(upgradeCatalog211, injector); replayAll(); injector.getInstance(UpgradeCatalog211.class).executePreDMLUpdates(); verifyAll(); }