ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adorosz...@apache.org
Subject [03/39] ambari git commit: AMBARI-22493. Fix build for test classes in feature branch.(vbrodetskyi)
Date Fri, 24 Nov 2017 12:39:45 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
index 110e359..efa351a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ComponentResourceProviderTest.java
@@ -244,13 +244,13 @@ public class ComponentResourceProviderTest {
     expect(service.getServiceComponents()).andReturn(serviceComponentMap).anyTimes();
 
     expect(serviceComponent1.convertToResponse()).andReturn(
-      new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component100", stackId, "", serviceComponentStateCountMap,
+      new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component100", stackId, "", serviceComponentStateCountMap,
               true /* recovery enabled */, "Component100 Client", null, null));
     expect(serviceComponent2.convertToResponse()).andReturn(
-      new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", stackId, "", serviceComponentStateCountMap,
+      new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component101", stackId, "", serviceComponentStateCountMap,
               false /* recovery not enabled */, "Component101 Client", null, null));
     expect(serviceComponent3.convertToResponse()).andReturn(
-      new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", stackId, "", serviceComponentStateCountMap,
+      new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component102", stackId, "", serviceComponentStateCountMap,
               true /* recovery enabled */, "Component102 Client", "1.1", RepositoryVersionState.CURRENT));
 
     expect(ambariMetaInfo.getComponent("FOO", "1.0", null, "Component100")).andReturn(
@@ -423,13 +423,13 @@ public class ComponentResourceProviderTest {
     expect(component3Info.getCategory()).andReturn(null);
 
     expect(serviceComponent1.convertToResponse()).andReturn(
-      new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", stackId, "", serviceComponentStateCountMap,
+      new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component101", stackId, "", serviceComponentStateCountMap,
               false /* recovery not enabled */, "Component101 Client", null, null));
     expect(serviceComponent2.convertToResponse()).andReturn(
-      new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", stackId, "", serviceComponentStateCountMap,
+      new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component102", stackId, "", serviceComponentStateCountMap,
               false /* recovery not enabled */, "Component102 Client", null, null));
     expect(serviceComponent3.convertToResponse()).andReturn(
-      new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component103", stackId, "", serviceComponentStateCountMap,
+      new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component103", stackId, "", serviceComponentStateCountMap,
               false /* recovery not enabled */, "Component103 Client", null, null));
     expect(serviceComponent1.getDesiredState()).andReturn(State.INSTALLED).anyTimes();
     expect(serviceComponent2.getDesiredState()).andReturn(State.INSTALLED).anyTimes();
