UpgradeCatalog210 extends AbstractUpgradeCatalog { @Override protected void executeDMLUpdates() throws AmbariException, SQLException { addNewConfigurationsFromXml(); initializeClusterAndServiceWidgets(); addMissingConfigs(); updateAlertDefinitions(); removeStormRestApiServiceComponent(); updateKerberosDescriptorArtifacts(); } @Inject  UpgradeCatalog210(Injector injector); @Override String getSourceVersion(); @Override String getTargetVersion();  }
@Test public void testExecuteDMLUpdates() throws Exception { Method addNewConfigurationsFromXml = AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml"); Method initializeClusterAndServiceWidgets = UpgradeCatalog210.class.getDeclaredMethod("initializeClusterAndServiceWidgets"); Method addMissingConfigs = UpgradeCatalog210.class.getDeclaredMethod("addMissingConfigs"); Method updateAlertDefinitions = UpgradeCatalog210.class.getDeclaredMethod("updateAlertDefinitions"); Method removeStormRestApiServiceComponent = UpgradeCatalog210.class.getDeclaredMethod("removeStormRestApiServiceComponent"); Method updateKerberosDescriptorArtifacts = AbstractUpgradeCatalog.class.getDeclaredMethod("updateKerberosDescriptorArtifacts"); UpgradeCatalog210 upgradeCatalog210 = createMockBuilder(UpgradeCatalog210.class) .addMockedMethod(addNewConfigurationsFromXml) .addMockedMethod(initializeClusterAndServiceWidgets) .addMockedMethod(addMissingConfigs) .addMockedMethod(updateAlertDefinitions) .addMockedMethod(removeStormRestApiServiceComponent) .addMockedMethod(updateKerberosDescriptorArtifacts) .createMock(); upgradeCatalog210.addNewConfigurationsFromXml(); expectLastCall().once(); upgradeCatalog210.initializeClusterAndServiceWidgets(); expectLastCall().once(); upgradeCatalog210.addMissingConfigs(); expectLastCall().once(); upgradeCatalog210.updateAlertDefinitions(); expectLastCall().once(); upgradeCatalog210.removeStormRestApiServiceComponent(); expectLastCall().once(); upgradeCatalog210.updateKerberosDescriptorArtifacts(); expectLastCall().once(); replay(upgradeCatalog210); upgradeCatalog210.executeDMLUpdates(); verify(upgradeCatalog210); }