diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java index 146520fa11..40fafb21a8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog251.java @@ -93,6 +93,7 @@ protected void executePreDMLUpdates() throws AmbariException, SQLException { */ @Override protected void executeDMLUpdates() throws AmbariException, SQLException { + addNewConfigurationsFromXml(); } /** diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog251Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog251Test.java index 4575998c50..862ab6e46d 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog251Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog251Test.java @@ -20,13 +20,16 @@ import static org.easymock.EasyMock.anyObject; import static org.easymock.EasyMock.capture; +import static org.easymock.EasyMock.createMockBuilder; import static org.easymock.EasyMock.eq; import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.expectLastCall; import static org.easymock.EasyMock.newCapture; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.reset; import static org.easymock.EasyMock.verify; +import java.lang.reflect.Method; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; @@ -163,4 +166,21 @@ public void configure(Binder binder) { Assert.assertEquals(Integer.valueOf(0), captured.getDefaultValue()); Assert.assertEquals(Short.class, captured.getType()); } + + @Test + public void testExecuteDMLUpdates() throws Exception { + Method addNewConfigurationsFromXml = AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml"); + UpgradeCatalog251 upgradeCatalog251 = createMockBuilder(UpgradeCatalog251.class) + .addMockedMethod(addNewConfigurationsFromXml) + .createMock(); + + upgradeCatalog251.addNewConfigurationsFromXml(); + expectLastCall().once(); + + replay(upgradeCatalog251); + + upgradeCatalog251.executeDMLUpdates(); + + verify(upgradeCatalog251); + } }