UpgradeCatalog2121 extends AbstractUpgradeCatalog { @Override protected void executeDMLUpdates() throws AmbariException, SQLException { updatePHDConfigs(); updateOozieConfigs(); } @Inject  UpgradeCatalog2121(Injector injector); @Override String getTargetVersion(); @Override String getSourceVersion();  }
@Test public void testExecuteDMLUpdates() throws Exception { Method updatePHDConfigs = UpgradeCatalog2121.class.getDeclaredMethod("updatePHDConfigs"); Method updateOozieConfigs = UpgradeCatalog2121.class.getDeclaredMethod("updateOozieConfigs"); UpgradeCatalog2121 upgradeCatalog2121 = createMockBuilder(UpgradeCatalog2121.class) .addMockedMethod(updatePHDConfigs) .addMockedMethod(updateOozieConfigs) .createMock(); upgradeCatalog2121.updatePHDConfigs(); expectLastCall().once(); upgradeCatalog2121.updateOozieConfigs(); expectLastCall().once(); replay(upgradeCatalog2121); upgradeCatalog2121.executeDMLUpdates(); verify(upgradeCatalog2121); }