|
@@ -18,6 +18,8 @@
|
|
|
|
|
|
package org.apache.ambari.server.upgrade;
|
|
|
|
|
|
+import javax.persistence.EntityManager;
|
|
|
+import junit.framework.Assert;
|
|
|
import static org.easymock.EasyMock.anyObject;
|
|
|
import static org.easymock.EasyMock.anyString;
|
|
|
import static org.easymock.EasyMock.capture;
|
|
@@ -41,8 +43,6 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
-import javax.persistence.EntityManager;
|
|
|
-
|
|
|
import org.apache.ambari.server.actionmanager.ActionManager;
|
|
|
import org.apache.ambari.server.configuration.Configuration;
|
|
|
import org.apache.ambari.server.controller.AmbariManagementController;
|
|
@@ -69,8 +69,6 @@ import com.google.inject.Injector;
|
|
|
import com.google.inject.Module;
|
|
|
import com.google.inject.Provider;
|
|
|
|
|
|
-import junit.framework.Assert;
|
|
|
-
|
|
|
/**
|
|
|
* {@link UpgradeCatalog250} unit tests.
|
|
|
*/
|
|
@@ -199,12 +197,15 @@ public class UpgradeCatalog250Test {
|
|
|
@Test
|
|
|
public void testExecuteDMLUpdates() throws Exception {
|
|
|
Method updateAmsConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateAMSConfigs");
|
|
|
+ Method addNewConfigurationsFromXml = AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
|
|
|
|
|
|
UpgradeCatalog250 upgradeCatalog250 = createMockBuilder(UpgradeCatalog250.class)
|
|
|
.addMockedMethod(updateAmsConfigs)
|
|
|
+ .addMockedMethod(addNewConfigurationsFromXml)
|
|
|
.createMock();
|
|
|
|
|
|
upgradeCatalog250.updateAMSConfigs();
|
|
|
+ upgradeCatalog250.addNewConfigurationsFromXml();
|
|
|
expectLastCall().once();
|
|
|
|
|
|
replay(upgradeCatalog250);
|