@@ -731,7 +731,7 @@ public class ComponentResourceProviderTest {
     expect(component1Info.getCategory()).andReturn(null);
 
     expect(serviceComponent1.convertToResponse()).andReturn(
-        new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", stackId, "", serviceComponentStateCountMap,
+        new ServiceComponentResponse(100L, "Cluster100", 1L, "", 1L, "Service100", "", "Component101", stackId, "", serviceComponentStateCountMap,
             false /* recovery not enabled */, "Component101 Client", null, null));
     expect(serviceComponent1.getDesiredState()).andReturn(State.INSTALLED).anyTimes();
 
@@ -897,8 +897,8 @@ public class ComponentResourceProviderTest {
     expect(component4Info.getCategory()).andReturn(null);
 
     expect(service.getName()).andReturn("service1").anyTimes();
-    expect(service.getServiceComponent("component1")).andThrow(new ServiceComponentNotFoundException("cluster1", "service1", "component1"));
-    expect(service.getServiceComponent("component2")).andThrow(new ServiceComponentNotFoundException("cluster1", "service1", "component2"));
+    expect(service.getServiceComponent("component1")).andThrow(new ServiceComponentNotFoundException("cluster1", "service1", "component1", "", ""));
+    expect(service.getServiceComponent("component2")).andThrow(new ServiceComponentNotFoundException("cluster1", "service1", "component2", "", ""));
     expect(service.getServiceComponent("component3")).andReturn(component1);
     expect(service.getServiceComponent("component4")).andReturn(component2);
 
@@ -966,7 +966,7 @@ public class ComponentResourceProviderTest {
     expect(clusters.getCluster("cluster1")).andReturn(cluster);
     expect(cluster.getService("service1")).andReturn(service);
     expect(service.getServiceComponent("component1")).andThrow(
-        new ServiceComponentNotFoundException("cluster1", "service1", "component1"));
+        new ServiceComponentNotFoundException("cluster1", "service1", "component1", "", ""));
     // replay mocks
     replay(maintHelper, injector, clusters, cluster, service);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java
index 78f79ea..f90d5fc 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProviderTest.java
@@ -172,14 +172,16 @@ public class ConfigGroupResourceProviderTest {
 
     Capture<Cluster> clusterCapture = newCapture();
     Capture<String> serviceName = newCapture();
+    Capture<Long> servcieId = newCapture();
+    Capture<Long> servcieGroupId = newCapture();
     Capture<String> captureName = newCapture();
     Capture<String> captureDesc = newCapture();
     Capture<String> captureTag = newCapture();
     Capture<Map<String, Config>> captureConfigs = newCapture();
     Capture<Map<Long, Host>> captureHosts = newCapture();
 
-    expect(configGroupFactory.createNew(capture(clusterCapture), capture(serviceName),
-        capture(captureName), capture(captureTag), capture(captureDesc),
+    expect(configGroupFactory.createNew(capture(clusterCapture), capture(servcieGroupId), capture(servcieId), capture(serviceName),
+        capture(captureTag), capture(captureDesc),
         capture(captureConfigs), capture(captureHosts))).andReturn(configGroup);
 
     replay(managementController, clusters, cluster, configGroupFactory,
@@ -283,8 +285,8 @@ public class ConfigGroupResourceProviderTest {
     expect(managementController.getAuthName()).andReturn("admin").anyTimes();
     expect(cluster.getConfigGroups()).andReturn(configGroupMap);
 
-    expect(configGroupFactory.createNew((Cluster) anyObject(), (String) anyObject(), (String) anyObject(),
-        (String) anyObject(), (String) anyObject(), EasyMock.anyObject(),
+    expect(configGroupFactory.createNew((Cluster) anyObject(), (Long) anyObject(), (Long) anyObject(),
+        (String) anyObject(), (String) anyObject(), (String) anyObject(), EasyMock.anyObject(),
         EasyMock.anyObject())).andReturn(configGroup).anyTimes();
 
     expect(configGroup.getClusterName()).andReturn("Cluster100").anyTimes();

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequestTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequestTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequestTest.java
index e1f5583..743d1d5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequestTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ExportBlueprintRequestTest.java
@@ -120,7 +120,7 @@ public class ExportBlueprintRequestTest {
 
     // assertions
     assertEquals(CLUSTER_NAME, exportBlueprintRequest.getClusterName());
-    Blueprint bp = exportBlueprintRequest.getBlueprint();
+    Blueprint bp = null; exportBlueprintRequest.getBlueprint();
     assertEquals("exported-blueprint", bp.getName());
     Map<String, HostGroup> hostGroups = bp.getHostGroups();
     assertEquals(2, hostGroups.size());

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
index 7e32c15..6611c55 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
@@ -186,17 +186,17 @@ public class HostComponentResourceProviderTest {
     String repositoryVersion2 = "0.2-1234";
 
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component100", "Component 100", "Host100", "Host100",
+        1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component100", "Component 100", "Host100", "Host100",
         State.INSTALLED.toString(), stackId.getStackId(), State.STARTED.toString(),
         stackId2.getStackId(), repositoryVersion2, null));
 
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component101", "Component 101", "Host100", "Host100",
+        1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component101", "Component 101", "Host100", "Host100",
         State.INSTALLED.toString(), stackId.getStackId(), State.STARTED.toString(),
         stackId2.getStackId(), repositoryVersion2, null));
 
     allResponse.add(new ServiceComponentHostResponse(
-        "Cluster100", "Service100", "Component102", "Component 102", "Host100", "Host100",
+        1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component102", "Component 102", "Host100", "Host100",
         State.INSTALLED.toString(), stackId.getStackId(), State.STARTED.toString(),
         stackId2.getStackId(), repositoryVersion2, null));
 
@@ -353,12 +353,12 @@ public class HostComponentResourceProviderTest {
 
     Set<ServiceComponentHostResponse> nameResponse = new HashSet<>();
     nameResponse.add(new ServiceComponentHostResponse(
-        "Cluster102", "Service100", "Component100", "Component 100", "Host100", "Host100",
+        1L, "Cluster102", 1L, "", 1L, "Service100", "", 1L, "Component100", "Component 100", "Host100", "Host100",
         "INSTALLED", "", "", "", "", null));
 
     // set expectations
     expect(managementController.getClusters()).andReturn(clusters).anyTimes();
-    expect(managementController.findServiceName(cluster, "Component100")).andReturn("Service100").anyTimes();
+    //expect(managementController.findServiceName(cluster, "Component100")).andReturn("Service100").anyTimes();
     expect(clusters.getCluster("Cluster102")).andReturn(cluster).anyTimes();
     expect(cluster.getClusterId()).andReturn(2L).anyTimes();
     expect(cluster.getService("Service100")).andReturn(service).anyTimes();
@@ -555,12 +555,12 @@ public class HostComponentResourceProviderTest {
 
     Set<ServiceComponentHostResponse> nameResponse = new HashSet<>();
     nameResponse.add(new ServiceComponentHostResponse(
-        "Cluster102", "Service100", "Component100", "Component 100", "Host100", "Host100",
+        1L, "Cluster102", 1L, "", 1L, "Service100", "", 1L, "Component100", "Component 100", "Host100", "Host100",
         "INSTALLED", "", "", "", "", null));
 
     // set expectations
     expect(managementController.getClusters()).andReturn(clusters).anyTimes();
-    expect(managementController.findServiceName(cluster, "Component100")).andReturn("Service100").anyTimes();
+    //expect(managementController.findServiceName(cluster, "Component100")).andReturn("Service100").anyTimes();
     expect(clusters.getCluster("Cluster102")).andReturn(cluster).anyTimes();
     expect(cluster.getClusterId()).andReturn(2L).anyTimes();
     expect(cluster.getService("Service100")).andReturn(service).anyTimes();

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
index fd28081..90b7ea9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostResourceProviderTest.java
@@ -320,11 +320,11 @@ public class HostResourceProviderTest extends EasyMockSupport {
     Set<Cluster> clusterSet = new HashSet<>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Component 100",
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component100", "Component 100",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Component 102",
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse(1L,"Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component102", "Component 102",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Component 103",
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse(1L,"Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component103", "Component 103",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<>();
@@ -418,11 +418,11 @@ public class HostResourceProviderTest extends EasyMockSupport {
     Set<Cluster> clusterSet = new HashSet<>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Component 100",
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component100", "Component 100",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Component 102",
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component102", "Component 102",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Component 103",
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component103", "Component 103",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<>();
@@ -513,11 +513,11 @@ public class HostResourceProviderTest extends EasyMockSupport {
     Set<Cluster> clusterSet = new HashSet<>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Component 100",
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component100", "Component 100",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Component 102",
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component102", "Component 102",
         "Host100", "Host100", "INSTALLED", "", null, null, null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Component 103",
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component103", "Component 103",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<>();
@@ -706,7 +706,7 @@ public class HostResourceProviderTest extends EasyMockSupport {
     Set<Cluster> clusterSet = new HashSet<>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Component 100",
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component100", "Component 100",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<>();
@@ -793,11 +793,11 @@ public class HostResourceProviderTest extends EasyMockSupport {
     Set<Cluster> clusterSet = new HashSet<>();
     clusterSet.add(cluster);
 
-    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component100", "Component 100",
+    ServiceComponentHostResponse shr1 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component100", "Component 100",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
-    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component102", "Component 102",
+    ServiceComponentHostResponse shr2 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component102", "Component 102",
         "Host100", "Host100", "INSTALLED", "", null, null, null, null);
-    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse("Cluster100", "Service100", "Component103", "Component 103",
+    ServiceComponentHostResponse shr3 = new ServiceComponentHostResponse(1L, "Cluster100", 1L, "", 1L, "Service100", "", 1L, "Component103", "Component 103",
         "Host100", "Host100", "STARTED", "", null, null, null, null);
 
     Set<ServiceComponentHostResponse> responses = new HashSet<>();

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
index e19ad29..e23ad79 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java
@@ -124,7 +124,7 @@ public class JMXHostProviderTest {
       dStateStr = desiredState.toString();
     }
 
-    ServiceRequest r1 = new ServiceRequest(clusterName, serviceName, m_repositoryVersion.getId(), dStateStr);
+    ServiceRequest r1 = new ServiceRequest(clusterName, "", serviceName, m_repositoryVersion.getId(), dStateStr, null);
 
     Set<ServiceRequest> requests = new HashSet<>();
     requests.add(r1);
@@ -140,7 +140,7 @@ public class JMXHostProviderTest {
     if (desiredState != null) {
       dStateStr = desiredState.toString();
     }
-    ServiceComponentRequest r = new ServiceComponentRequest(clusterName,
+    ServiceComponentRequest r = new ServiceComponentRequest(clusterName, "",
       serviceName, componentName, dStateStr);
     Set<ServiceComponentRequest> requests =
       new HashSet<>();
@@ -155,7 +155,7 @@ public class JMXHostProviderTest {
     if (desiredState != null) {
       dStateStr = desiredState.toString();
     }
-    ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName,
+    ServiceComponentHostRequest r = new ServiceComponentHostRequest(clusterName, "",
       serviceName, componentName, hostname, dStateStr);
     Set<ServiceComponentHostRequest> requests =
       new HashSet<>();
@@ -216,7 +216,7 @@ public class JMXHostProviderTest {
       configs.put("ambari.dfs.datanode.http.port", "70070");
 
       ConfigurationRequest cr = new ConfigurationRequest(clusterName,
-        "hdfs-site", "version1", configs, null);
+        "hdfs-site", "version1", configs, null, 1L, 1L);
       ClusterRequest crequest = new ClusterRequest(cluster.getClusterId(), clusterName, null, null);
       crequest.setDesiredConfig(Collections.singletonList(cr));
       controller.updateClusters(Collections.singleton(crequest), new HashMap<>());
@@ -227,7 +227,7 @@ public class JMXHostProviderTest {
       configs.put(DATANODE_PORT, "localhost:70075");
 
       ConfigurationRequest cr = new ConfigurationRequest(clusterName,
-        "hdfs-site", "version2", configs, null);
+        "hdfs-site", "version2", configs, null, 1L, 1L);
 
       ClusterRequest crequest = new ClusterRequest(cluster.getClusterId(), clusterName, null, null);
       crequest.setDesiredConfig(Collections.singletonList(cr));
@@ -344,7 +344,7 @@ public class JMXHostProviderTest {
     hbaseConfigs.put("hbase.ssl.enabled", "true");
 
     ConfigurationRequest cr1 = new ConfigurationRequest(clusterName,
-      "hdfs-site", "versionN", configs, null);
+      "hdfs-site", "versionN", configs, null, 1L, 1L);
 
     ClusterRequest crReq = new ClusterRequest(cluster.getClusterId(), clusterName, null, null);
     crReq.setDesiredConfig(Collections.singletonList(cr1));
@@ -354,17 +354,17 @@ public class JMXHostProviderTest {
       .getTag());
 
     ConfigurationRequest cr2 = new ConfigurationRequest(clusterName,
-      "yarn-site", "versionN", yarnConfigs, null);
+      "yarn-site", "versionN", yarnConfigs, null, 1L, 1L);
     crReq.setDesiredConfig(Collections.singletonList(cr2));
     controller.updateClusters(Collections.singleton(crReq), null);
 
     ConfigurationRequest cr3 = new ConfigurationRequest(clusterName,
-        "mapred-site", "versionN", mapreduceConfigs, null);
+        "mapred-site", "versionN", mapreduceConfigs, null, 1L ,1L);
       crReq.setDesiredConfig(Collections.singletonList(cr3));
       controller.updateClusters(Collections.singleton(crReq), null);
 
     ConfigurationRequest cr4 = new ConfigurationRequest(clusterName,
-        "hbase-site", "versionN", hbaseConfigs, null);
+        "hbase-site", "versionN", hbaseConfigs, null, 1L, 1L);
       crReq.setDesiredConfig(Collections.singletonList(cr4));
       controller.updateClusters(Collections.singleton(crReq), null);
 
@@ -434,7 +434,7 @@ public class JMXHostProviderTest {
 
 
     ConfigurationRequest cr1 = new ConfigurationRequest(clusterName,
-        "hdfs-site", "version1", configs, null);
+        "hdfs-site", "version1", configs, null, 1L, 1L);
 
     ClusterRequest crReq = new ClusterRequest(cluster.getClusterId(), clusterName, null, null);
     crReq.setDesiredConfig(Collections.singletonList(cr1));
@@ -533,7 +533,7 @@ public class JMXHostProviderTest {
     hostComponents.put("host1", null);
 
     expect(managementControllerMock.getClusters()).andReturn(clustersMock).anyTimes();
-    expect(managementControllerMock.findServiceName(clusterMock, "DATANODE")).andReturn("HDFS");
+    //expect(managementControllerMock.findServiceName(clusterMock, "DATANODE")).andReturn("HDFS");
     expect(clustersMock.getCluster("c1")).andReturn(clusterMock).anyTimes();
     expect(clusterMock.getService("HDFS")).andReturn(serviceMock).anyTimes();
     expect(serviceMock.getServiceComponent("DATANODE")).andReturn(serviceComponentMock).anyTimes();
@@ -632,7 +632,7 @@ public class JMXHostProviderTest {
     yarnConfigs.put(RESOURCEMANAGER_PORT, "localhost:50030");
     yarnConfigs.put(NODEMANAGER_PORT, "localhost:11111");
     ConfigurationRequest cr2 = new ConfigurationRequest("c1",
-      "yarn-site", "versionN+1", yarnConfigs, null);
+      "yarn-site", "versionN+1", yarnConfigs, null, 1L, 1L);
 
     ClusterRequest crReq = new ClusterRequest(1L, "c1", null, null);
     crReq.setDesiredConfig(Collections.singletonList(cr2));

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequestTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequestTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequestTest.java
index 5ed582f..01d69a5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequestTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequestTest.java
@@ -82,7 +82,7 @@ public class ProvisionClusterRequestTest {
   @Before
   public void setUp() throws Exception {
     reset(blueprintFactory, blueprint, hostResourceProvider);
-    ProvisionClusterRequest.init(blueprintFactory);
+    ProvisionClusterRequest.init(null);
     // set host resource provider field
     Class clazz = BaseClusterRequest.class;
     Field f = clazz.getDeclaredField("hostResourceProvider");

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
index c0695b1..4e52250 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
@@ -1717,7 +1717,7 @@ public class RequestResourceProviderTest {
 
     TopologyRequest topologyRequest = createNiceMock(TopologyRequest.class);
     expect(topologyRequest.getHostGroupInfo()).andReturn(hostGroupInfoMap).anyTimes();
-    expect(topology.getBlueprint()).andReturn(blueprint).anyTimes();
+    expect(topology.getBlueprint()).andReturn(null).anyTimes();
     expect(blueprint.shouldSkipFailure()).andReturn(true).anyTimes();
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java
index 2a03b1f..b1e52cc 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java
@@ -75,7 +75,7 @@ public class ScaleClusterRequestTest {
 
   @Before
   public void setUp() throws Exception {
-    ScaleClusterRequest.init(blueprintFactory);
+    ScaleClusterRequest.init(null);
     // set host resource provider field
     Class clazz = BaseClusterRequest.class;
     Field f = clazz.getDeclaredField("hostResourceProvider");

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
index 20730d1..4593409 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
@@ -123,7 +123,7 @@ public class ServiceResourceProviderTest {
     expect(managementController.getClusters()).andReturn(clusters).anyTimes();
     expect(managementController.getAmbariMetaInfo()).andReturn(ambariMetaInfo).anyTimes();
 
-    expect(cluster.addService(eq("Service100"),
+    expect(cluster.addService(eq(anyObject()), eq("Service100"), eq(anyObject()),
         EasyMock.anyObject(RepositoryVersionEntity.class))).andReturn(service);
 
     expect(clusters.getCluster("Cluster100")).andReturn(cluster).anyTimes();
@@ -1170,7 +1170,7 @@ public class ServiceResourceProviderTest {
     expect(managementController.getClusters()).andReturn(clusters).anyTimes();
     expect(managementController.getAmbariMetaInfo()).andReturn(ambariMetaInfo).anyTimes();
 
-    expect(cluster.addService(eq("Service200"), EasyMock.anyObject(RepositoryVersionEntity.class))).andReturn(service2);
+    expect(cluster.addService(eq(anyObject()), eq("Service200"), eq(anyObject()), EasyMock.anyObject(RepositoryVersionEntity.class))).andReturn(service2);
 
     expect(clusters.getCluster("Cluster100")).andReturn(cluster).anyTimes();
 
@@ -1242,7 +1242,7 @@ public class ServiceResourceProviderTest {
     expect(managementController.getClusters()).andReturn(clusters).anyTimes();
     expect(managementController.getAmbariMetaInfo()).andReturn(ambariMetaInfo).anyTimes();
 
-    expect(cluster.addService(eq("Service200"), EasyMock.anyObject(RepositoryVersionEntity.class))).andReturn(service2);
+    expect(cluster.addService(eq(anyObject()), eq("Service200"), eq(anyObject()), EasyMock.anyObject(RepositoryVersionEntity.class))).andReturn(service2);
 
     expect(clusters.getCluster("Cluster100")).andReturn(cluster).anyTimes();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProviderTest.java
index 9c48ad0..91c048b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackConfigurationResourceProviderTest.java
@@ -29,7 +29,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.ambari.server.controller.AmbariManagementController;
-import org.apache.ambari.server.controller.StackConfigurationResponse;
+import org.apache.ambari.server.controller.StackLevelConfigurationResponse;
 import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.spi.ResourceProvider;
@@ -54,14 +54,14 @@ public class StackConfigurationResourceProviderTest {
 
     AmbariManagementController managementController = createMock(AmbariManagementController.class);
 
-    Set<StackConfigurationResponse> allResponse = new HashSet<>();
+    Set<StackLevelConfigurationResponse> allResponse = new HashSet<>();
     
-    allResponse.add(new StackConfigurationResponse(PROPERTY_NAME, PROPERTY_VALUE, PROPERTY_DESC, TYPE, attributes));
+    allResponse.add(new StackLevelConfigurationResponse(PROPERTY_NAME, PROPERTY_VALUE, PROPERTY_DESC, TYPE, attributes));
    
     // set expectations
     expect(managementController.getStackConfigurations(
         AbstractResourceProviderTest.Matcher.getStackConfigurationRequestSet(null, null, null, null))).
-        andReturn(allResponse).times(1);
+        andReturn(null).times(1);
     // replay
     replay(managementController);
 
@@ -126,14 +126,14 @@ public class StackConfigurationResourceProviderTest {
 
     AmbariManagementController managementController = createMock(AmbariManagementController.class);
 
-    Set<StackConfigurationResponse> allResponse = new HashSet<>();
+    Set<StackLevelConfigurationResponse> allResponse = new HashSet<>();
 
-    allResponse.add(new StackConfigurationResponse(PROPERTY_NAME, PROPERTY_VALUE, PROPERTY_DESC, TYPE, attributes));
+    allResponse.add(new StackLevelConfigurationResponse(PROPERTY_NAME, PROPERTY_VALUE, PROPERTY_DESC, TYPE, attributes));
 
     // set expectations
     expect(managementController.getStackConfigurations(
         AbstractResourceProviderTest.Matcher.getStackConfigurationRequestSet(null, null, null, null))).
-        andReturn(allResponse).times(1);
+        andReturn(null).times(1);
     // replay
     replay(managementController);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProviderTest.java
index e3fa676..aee1952 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProviderTest.java
@@ -139,22 +139,22 @@ public class StackDefinedPropertyProviderTest {
 
     cluster.setDesiredStackVersion(stackId);
     RepositoryVersionEntity repositoryVersion = helper.getOrCreateRepositoryVersion(stackId, stackId.getStackVersion());
-    Service service = cluster.addService("HDFS", repositoryVersion);
+    Service service = cluster.addService(null, "HDFS", "", repositoryVersion);
     service.addServiceComponent("NAMENODE");
     service.addServiceComponent("DATANODE");
     service.addServiceComponent("JOURNALNODE");
 
-    service = cluster.addService("YARN", repositoryVersion);
+    service = cluster.addService(null, "YARN", "", repositoryVersion);
     service.addServiceComponent("RESOURCEMANAGER");
 
-    service = cluster.addService("HBASE", repositoryVersion);
+    service = cluster.addService(null, "HBASE", "", repositoryVersion);
     service.addServiceComponent("HBASE_MASTER");
     service.addServiceComponent("HBASE_REGIONSERVER");
 
     stackId = new StackId("HDP-2.1.1");
     repositoryVersion = helper.getOrCreateRepositoryVersion(stackId, stackId.getStackVersion());
 
-    service = cluster.addService("STORM", repositoryVersion);
+    service = cluster.addService(null, "STORM", "", repositoryVersion);
     service.addServiceComponent("STORM_REST_API");
 
     clusters.addHost("h1");

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProviderTest.java
index e9742bd..a50c3ad 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackLevelConfigurationResourceProviderTest.java
@@ -29,7 +29,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.ambari.server.controller.AmbariManagementController;
-import org.apache.ambari.server.controller.StackConfigurationResponse;
+import org.apache.ambari.server.controller.StackLevelConfigurationResponse;
 import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.spi.ResourceProvider;
@@ -54,14 +54,14 @@ public class StackLevelConfigurationResourceProviderTest {
 
     AmbariManagementController managementController = createMock(AmbariManagementController.class);
 
-    Set<StackConfigurationResponse> allResponse = new HashSet<>();
+    Set<StackLevelConfigurationResponse> allResponse = new HashSet<>();
     
-    allResponse.add(new StackConfigurationResponse(PROPERTY_NAME, PROPERTY_VALUE, PROPERTY_DESC, TYPE, attributes));
+    allResponse.add(new StackLevelConfigurationResponse(PROPERTY_NAME, PROPERTY_VALUE, PROPERTY_DESC, TYPE, attributes));
    
     // set expectations
     expect(managementController.getStackLevelConfigurations(
         AbstractResourceProviderTest.Matcher.getStackLevelConfigurationRequestSet(null, null, null))).
-        andReturn(allResponse).times(1);
+        andReturn(null).times(1);
     // replay
     replay(managementController);
 
@@ -120,14 +120,14 @@ public class StackLevelConfigurationResourceProviderTest {
 
     AmbariManagementController managementController = createMock(AmbariManagementController.class);
 
-    Set<StackConfigurationResponse> allResponse = new HashSet<>();
+    Set<StackLevelConfigurationResponse> allResponse = new HashSet<>();
 
-    allResponse.add(new StackConfigurationResponse(PROPERTY_NAME, PROPERTY_VALUE, PROPERTY_DESC, TYPE, attributes));
+    allResponse.add(new StackLevelConfigurationResponse(PROPERTY_NAME, PROPERTY_VALUE, PROPERTY_DESC, TYPE, attributes));
 
     // set expectations
     expect(managementController.getStackLevelConfigurations(
         AbstractResourceProviderTest.Matcher.getStackLevelConfigurationRequestSet(null, null, null))).
-        andReturn(allResponse).times(1);
+        andReturn(null).times(1);
     // replay
     replay(managementController);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackTest.java
index 68257d1..9e61a70 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackTest.java
@@ -38,8 +38,9 @@ import java.util.Set;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.StackConfigurationRequest;
-import org.apache.ambari.server.controller.StackConfigurationResponse;
+//import org.apache.ambari.server.controller.StackConfigurationResponse;
 import org.apache.ambari.server.controller.StackLevelConfigurationRequest;
+import org.apache.ambari.server.controller.StackLevelConfigurationResponse;
 import org.apache.ambari.server.controller.StackServiceComponentRequest;
 import org.apache.ambari.server.controller.StackServiceComponentResponse;
 import org.apache.ambari.server.controller.StackServiceRequest;
@@ -71,7 +72,7 @@ public class StackTest {
     StackServiceComponentResponse stackComponentResponse = createNiceMock(StackServiceComponentResponse.class);
     Capture<Set<StackConfigurationRequest>> stackConfigurationRequestCapture = EasyMock.newCapture();
     Capture<Set<StackLevelConfigurationRequest>> stackLevelConfigurationRequestCapture = EasyMock.newCapture();
-    StackConfigurationResponse stackConfigurationResponse = EasyMock.createNiceMock(StackConfigurationResponse.class);
+    StackLevelConfigurationResponse stackConfigurationResponse = EasyMock.createNiceMock(StackLevelConfigurationResponse.class);
 
     expect(controller.getStackServices(capture(stackServiceRequestCapture))).
         andReturn(Collections.singleton(stackServiceResponse)).anyTimes();
@@ -134,7 +135,7 @@ public class StackTest {
 
     Set<PropertyDependencyInfo> setOfDependencyInfo = new HashSet<>();
 
-    StackConfigurationResponse mockResponse = mockSupport.createMock(StackConfigurationResponse.class);
+    StackLevelConfigurationResponse mockResponse = mockSupport.createMock(StackLevelConfigurationResponse.class);
     expect(mockResponse.getPropertyName()).andReturn("test-property-one");
     expect(mockResponse.getPropertyValue()).andReturn("test-value-one");
     expect(mockResponse.getPropertyAttributes()).andReturn(Collections.emptyMap());
@@ -166,8 +167,8 @@ public class StackTest {
     StackServiceComponentResponse stackComponentResponse = createNiceMock(StackServiceComponentResponse.class);
     Capture<Set<StackConfigurationRequest>> stackConfigurationRequestCapture = EasyMock.newCapture();
     Capture<Set<StackLevelConfigurationRequest>> stackLevelConfigurationRequestCapture = EasyMock.newCapture();
-    StackConfigurationResponse stackConfigurationResponse = EasyMock.createNiceMock(StackConfigurationResponse.class);
-    StackConfigurationResponse stackConfigurationResponse2 = EasyMock.createNiceMock(StackConfigurationResponse.class);
+    StackLevelConfigurationResponse stackConfigurationResponse = EasyMock.createNiceMock(StackLevelConfigurationResponse.class);
+    StackLevelConfigurationResponse stackConfigurationResponse2 = EasyMock.createNiceMock(StackLevelConfigurationResponse.class);
 
     expect(controller.getStackServices(capture(stackServiceRequestCapture))).
         andReturn(Collections.singleton(stackServiceResponse)).anyTimes();
@@ -249,8 +250,8 @@ public class StackTest {
     AmbariMetaInfo metaInfo = createNiceMock(AmbariMetaInfo.class);
     StackServiceResponse stackServiceResponse = createNiceMock(StackServiceResponse.class);
     StackServiceComponentResponse stackComponentResponse = createNiceMock(StackServiceComponentResponse.class);
-    StackConfigurationResponse stackConfigurationResponse1 = createNiceMock(StackConfigurationResponse.class);
-    StackConfigurationResponse stackConfigurationResponse2 = createNiceMock(StackConfigurationResponse.class);
+    StackLevelConfigurationResponse stackConfigurationResponse1 = createNiceMock(StackLevelConfigurationResponse.class);
+    StackLevelConfigurationResponse stackConfigurationResponse2 = createNiceMock(StackLevelConfigurationResponse.class);
 
     String testServiceName = "service1";
     String testEmptyConfigType = "test-empty-config-type";
@@ -320,7 +321,7 @@ public class StackTest {
     AmbariMetaInfo metaInfo = createNiceMock(AmbariMetaInfo.class);
     StackServiceResponse stackServiceResponse = createNiceMock(StackServiceResponse.class);
     StackServiceComponentResponse stackComponentResponse = createNiceMock(StackServiceComponentResponse.class);
-    StackConfigurationResponse stackConfigurationResponse1 = createNiceMock(StackConfigurationResponse.class);
+    StackLevelConfigurationResponse stackConfigurationResponse1 = createNiceMock(StackLevelConfigurationResponse.class);
 
     String testServiceName = "service1";
     String testEmptyConfigType = "test-empty-config-type";

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java
index 51be08b..b7bf53d 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackUpgradeConfigurationMergeTest.java
@@ -17,7 +17,7 @@
  */
 package org.apache.ambari.server.controller.internal;
 
-import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.anyLong;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.expectLastCall;
 import static org.junit.Assert.assertEquals;
@@ -261,7 +261,7 @@ public class StackUpgradeConfigurationMergeTest extends EasyMockSupport {
     ServiceConfigDAO serviceConfigDAOMock = m_injector.getInstance(ServiceConfigDAO.class);
     List<ServiceConfigEntity> latestServiceConfigs = Lists.newArrayList(zookeeperServiceConfig);
     expect(serviceConfigDAOMock.getLastServiceConfigsForService(EasyMock.anyLong(),
-        eq("ZOOKEEPER"))).andReturn(latestServiceConfigs).once();
+        anyLong())).andReturn(latestServiceConfigs).once();
 
     UpgradeContext context = createNiceMock(UpgradeContext.class);
     expect(context.getCluster()).andReturn(cluster).atLeastOnce();
@@ -393,7 +393,7 @@ public class StackUpgradeConfigurationMergeTest extends EasyMockSupport {
     ServiceConfigDAO serviceConfigDAOMock = m_injector.getInstance(ServiceConfigDAO.class);
     List<ServiceConfigEntity> latestServiceConfigs = Lists.newArrayList(zookeeperServiceConfig);
     expect(serviceConfigDAOMock.getLastServiceConfigsForService(EasyMock.anyLong(),
-        eq(serviceName))).andReturn(latestServiceConfigs).once();
+        anyLong())).andReturn(latestServiceConfigs).once();
 
     UpgradeContext context = createNiceMock(UpgradeContext.class);
     expect(context.getCluster()).andReturn(cluster).atLeastOnce();

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UnitUpdaterTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UnitUpdaterTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UnitUpdaterTest.java
index 6de6cd1..320e167 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UnitUpdaterTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UnitUpdaterTest.java
@@ -24,7 +24,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.ambari.server.controller.StackConfigurationResponse;
+import org.apache.ambari.server.controller.StackLevelConfigurationResponse;
 import org.apache.ambari.server.state.ValueAttributesInfo;
 import org.apache.ambari.server.topology.Blueprint;
 import org.apache.ambari.server.topology.ClusterTopology;
@@ -89,7 +89,7 @@ public class UnitUpdaterTest extends EasyMockSupport {
   private void stackUnitIs(String name, String unit) {
     ValueAttributesInfo propertyValueAttributes = new ValueAttributesInfo();
     propertyValueAttributes.setUnit(unit);
-    stackConfigWithMetadata.put(name, new Stack.ConfigProperty(new StackConfigurationResponse(
+    stackConfigWithMetadata.put(name, new Stack.ConfigProperty(new StackLevelConfigurationResponse(
       name,
       "any",
       "any",
@@ -105,10 +105,10 @@ public class UnitUpdaterTest extends EasyMockSupport {
 
   private String updateUnit(String serviceName, String configType, String propName, String propValue) throws InvalidTopologyException, ConfigurationTopologyException {
     UnitUpdater updater = new UnitUpdater(serviceName, configType);
-    expect(clusterTopology.getBlueprint()).andReturn(blueprint).anyTimes();
+    expect(clusterTopology.getBlueprint()).andReturn(null).anyTimes();
     expect(blueprint.getStack()).andReturn(stack).anyTimes();
     expect(stack.getConfigurationPropertiesWithMetadata(serviceName, configType)).andReturn(stackConfigWithMetadata).anyTimes();
     replayAll();
-    return updater.updateForClusterCreate(propName, propValue, Collections.emptyMap(), clusterTopology);
+    return updater.updateForClusterCreate(propName, propValue, Collections.emptyMap(), clusterTopology, null);
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
index d6b1ab3..9c5fb98 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
@@ -260,7 +260,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
     clusters.mapHostToCluster("h1", "c1");
 
     // add a single ZK server and client on 2.1.1.0
-    Service service = cluster.addService("ZOOKEEPER", repoVersionEntity2110);
+    Service service = cluster.addService(null, "ZOOKEEPER", "", repoVersionEntity2110);
     ServiceComponent component = service.addServiceComponent("ZOOKEEPER_SERVER");
     ServiceComponentHost sch = component.addServiceComponentHost("h1");
     sch.setVersion("2.1.1.0");
@@ -321,7 +321,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
     assertEquals(1, upgrades.size());
 
     UpgradeEntity entity = upgrades.get(0);
-    assertEquals(cluster.getClusterId(), entity.getClusterId().longValue());
+    assertTrue(cluster.getClusterId().longValue() == entity.getClusterId().longValue());
 
     List<UpgradeGroupEntity> upgradeGroups = entity.getUpgradeGroups();
     assertEquals(3, upgradeGroups.size());
@@ -382,7 +382,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
     assertEquals(1, upgrades.size());
 
     UpgradeEntity entity = upgrades.get(0);
-    assertEquals(cluster.getClusterId(), entity.getClusterId().longValue());
+    assertTrue(cluster.getClusterId().longValue() == entity.getClusterId().longValue());
 
     List<UpgradeGroupEntity> upgradeGroups = entity.getUpgradeGroups();
     assertEquals(2, upgradeGroups.size());
@@ -428,7 +428,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
     assertEquals(1, upgrades.size());
 
     UpgradeEntity entity = upgrades.get(0);
-    assertEquals(cluster.getClusterId(), entity.getClusterId().longValue());
+    assertTrue(cluster.getClusterId().longValue() == entity.getClusterId().longValue());
 
     List<UpgradeGroupEntity> upgradeGroups = entity.getUpgradeGroups();
     assertEquals(2, upgradeGroups.size());
@@ -682,7 +682,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
     assertEquals(2, upgrades.size());
 
     UpgradeEntity downgrade = upgrades.get(1);
-    assertEquals(cluster.getClusterId(), downgrade.getClusterId().longValue());
+    assertTrue(cluster.getClusterId().longValue() == downgrade.getClusterId().longValue());
 
     List<UpgradeGroupEntity> upgradeGroups = downgrade.getUpgradeGroups();
     assertEquals(3, upgradeGroups.size());
@@ -780,7 +780,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
     Cluster cluster = clusters.getCluster("c1");
 
     // add additional service for the test
-    Service service = cluster.addService("HIVE", repoVersionEntity2110);
+    Service service = cluster.addService(null, "HIVE", "", repoVersionEntity2110);
 
     ServiceComponent component = service.addServiceComponent("HIVE_SERVER");
     ServiceComponentHost sch = component.addServiceComponentHost("h1");
@@ -1200,7 +1200,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
     assertEquals(1, upgrades.size());
 
     UpgradeEntity entity = upgrades.get(0);
-    assertEquals(cluster.getClusterId(), entity.getClusterId().longValue());
+    assertTrue(cluster.getClusterId().longValue() == entity.getClusterId().longValue());
     assertEquals(UpgradeType.ROLLING, entity.getUpgradeType());
 
     StageDAO stageDAO = injector.getInstance(StageDAO.class);
@@ -1455,7 +1455,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
   @Test
   public void testCreateUpgradeDowngradeCycleAdvertisingVersion() throws Exception {
     Cluster cluster = clusters.getCluster("c1");
-    Service service = cluster.addService("STORM", repoVersionEntity2110);
+    Service service = cluster.addService(null, "STORM", "", repoVersionEntity2110);
 
     ServiceComponent component = service.addServiceComponent("DRPC_SERVER");
     ServiceComponentHost sch = component.addServiceComponentHost("h1");
@@ -1638,7 +1638,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
     Cluster cluster = clusters.getCluster("c1");
 
     // add a single ZK server and client on 2.1.1.0
-    Service service = cluster.addService("HBASE", repoVersionEntity2110);
+    Service service = cluster.addService(null, "HBASE", "", repoVersionEntity2110);
     ServiceComponent component = service.addServiceComponent("HBASE_MASTER");
     ServiceComponentHost sch = component.addServiceComponentHost("h1");
     sch.setVersion("2.1.1.0");
@@ -1725,7 +1725,7 @@ public class UpgradeResourceProviderTest extends EasyMockSupport {
     Cluster cluster = clusters.getCluster("c1");
 
     // add a single ZK server and client on 2.1.1.0
-    Service service = cluster.addService("HBASE", repoVersionEntity2110);
+    Service service = cluster.addService(null, "HBASE", "", repoVersionEntity2110);
     ServiceComponent component = service.addServiceComponent("HBASE_MASTER");
     ServiceComponentHost sch = component.addServiceComponentHost("h1");
     sch.setVersion("2.1.1.0");

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeSummaryResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeSummaryResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeSummaryResourceProviderTest.java
index 4834ef8..387fa45 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeSummaryResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeSummaryResourceProviderTest.java
@@ -173,7 +173,7 @@ public class UpgradeSummaryResourceProviderTest {
     clusters.mapHostToCluster("h1", "c1");
 
     // add a single ZOOKEEPER server
-    Service service = cluster.addService("ZOOKEEPER", repoVersionEntity);
+    Service service = cluster.addService(null, "ZOOKEEPER", "", repoVersionEntity);
 
     ServiceComponent component = service.addServiceComponent("ZOOKEEPER_SERVER");
     ServiceComponentHost sch = component.addServiceComponentHost("h1");

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProviderTest.java
index 402a8f8..8e968cc 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProviderTest.java
@@ -695,7 +695,7 @@ public class VersionDefinitionResourceProviderTest {
       cluster = clusters.getCluster("c1");
     }
 
-    cluster.addService(serviceName, serviceRepo);
+    cluster.addService(null, serviceName, "", serviceRepo);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProviderTest.java
index 1d19632..e9f7c4d 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProviderTest.java
@@ -198,7 +198,7 @@ public class LoggingSearchPropertyProviderTest {
           mockSupport.createMock(LogDefinition.class);
 
       Service serviceMock = mockSupport.createNiceMock(Service.class);
-      expect(controllerMock.findServiceName(clusterMock, expectedComponentName)).andReturn(expectedServiceName).atLeastOnce();
+      //expect(controllerMock.findServiceName(clusterMock, expectedComponentName)).andReturn(expectedServiceName).atLeastOnce();
       expect(clusterMock.getService(expectedServiceName)).andReturn(serviceMock).anyTimes();
       expect(serviceMock.getDesiredStackId()).andReturn(stackIdMock).anyTimes();
 
@@ -406,7 +406,7 @@ public class LoggingSearchPropertyProviderTest {
           mockSupport.createMock(LoggingRequestHelper.class);
 
       Service serviceMock = mockSupport.createNiceMock(Service.class);
-      expect(controllerMock.findServiceName(clusterMock, expectedComponentName)).andReturn(expectedServiceName).atLeastOnce();
+      //expect(controllerMock.findServiceName(clusterMock, expectedComponentName)).andReturn(expectedServiceName).atLeastOnce();
       expect(clusterMock.getService(expectedServiceName)).andReturn(serviceMock).anyTimes();
       expect(serviceMock.getDesiredStackId()).andReturn(stackIdMock).anyTimes();
 
@@ -573,7 +573,7 @@ public class LoggingSearchPropertyProviderTest {
           mockSupport.createMock(LoggingRequestHelper.class);
 
       Service serviceMock = mockSupport.createNiceMock(Service.class);
-      expect(controllerMock.findServiceName(clusterMock, expectedComponentName)).andReturn(expectedServiceName).atLeastOnce();
+      //expect(controllerMock.findServiceName(clusterMock, expectedComponentName)).andReturn(expectedServiceName).atLeastOnce();
       expect(clusterMock.getService(expectedServiceName)).andReturn(serviceMock).anyTimes();
       expect(serviceMock.getDesiredStackId()).andReturn(stackIdMock).anyTimes();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/KerberosIdentityCleanerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/KerberosIdentityCleanerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/KerberosIdentityCleanerTest.java
index 2518da9..687cbee 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/KerberosIdentityCleanerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/KerberosIdentityCleanerTest.java
@@ -163,11 +163,11 @@ public class KerberosIdentityCleanerTest extends EasyMockSupport {
   }
 
   private void uninstallComponent(String service, String component, String host) throws KerberosMissingAdminCredentialsException {
-    kerberosIdentityCleaner.componentRemoved(new ServiceComponentUninstalledEvent(CLUSTER_ID, "any", "any", service, component, host, false));
+    kerberosIdentityCleaner.componentRemoved(new ServiceComponentUninstalledEvent(CLUSTER_ID, "any", "any", service, "", "", component, host, false));
   }
 
   private void uninstallService(String service, List<Component> components) throws KerberosMissingAdminCredentialsException {
-    kerberosIdentityCleaner.serviceRemoved(new ServiceRemovedEvent(CLUSTER_ID, "any", "any", service, components));
+    kerberosIdentityCleaner.serviceRemoved(new ServiceRemovedEvent(CLUSTER_ID, "any", "any", service, "", "", components));
   }
 
   @Before

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/state/GeneralServiceCalculatedStateTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/state/GeneralServiceCalculatedStateTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/state/GeneralServiceCalculatedStateTest.java
index 015b0c2..0b6c3f3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/state/GeneralServiceCalculatedStateTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/utilities/state/GeneralServiceCalculatedStateTest.java
@@ -86,7 +86,7 @@ public abstract class GeneralServiceCalculatedStateTest {
     clusters.addCluster(clusterName, stack211);
     cluster = clusters.getCluster(clusterName);
 
-    service = cluster.addService(getServiceName(), repositoryVersion);
+    service = cluster.addService(null, getServiceName(), "", repositoryVersion);
 
     createComponentsAndHosts();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java b/ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java
index 6ebd444..2376079 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java
@@ -17,6 +17,7 @@
  */
 package org.apache.ambari.server.events;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -25,6 +26,7 @@ import java.util.UUID;
 import javax.persistence.EntityManager;
 
 import org.apache.ambari.server.H2DatabaseCleaner;
+import org.apache.ambari.server.api.services.ServiceKey;
 import org.apache.ambari.server.events.AmbariEvent.AmbariEventType;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
@@ -379,7 +381,7 @@ public class EventsTest {
 
   private void installHdfsService() throws Exception {
     String serviceName = "HDFS";
-    Service service = m_serviceFactory.createNew(m_cluster, serviceName, m_repositoryVersion);
+    Service service = m_serviceFactory.createNew(m_cluster, null, new ArrayList<ServiceKey>(), serviceName, "", m_repositoryVersion);
     service = m_cluster.getService(serviceName);
     Assert.assertNotNull(service);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
index 24d4f55..ed3a744 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
@@ -514,7 +514,7 @@ public class HostVersionOutOfSyncListenerTest {
 
         ServiceComponentUninstalledEvent event = new ServiceComponentUninstalledEvent(
             c1.getClusterId(), clusterStackId.getStackName(), clusterStackId.getStackVersion(),
-            "HDFS", "DATANODE", sch.getHostName(), false);
+            "HDFS", "", "", "DATANODE", sch.getHostName(), false);
 
         m_eventPublisher.publish(event);
       }
@@ -548,7 +548,7 @@ public class HostVersionOutOfSyncListenerTest {
       String serviceName, RepositoryVersionEntity repositoryVersionEntity) throws AmbariException {
     StackId stackIdObj = new StackId(stackId);
     cl.setDesiredStackVersion(stackIdObj);
-    cl.addService(serviceName, repositoryVersionEntity);
+    cl.addService(null, serviceName, "", repositoryVersionEntity);
 
     for (Map.Entry<String, List<Integer>> component : topology.entrySet()) {
 
@@ -564,7 +564,7 @@ public class HostVersionOutOfSyncListenerTest {
       }
 
       ServiceInstalledEvent event = new ServiceInstalledEvent(cl.getClusterId(),
-          stackIdObj.getStackName(), stackIdObj.getStackVersion(), serviceName);
+          stackIdObj.getStackName(), stackIdObj.getStackVersion(), serviceName, "", "");
       m_eventPublisher.publish(event);
     }
   }
@@ -585,7 +585,7 @@ public class HostVersionOutOfSyncListenerTest {
           .getServiceComponent(componentName), hostName));
       ServiceComponentInstalledEvent event = new ServiceComponentInstalledEvent(cl.getClusterId(),
           stackIdObj.getStackName(), stackIdObj.getStackVersion(),
-          serviceName, componentName, hostName, false /* recovery not enabled */);
+          serviceName, "", "",componentName, hostName, false /* recovery not enabled */);
       m_eventPublisher.publish(event);
     }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java
index bd8be3b..27fb18b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java
@@ -42,6 +42,7 @@ import org.apache.ambari.server.Role;
 import org.apache.ambari.server.RoleCommand;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
+import org.apache.ambari.server.api.services.ServiceKey;
 import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
 import org.apache.ambari.server.orm.dao.AlertDispatchDAO;
 import org.apache.ambari.server.orm.dao.AlertsDAO;
@@ -453,7 +454,7 @@ public class OrmTestHelper {
         cluster.getDesiredStackVersion().getStackVersion());
 
     String serviceName = "HDFS";
-    Service service = serviceFactory.createNew(cluster, serviceName, repositoryVersion);
+    Service service = serviceFactory.createNew(cluster, null, new ArrayList<ServiceKey>(), serviceName, "", repositoryVersion);
     service = cluster.getService(serviceName);
     assertNotNull(service);
 
@@ -487,7 +488,7 @@ public class OrmTestHelper {
         cluster.getDesiredStackVersion().getStackVersion());
 
     String serviceName = "YARN";
-    Service service = serviceFactory.createNew(cluster, serviceName, repositoryVersion);
+    Service service = serviceFactory.createNew(cluster, null, new ArrayList<ServiceKey>(), serviceName, "", repositoryVersion);
     service = cluster.getService(serviceName);
     assertNotNull(service);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/orm/TestOrmImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/TestOrmImpl.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/TestOrmImpl.java
index 62ac31c..4a49cdc 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/TestOrmImpl.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/TestOrmImpl.java
@@ -170,11 +170,11 @@ public class TestOrmImpl extends Assert {
 
     createService(currentTime, serviceName, clusterName);
 
-    ClusterServiceEntity clusterServiceEntity = clusterServiceDAO.findByClusterAndServiceNames(clusterName, serviceName);
+    ClusterServiceEntity clusterServiceEntity = null;//clusterServiceDAO.findByClusterAndServiceNames(clusterName, serviceName);
 
     clusterServiceDAO.remove(clusterServiceEntity);
 
-    assertNull(clusterServiceDAO.findByClusterAndServiceNames(clusterName, serviceName));
+    //assertNull(clusterServiceDAO.findByClusterAndServiceNames(clusterName, serviceName));
 
   }
 
@@ -190,7 +190,7 @@ public class TestOrmImpl extends Assert {
     clusterServiceDAO.create(clusterServiceEntity);
     clusterDAO.merge(cluster);
 
-    clusterServiceEntity = clusterServiceDAO.findByClusterAndServiceNames(clusterName, serviceName);
+    clusterServiceEntity = null;//clusterServiceDAO.findByClusterAndServiceNames(clusterName, serviceName);
     assertNotNull(clusterServiceEntity);
 
     clusterServiceDAO.merge(clusterServiceEntity);
@@ -207,12 +207,12 @@ public class TestOrmImpl extends Assert {
 
     createService(currentTime, serviceName, clusterName);
 
-    ClusterServiceEntity clusterServiceEntity = clusterServiceDAO.findByClusterAndServiceNames(clusterName, serviceName);
+    ClusterServiceEntity clusterServiceEntity = null;//clusterServiceDAO.findByClusterAndServiceNames(clusterName, serviceName);
     clusterServiceDAO.remove(clusterServiceEntity);
 
-    Assert.assertNull(
-        clusterServiceDAO.findByClusterAndServiceNames(clusterName,
-            serviceName));
+    //Assert.assertNull(
+    //    clusterServiceDAO.findByClusterAndServiceNames(clusterName,
+    //        serviceName));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java
index 80cb4dc..de9c7d3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java
@@ -138,7 +138,7 @@ public class ServiceConfigDAOTest {
     }
 
     ServiceConfigEntity serviceConfigEntity = new ServiceConfigEntity();
-    serviceConfigEntity.setServiceName(serviceName);
+    //serviceConfigEntity.setServiceName(serviceName);
     serviceConfigEntity.setUser(userName);
     serviceConfigEntity.setVersion(version);
     serviceConfigEntity.setServiceConfigId(serviceConfigId);
@@ -198,7 +198,7 @@ public class ServiceConfigDAOTest {
     createServiceConfig("HDFS", "admin", 1L, 1L, 1111L, null);
 
     ServiceConfigEntity serviceConfigEntity =
-      serviceConfigDAO.findByServiceAndVersion("HDFS", 1L);
+      serviceConfigDAO.findByServiceAndVersion(1L, 1L);
 
     Long clusterId = clusterDAO.findByName("c1").getClusterId();
 
@@ -221,10 +221,10 @@ public class ServiceConfigDAOTest {
     createServiceConfig("YARN", "admin", 1L, 3L, 3333L, null);
 
     long hdfsVersion = serviceConfigDAO.findNextServiceConfigVersion(
-        clusterDAO.findByName("c1").getClusterId(), "HDFS");
+        clusterDAO.findByName("c1").getClusterId(), 1L);
 
     long yarnVersion = serviceConfigDAO.findNextServiceConfigVersion(
-        clusterDAO.findByName("c1").getClusterId(), "YARN");
+        clusterDAO.findByName("c1").getClusterId(), 1L);
 
     Assert.assertEquals(3, hdfsVersion);
     Assert.assertEquals(2, yarnVersion);
@@ -280,7 +280,7 @@ public class ServiceConfigDAOTest {
     configGroupEntity1.setGroupName("group1");
     configGroupEntity1.setDescription("group1_desc");
     configGroupEntity1.setTag("HDFS");
-    configGroupEntity1.setServiceName("HDFS");
+    //configGroupEntity1.setServiceName("HDFS");
     configGroupDAO.create(configGroupEntity1);
     ConfigGroupEntity group1 = configGroupDAO.findByName("group1");
     ConfigGroupEntity configGroupEntity2 = new ConfigGroupEntity();
@@ -289,7 +289,7 @@ public class ServiceConfigDAOTest {
     configGroupEntity2.setGroupName("group2");
     configGroupEntity2.setDescription("group2_desc");
     configGroupEntity2.setTag("HDFS");
-    configGroupEntity2.setServiceName("HDFS");
+    //configGroupEntity2.setServiceName("HDFS");
     configGroupDAO.create(configGroupEntity2);
     ConfigGroupEntity group2 = configGroupDAO.findByName("group2");
     createServiceConfig(serviceName, "admin", 1L, 1L, 1111L, null);
@@ -299,7 +299,7 @@ public class ServiceConfigDAOTest {
     createServiceConfigWithGroup(serviceName, "admin", 4L, 4L, 3330L, null, group2.getGroupId());
 
     List<ServiceConfigEntity> serviceConfigEntities = serviceConfigDAO
-        .getLastServiceConfigsForService(clusterDAO.findByName("c1").getClusterId(), serviceName);
+        .getLastServiceConfigsForService(clusterDAO.findByName("c1").getClusterId(), 1L);
     Assert.assertNotNull(serviceConfigEntities);
     Assert.assertEquals(3, serviceConfigEntities.size());
 
@@ -321,7 +321,7 @@ public class ServiceConfigDAOTest {
     Long clusterId = clusterDAO.findByName("c1").getClusterId();
 
     ServiceConfigEntity serviceConfigEntity =
-      serviceConfigDAO.getLastServiceConfig(clusterId, "HDFS");
+      serviceConfigDAO.getLastServiceConfig(clusterId, 1L);
 
     Assert.assertNotNull(serviceConfigEntity);
     Assert.assertEquals("c1", serviceConfigEntity.getClusterEntity().getClusterName());
@@ -391,14 +391,14 @@ public class ServiceConfigDAOTest {
     long clusterId = serviceConfigEntity.getClusterId();
 
     List<ServiceConfigEntity> serviceConfigs = serviceConfigDAO.getServiceConfigsForServiceAndStack(
-        clusterId, HDP_01, "HDFS");
+        clusterId, HDP_01, 1L);
 
     Assert.assertEquals(3, serviceConfigs.size());
 
-    serviceConfigs = serviceConfigDAO.getServiceConfigsForServiceAndStack(clusterId, HDP_01, "YARN");
+    serviceConfigs = serviceConfigDAO.getServiceConfigsForServiceAndStack(clusterId, HDP_01, 1L);
     Assert.assertEquals(1, serviceConfigs.size());
     
-    serviceConfigs = serviceConfigDAO.getServiceConfigsForServiceAndStack(clusterId, HDP_02, "HDFS");
+    serviceConfigs = serviceConfigDAO.getServiceConfigsForServiceAndStack(clusterId, HDP_02, 1L);
     Assert.assertEquals(0, serviceConfigs.size());
   }
 
@@ -423,7 +423,7 @@ public class ServiceConfigDAOTest {
     configGroupEntity1.setGroupName("group1");
     configGroupEntity1.setDescription("group1_desc");
     configGroupEntity1.setTag("HDFS");
-    configGroupEntity1.setServiceName("HDFS");
+    //configGroupEntity1.setServiceName("HDFS");
     configGroupDAO.create(configGroupEntity1);
     ConfigGroupEntity group1 = configGroupDAO.findByName("group1");
     createServiceConfigWithGroup("HDFS", "admin", 3L, 8L, 2222L, null, group1.getGroupId());
@@ -606,16 +606,16 @@ public class ServiceConfigDAOTest {
     configGroupEntity1.setGroupName("toTestDeleteGroup_OOZIE");
     configGroupEntity1.setDescription("toTestDeleteGroup_OOZIE_DESC");
     configGroupEntity1.setTag("OOZIE");
-    configGroupEntity1.setServiceName("OOZIE");
+    //configGroupEntity1.setServiceName("OOZIE");
     configGroupDAO.create(configGroupEntity1);
     ConfigGroupEntity testDeleteGroup_OOZIE = configGroupDAO.findByName("toTestDeleteGroup_OOZIE");
     createServiceConfigWithGroup("OOZIE", "", 2L, 2L, System.currentTimeMillis(), null,
         testDeleteGroup_OOZIE.getGroupId());
     Collection<ServiceConfigEntity> serviceConfigEntityList = serviceConfigDAO.getLastServiceConfigsForService(clusterId,
-        "OOZIE");
+        1L);
     Assert.assertEquals(2, serviceConfigEntityList.size());
     configGroupDAO.remove(configGroupEntity1);
-    serviceConfigEntityList = serviceConfigDAO.getLastServiceConfigsForService(clusterId, "OOZIE");
+    serviceConfigEntityList = serviceConfigDAO.getLastServiceConfigsForService(clusterId, 1L);
     Assert.assertEquals(1, serviceConfigEntityList.size());
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyLogicalRequestDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyLogicalRequestDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyLogicalRequestDAOTest.java
index 6d6d32a..bd529c9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyLogicalRequestDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyLogicalRequestDAOTest.java
@@ -72,8 +72,8 @@ public class TopologyLogicalRequestDAOTest {
     TopologyRequestEntity requestEntity = new TopologyRequestEntity();
     requestEntity.setAction("a1");
     requestEntity.setBlueprintName("bp1");
-    requestEntity.setClusterAttributes("attributes");
-    requestEntity.setClusterProperties("properties");
+    //requestEntity.setClusterAttributes("attributes");
+    //requestEntity.setClusterProperties("properties");
     requestEntity.setClusterId(clusterId);
     requestEntity.setDescription("description");
     requestDAO.create(requestEntity);

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyRequestDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyRequestDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyRequestDAOTest.java
index 68aef6c..3437d7d 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyRequestDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/TopologyRequestDAOTest.java
@@ -63,8 +63,8 @@ public class TopologyRequestDAOTest {
     TopologyRequestEntity requestEntity = new TopologyRequestEntity();
     requestEntity.setAction("a1");
     requestEntity.setBlueprintName("bp1");
-    requestEntity.setClusterAttributes("attributes");
-    requestEntity.setClusterProperties("properties");
+    //requestEntity.setClusterAttributes("attributes");
+    //requestEntity.setClusterProperties("properties");
     requestEntity.setClusterId(clusterId);
     requestEntity.setDescription("description");
     TopologyHostGroupEntity hostGroupEntity = new TopologyHostGroupEntity();
@@ -88,8 +88,8 @@ public class TopologyRequestDAOTest {
     TopologyRequestEntity requestEntity = requestEntities.iterator().next();
     Assert.assertEquals("a1", requestEntity.getAction());
     Assert.assertEquals("bp1", requestEntity.getBlueprintName());
-    Assert.assertEquals("attributes", requestEntity.getClusterAttributes());
-    Assert.assertEquals("properties", requestEntity.getClusterProperties());
+    //Assert.assertEquals("attributes", requestEntity.getClusterAttributes());
+    //Assert.assertEquals("properties", requestEntity.getClusterProperties());
     Assert.assertEquals("description", requestEntity.getDescription());
     Collection<TopologyHostGroupEntity> hostGroupEntities = requestEntity.getTopologyHostGroupEntities();
     Assert.assertEquals(1, hostGroupEntities.size());

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ServiceConfigEntityTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ServiceConfigEntityTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ServiceConfigEntityTest.java
index c82c58e..fe0fcaa 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ServiceConfigEntityTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ServiceConfigEntityTest.java
@@ -29,7 +29,7 @@ public class ServiceConfigEntityTest {
   @Test
   public void testSettersGetters() {
     ServiceConfigEntity entity = new ServiceConfigEntity();
-    entity.setServiceName("foo");
+    //entity.setServiceName("foo");
     entity.setUser("bar");
     entity.setNote("note");
     entity.setVersion(1L);

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
index 9f87312..3ceb6fa 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -36,6 +37,7 @@ import org.apache.ambari.server.actionmanager.HostRoleCommandFactory;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
 import org.apache.ambari.server.agent.CommandReport;
 import org.apache.ambari.server.agent.ExecutionCommand;
+import org.apache.ambari.server.api.services.ServiceKey;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.apache.ambari.server.orm.OrmTestHelper;
@@ -498,7 +500,7 @@ public class ComponentVersionCheckActionTest {
   }
 
   private Service installService(Cluster cluster, String serviceName, RepositoryVersionEntity repositoryVersion) throws AmbariException {
-    Service service = serviceFactory.createNew(cluster, serviceName, repositoryVersion);
+    Service service = serviceFactory.createNew(cluster, null, new ArrayList<ServiceKey>(), serviceName, "", repositoryVersion);
     cluster.addService(service);
     return service;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java
index 0bb72af..cc2bba7 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java
@@ -39,6 +39,7 @@ import org.apache.ambari.server.actionmanager.HostRoleCommand;
 import org.apache.ambari.server.actionmanager.HostRoleCommandFactory;
 import org.apache.ambari.server.agent.CommandReport;
 import org.apache.ambari.server.agent.ExecutionCommand;
+import org.apache.ambari.server.api.services.ServiceKey;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.apache.ambari.server.orm.OrmTestHelper;
@@ -1756,7 +1757,7 @@ public class ConfigureActionTest {
     try {
       service = cluster.getService(serviceName);
     } catch (ServiceNotFoundException e) {
-      service = serviceFactory.createNew(cluster, serviceName, repositoryVersion);
+      service = serviceFactory.createNew(cluster, null, new ArrayList<ServiceKey>(), serviceName, "", repositoryVersion);
       cluster.addService(service);
     }
 
@@ -1847,6 +1848,6 @@ public class ConfigureActionTest {
   private Config createConfig(Cluster cluster, RepositoryVersionEntity repoVersion, String type,
       String tag, Map<String, String> properties) {
     return configFactory.createNew(repoVersion.getStackId(), cluster, type, tag, properties,
-        NO_ATTRIBUTES);
+        NO_ATTRIBUTES, 1L);
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f176845/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosActionTest.java
index a7bf33c..05dd805 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PreconfigureKerberosActionTest.java
@@ -522,7 +522,7 @@ public class PreconfigureKerberosActionTest extends EasyMockSupport {
     configTypeService.put("gateway-site", "KNOX");
 
     for (Map.Entry<String, String> entry : configTypeService.entrySet()) {
-      expect(cluster.getServiceByConfigType(entry.getKey())).andReturn(entry.getValue()).anyTimes();
+      expect(cluster.getServiceByConfigType(entry.getKey())).andReturn(null).anyTimes();
     }
 
     for (Map.Entry<String, Config> entry : clusterConfigs.entrySet()) {


Mime
View raw message