ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject [1/3] ambari git commit: AMBARI-21077: Refactor API endpoint to have a single entry point for an API version (jluniya)
Date Fri, 19 May 2017 20:33:35 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-14714 d35ea3560 -> ea3dc9a0d


http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index f9375aa..2230e8e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -90,6 +90,7 @@ import org.apache.ambari.server.agent.ExecutionCommand;
 import org.apache.ambari.server.agent.ExecutionCommand.KeyNames;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.api.services.LoggingService;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.configuration.Configuration.DatabaseType;
 import org.apache.ambari.server.controller.internal.DeleteStatusMetaData;
@@ -5202,14 +5203,20 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     return injector.getInstance(MetricPropertyProviderFactory.class);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
   public LoggingSearchPropertyProvider getLoggingSearchPropertyProvider() {
     return injector.getInstance(LoggingSearchPropertyProvider.class);
   }
 
+  /**
+   * {@inheritDoc}
+   */
   @Override
-  public LoggingService getLoggingService(String clusterName) {
-    LoggingService loggingService = new LoggingService(clusterName);
+  public LoggingService getLoggingService(ApiVersion apiVersion, String clusterName) {
+    LoggingService loggingService = new LoggingService(apiVersion, clusterName);
     injector.injectMembers(loggingService);
     return loggingService;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
index 2f799b7..f334c98 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -169,7 +169,10 @@ import com.sun.jersey.spi.container.servlet.ServletContainer;
 
 @Singleton
 public class AmbariServer {
-  public static final String VIEWS_URL_PATTERN = "/api/v1/views/*";
+  public static final String VIEWS_V1_URL_PATTERN = "/api/v1/views/*";
+  public static final String VIEWS_V2_URL_PATTERN = "/api/v2/views/*";
+  public static final String USERS_V1_URL_PATTERN = "/api/v1/users/*";
+  public static final String USERS_V2_URL_PATTERN = "/api/v2/users/*";
   private static Logger LOG = LoggerFactory.getLogger(AmbariServer.class);
 
   /**
@@ -391,18 +394,25 @@ public class AmbariServer {
 
       // The security header filter - conditionally adds security-related headers to the HTTP response for Ambari Views
       // requests.
-      root.addFilter(new FilterHolder(injector.getInstance(AmbariViewsSecurityHeaderFilter.class)), VIEWS_URL_PATTERN,
+      root.addFilter(new FilterHolder(injector.getInstance(AmbariViewsSecurityHeaderFilter.class)),
+              VIEWS_V1_URL_PATTERN,
+          DISPATCHER_TYPES);
+      root.addFilter(new FilterHolder(injector.getInstance(AmbariViewsSecurityHeaderFilter.class)), VIEWS_V2_URL_PATTERN,
           DISPATCHER_TYPES);
 
       // since views share the REST API threadpool, a misbehaving view could
       // consume all of the available threads and effectively cause a loss of
       // service for Ambari
       root.addFilter(new FilterHolder(injector.getInstance(ViewThrottleFilter.class)),
-        VIEWS_URL_PATTERN, DISPATCHER_TYPES);
+              VIEWS_V1_URL_PATTERN, DISPATCHER_TYPES);
+      root.addFilter(new FilterHolder(injector.getInstance(ViewThrottleFilter.class)),
+          VIEWS_V2_URL_PATTERN, DISPATCHER_TYPES);
 
       // adds MDC info for views logging
       root.addFilter(new FilterHolder(injector.getInstance(AmbariViewsMDCLoggingFilter.class)),
-        VIEWS_URL_PATTERN, DISPATCHER_TYPES);
+              VIEWS_V1_URL_PATTERN, DISPATCHER_TYPES);
+      root.addFilter(new FilterHolder(injector.getInstance(AmbariViewsMDCLoggingFilter.class)),
+          VIEWS_V2_URL_PATTERN, DISPATCHER_TYPES);
 
       // session-per-request strategy for api
       root.addFilter(new FilterHolder(injector.getInstance(AmbariPersistFilter.class)), "/api/*", DISPATCHER_TYPES);
@@ -412,7 +422,8 @@ public class AmbariServer {
       root.addEventListener(new RequestContextListener());
 
       root.addFilter(new FilterHolder(springSecurityFilter), "/api/*", DISPATCHER_TYPES);
-      root.addFilter(new FilterHolder(new UserNameOverrideFilter()), "/api/v1/users/*", DISPATCHER_TYPES);
+      root.addFilter(new FilterHolder(new UserNameOverrideFilter()), USERS_V1_URL_PATTERN, DISPATCHER_TYPES);
+      root.addFilter(new FilterHolder(new UserNameOverrideFilter()), USERS_V2_URL_PATTERN, DISPATCHER_TYPES);
 
       // session-per-request strategy for agents
       agentroot.addFilter(new FilterHolder(injector.getInstance(AmbariPersistFilter.class)), "/agent/*", DISPATCHER_TYPES);
@@ -449,7 +460,7 @@ public class AmbariServer {
           "org.apache.ambari.server.api");
 
       sh.setInitParameter("com.sun.jersey.api.json.POJOMappingFeature", "true");
-      root.addServlet(sh, "/api/v1/*");
+      root.addServlet(sh, "/api/*");
       sh.setInitOrder(2);
 
       SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_INHERITABLETHREADLOCAL);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
index 0125d54..bea2884 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java
@@ -52,6 +52,7 @@ import org.apache.ambari.server.api.resources.ViewExternalSubResourceDefinition;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.api.services.ViewExternalSubResourceService;
 import org.apache.ambari.server.api.services.ViewSubResourceService;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.AmbariServer;
@@ -1339,7 +1340,7 @@ public class ViewRegistry {
     ViewContext viewInstanceContext = new ViewContextImpl(viewInstanceDefinition, this);
 
     ViewExternalSubResourceService externalSubResourceService =
-        new ViewExternalSubResourceService(viewDefinition.getExternalResourceType(), viewInstanceDefinition);
+        new ViewExternalSubResourceService(ApiVersion.Default, viewDefinition.getExternalResourceType(), viewInstanceDefinition);
 
     viewInstanceDefinition.addService(ResourceConfig.EXTERNAL_RESOURCE_PLURAL_NAME, externalSubResourceService);
 
@@ -1349,7 +1350,7 @@ public class ViewRegistry {
       Resource.Type type = resourceDefinition.getType();
       ResourceConfig resourceConfig = resourceDefinition.getResourceConfiguration();
 
-      ViewResourceHandler viewResourceService = new ViewSubResourceService(type, viewInstanceDefinition);
+      ViewResourceHandler viewResourceService = new ViewSubResourceService(ApiVersion.Default, type, viewInstanceDefinition);
 
       ClassLoader cl = viewDefinition.getClassLoader();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActionServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActionServiceTest.java
index b5fb6f8..4f81c95 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActionServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActionServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for ServiceService.
@@ -76,6 +77,7 @@ public class ActionServiceTest extends BaseServiceTest {
     private String m_actionName;
 
     private TestActionDefinitionService(String actionName) {
+      super(ApiVersion.Default);
       m_actionName = actionName;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutServiceTest.java
index adae956..f111afd 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ActiveWidgetLayoutServiceTest.java
@@ -25,6 +25,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
 import org.apache.ambari.server.api.resources.ResourceInstance;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.orm.entities.WidgetLayoutEntity;
 import org.junit.Test;
@@ -46,7 +47,7 @@ public class ActiveWidgetLayoutServiceTest {
 
   private class TestActiveWidgetLayoutService extends ActiveWidgetLayoutService {
     public TestActiveWidgetLayoutService(String username) {
-      super(username);
+      super(ApiVersion.Default, username);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/BlueprintServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/BlueprintServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/BlueprintServiceTest.java
index 165dd6c..e69055a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/BlueprintServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/BlueprintServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for BlueprintService.
@@ -78,6 +79,7 @@ public class BlueprintServiceTest extends BaseServiceTest {
     private String m_blueprintId;
 
     private TestBlueprintService(String blueprintId) {
+      super(ApiVersion.Default);
       m_blueprintId = blueprintId;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterKerberosDescriptorServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterKerberosDescriptorServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterKerberosDescriptorServiceTest.java
index ab83dfd..47b70d9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterKerberosDescriptorServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterKerberosDescriptorServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for CredentialService.
@@ -64,7 +65,7 @@ public class ClusterKerberosDescriptorServiceTest extends BaseServiceTest {
     private String type;
 
     private TestService(String type) {
-      super("C1");
+      super(ApiVersion.Default, "C1");
       this.type = type;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java
index a1c8d6c..06f337e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterPrivilegeServiceTest.java
@@ -28,6 +28,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for ClusterPrivilegeService.
@@ -69,7 +70,7 @@ public class ClusterPrivilegeServiceTest extends BaseServiceTest {
   private class TestClusterPrivilegeService extends ClusterPrivilegeService {
 
     private TestClusterPrivilegeService(String clusterName) {
-      super(clusterName);
+      super(ApiVersion.Default, clusterName);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java
index cfc43f5..cfc6a2e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.orm.dao.ClusterDAO;
 import org.apache.ambari.server.orm.dao.HostDAO;
 import org.apache.ambari.server.orm.entities.ClusterEntity;
@@ -145,7 +146,7 @@ public class ClusterServiceTest extends BaseServiceTest {
     private String m_clusterId;
 
     private TestClusterService(Clusters clusters, String clusterId) {
-      super(clusters);
+      super(ApiVersion.Default, clusters);
       m_clusterId = clusterId;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java
index ac607fb..fa21156 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ClusterStackVersionServiceTest.java
@@ -29,6 +29,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource.Type;
 import org.easymock.EasyMock;
 import org.junit.Test;
@@ -72,7 +73,7 @@ public class ClusterStackVersionServiceTest extends BaseServiceTest {
 
   private class TestClusterStackVersionService extends ClusterStackVersionService {
     public TestClusterStackVersionService(String clusterName) {
-      super(clusterName);
+      super(ApiVersion.Default, clusterName);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ComponentServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ComponentServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ComponentServiceTest.java
index 9ced9b3..dda130a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ComponentServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ComponentServiceTest.java
@@ -32,6 +32,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for ComponentService.
@@ -92,7 +93,7 @@ public class ComponentServiceTest extends BaseServiceTest {
     private String m_componentId;
 
     private TestComponentService(String clusterId, String serviceId, String componentId) {
-      super(clusterId, serviceId);
+      super(ApiVersion.Default, clusterId, serviceId);
       m_clusterId = clusterId;
       m_serviceId = serviceId;
       m_componentId = componentId;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigGroupServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigGroupServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigGroupServiceTest.java
index 88ee500..b0ad67c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigGroupServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigGroupServiceTest.java
@@ -29,6 +29,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 public class ConfigGroupServiceTest extends BaseServiceTest {
 
@@ -85,7 +86,7 @@ public class ConfigGroupServiceTest extends BaseServiceTest {
     private String m_groupId;
 
     public TestConfigGroupService(String m_clusterName, String groupId) {
-      super(m_clusterName);
+      super(ApiVersion.Default, m_clusterName);
       this.m_clusterName = m_clusterName;
       this.m_groupId = groupId;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigurationServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigurationServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigurationServiceTest.java
index adaffff..eda6cc9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigurationServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ConfigurationServiceTest.java
@@ -29,7 +29,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
-
+import org.apache.ambari.server.api.util.ApiVersion;
 
 public class ConfigurationServiceTest extends BaseServiceTest {
 
@@ -56,7 +56,7 @@ public class ConfigurationServiceTest extends BaseServiceTest {
     private String m_clusterId;
 
     private TestConfigurationService(String clusterId) {
-      super(clusterId);
+      super(ApiVersion.Default, clusterId);
       m_clusterId = clusterId;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/CredentialServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/CredentialServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/CredentialServiceTest.java
index 73d3383..8aa1303 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/CredentialServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/CredentialServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for CredentialService.
@@ -72,7 +73,7 @@ public class CredentialServiceTest extends BaseServiceTest {
     private String alias;
 
     private TestCredentialService(String alias) {
-      super("C1");
+      super(ApiVersion.Default, "C1");
       this.alias = alias;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ExtensionsServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ExtensionsServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ExtensionsServiceTest.java
index 7a696a6..00a028e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ExtensionsServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ExtensionsServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
 * Unit tests for ExtensionsService.
@@ -73,6 +74,7 @@ public class ExtensionsServiceTest extends BaseServiceTest {
     private String m_extensionVersion;
 
     private TestExtensionsService(String extensionName, String extensionVersion) {
+      super(ApiVersion.Default);
       m_extensionId = extensionName;
       m_extensionVersion = extensionVersion;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/FeedServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/FeedServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/FeedServiceTest.java
index c899b93..31e0edf 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/FeedServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/FeedServiceTest.java
@@ -30,7 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
-
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for FeedService.
@@ -79,6 +79,7 @@ public class FeedServiceTest extends BaseServiceTest {
     private String m_feedId;
 
     private TestFeedService(String feedId) {
+      super(ApiVersion.Default);
       m_feedId = feedId;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupPrivilegeServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupPrivilegeServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupPrivilegeServiceTest.java
index 89545a5..8cdbf75 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupPrivilegeServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupPrivilegeServiceTest.java
@@ -31,6 +31,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource.Type;
 import org.easymock.EasyMock;
 import org.junit.Test;
@@ -85,7 +86,7 @@ public class GroupPrivilegeServiceTest extends BaseServiceTest {
   private class TestGroupPrivilegeService extends GroupPrivilegeService {
 
     public TestGroupPrivilegeService() {
-      super("group");
+      super(ApiVersion.Default, "group");
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupServiceTest.java
index f46d358..0753f1c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/GroupServiceTest.java
@@ -29,6 +29,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource.Type;
 
 /**
@@ -78,6 +79,10 @@ public class GroupServiceTest extends BaseServiceTest {
   }
 
   private class TestGroupService extends GroupService {
+    public TestGroupService() {
+      super(ApiVersion.Default);
+    }
+
     @Override
     protected ResourceInstance createResource(Type type, Map<Type, String> mapIds) {
       return getTestResource();

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostComponentServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostComponentServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostComponentServiceTest.java
index 01ccd6a..670eab1 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostComponentServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostComponentServiceTest.java
@@ -31,6 +31,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for HostComponentService.
@@ -91,7 +92,7 @@ public class HostComponentServiceTest extends BaseServiceTest {
     private String m_hostComponentId;
 
     private TestHostComponentService(String clusterId, String hostId, String hostComponentId) {
-      super(clusterId, hostId);
+      super(ApiVersion.Default, clusterId, hostId);
       m_clusterId = clusterId;
       m_hostId = hostId;
       m_hostComponentId = hostComponentId;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostKerberosIdentityServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostKerberosIdentityServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostKerberosIdentityServiceTest.java
index c9200b0..1550e0a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostKerberosIdentityServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostKerberosIdentityServiceTest.java
@@ -32,6 +32,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for HostKerberosIdentity.
@@ -62,7 +63,7 @@ public class HostKerberosIdentityServiceTest extends BaseServiceTest {
     private String identityId;
 
     private TestHostKerberosIdentityService(String clusterId, String hostId, String identityId) {
-      super(clusterId, hostId);
+      super(ApiVersion.Default, clusterId, hostId);
       this.clusterId = clusterId;
       this.hostId = hostId;
       this.identityId = identityId;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostServiceTest.java
index 6aef04d..8209227 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostServiceTest.java
@@ -31,6 +31,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for HostService.
@@ -90,7 +91,7 @@ public class HostServiceTest extends BaseServiceTest {
     private String m_hostId;
 
     private TestHostService(String clusterId, String hostId) {
-      super(clusterId);
+      super(ApiVersion.Default, clusterId);
       m_clusterId = clusterId;
       m_hostId = hostId;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java
index 8367a94..83de4e3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/HostStackVersionServiceTest.java
@@ -29,6 +29,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource.Type;
 
 /**
@@ -60,7 +61,7 @@ public class HostStackVersionServiceTest extends BaseServiceTest {
 
   private class TestHostStackVersionService extends HostStackVersionService {
     public TestHostStackVersionService(String hostName, String clusterName) {
-      super(hostName, clusterName);
+      super(ApiVersion.Default, hostName, clusterName);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/InstanceServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/InstanceServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/InstanceServiceTest.java
index ee42b57..8f0e004 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/InstanceServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/InstanceServiceTest.java
@@ -31,6 +31,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for InstanceService.
@@ -78,7 +79,7 @@ public class InstanceServiceTest extends BaseServiceTest {
     private String m_instanceId;
 
     private TestInstanceService(String feedName, String instanceId) {
-      super(feedName);
+      super(ApiVersion.Default, feedName);
       m_feedName = feedName;
       m_instanceId = instanceId;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/JobServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/JobServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/JobServiceTest.java
index 128b345..1c7c01b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/JobServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/JobServiceTest.java
@@ -28,6 +28,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for JobService.
@@ -62,7 +63,7 @@ public class JobServiceTest extends BaseServiceTest {
     private String clusterName;
 
     public TestJobService(String clusterName, String workflowId) {
-      super(clusterName, workflowId);
+      super(ApiVersion.Default, clusterName, workflowId);
       this.clusterName = clusterName;
       this.workflowId = workflowId;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/LdapSyncEventServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/LdapSyncEventServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/LdapSyncEventServiceTest.java
index 9085bf5..e129aff 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/LdapSyncEventServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/LdapSyncEventServiceTest.java
@@ -29,6 +29,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource;
 
 /**
@@ -70,7 +71,7 @@ public class LdapSyncEventServiceTest extends BaseServiceTest {
   private class TestLdapSyncEventService extends LdapSyncEventService {
 
     private TestLdapSyncEventService() {
-      super();
+      super(ApiVersion.Default);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/LoggingServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/LoggingServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/LoggingServiceTest.java
index 800aca2..183ea3f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/LoggingServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/LoggingServiceTest.java
@@ -26,6 +26,7 @@ import java.net.HttpURLConnection;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.logging.LoggingRequestHelperFactory;
 import org.apache.ambari.server.security.TestAuthenticationFactory;
@@ -125,7 +126,7 @@ public class LoggingServiceTest {
     SecurityContextHolder.getContext().setAuthentication(authentication);
 
     LoggingService loggingService =
-      new LoggingService(expectedClusterName, controllerFactoryMock);
+      new LoggingService(ApiVersion.Default, expectedClusterName, controllerFactoryMock);
     loggingService.setLoggingRequestHelperFactory(helperFactoryMock);
 
     Response resource = loggingService.getSearchEngine("", null, uriInfoMock);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/MemberServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/MemberServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/MemberServiceTest.java
index f9543df..9f9e31c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/MemberServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/MemberServiceTest.java
@@ -29,6 +29,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource.Type;
 
 /**
@@ -84,7 +85,7 @@ public class MemberServiceTest extends BaseServiceTest {
 
   private class TestMemberService extends MemberService {
     public TestMemberService(String groupName) {
-      super(groupName);
+      super(ApiVersion.Default, groupName);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/PermissionServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/PermissionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/PermissionServiceTest.java
index bbb4578..bf64c4f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/PermissionServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/PermissionServiceTest.java
@@ -30,7 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
-
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for PermissionService.
@@ -78,6 +78,7 @@ public class PermissionServiceTest extends BaseServiceTest {
     private String id;
 
     private TestPermissionService(String id) {
+      super(ApiVersion.Default);
       this.id = id;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/PreUpgradeCheckServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/PreUpgradeCheckServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/PreUpgradeCheckServiceTest.java
index 23c99d9..4be5f7c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/PreUpgradeCheckServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/PreUpgradeCheckServiceTest.java
@@ -29,6 +29,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource.Type;
 
 /**
@@ -56,7 +57,7 @@ public class PreUpgradeCheckServiceTest extends BaseServiceTest {
   private class TestPreUpgradeCheckService extends PreUpgradeCheckService {
 
     public TestPreUpgradeCheckService(String clusterName) {
-      super(clusterName);
+      super(ApiVersion.Default, clusterName);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/PrivilegeServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/PrivilegeServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/PrivilegeServiceTest.java
index 134c753..23e644a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/PrivilegeServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/PrivilegeServiceTest.java
@@ -30,7 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
-
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for PrivilegeService.
@@ -91,6 +91,7 @@ public class PrivilegeServiceTest extends BaseServiceTest {
     private String id;
 
     private TestPrivilegeService(String id) {
+      super(ApiVersion.Default);
       this.id = id;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/RecommendationServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RecommendationServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RecommendationServiceTest.java
index 779a320..eb5c92b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RecommendationServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RecommendationServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for RecommendationService.
@@ -42,8 +43,8 @@ public class RecommendationServiceTest extends BaseServiceTest {
 
     //getRecommendation
     RecommendationService service = new TestRecommendationService("stackName", "stackVersion");
-    Method m = service.getClass().getMethod("getRecommendation", String.class, HttpHeaders.class, UriInfo.class, String.class, String.class);
-    Object[] args = new Object[] {"body", getHttpHeaders(), getUriInfo(), "stackName", "stackVersion"};
+    Method m = service.getClass().getMethod("getRecommendation", String.class, HttpHeaders.class, UriInfo.class);
+    Object[] args = new Object[] {"body", getHttpHeaders(), getUriInfo()};
     listInvocations.add(new ServiceTestInvocation(Request.Type.POST, service, m, args, "body"));
 
     return listInvocations;
@@ -54,7 +55,7 @@ public class RecommendationServiceTest extends BaseServiceTest {
     private String stackVersion;
 
     private TestRecommendationService(String stackName, String stackVersion) {
-      super();
+      super(ApiVersion.Default, stackName, stackVersion);
       this.stackName = stackName;
       this.stackVersion = stackVersion;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/RepositoryServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RepositoryServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RepositoryServiceTest.java
index 6d6ba7b..e035947 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RepositoryServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RepositoryServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource.Type;
 
 /**
@@ -81,7 +82,7 @@ public class RepositoryServiceTest extends BaseServiceTest {
   private class TestRepositoryService extends RepositoryService {
 
     public TestRepositoryService() {
-      super(new HashMap<Type, String>());
+      super(ApiVersion.Default, new HashMap<Type, String>());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/RoleAuthorizationServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RoleAuthorizationServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RoleAuthorizationServiceTest.java
index 517a6a0..063fa05 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RoleAuthorizationServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RoleAuthorizationServiceTest.java
@@ -30,7 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
-
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for RoleAuthorizationService.
@@ -60,6 +60,7 @@ public class RoleAuthorizationServiceTest extends BaseServiceTest {
     private String id;
 
     private TestRoleAuthorizationService(String id) {
+      super(ApiVersion.Default);
       this.id = id;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/RootServiceServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RootServiceServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RootServiceServiceTest.java
index 64898c8..b2598c6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/RootServiceServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/RootServiceServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
 * Unit tests for RootServiceService.
@@ -93,6 +94,7 @@ public class RootServiceServiceTest extends BaseServiceTest {
     private String m_hostName;
 
     private TestRootServiceService(String serviceName, String componentName, String hostName) {
+      super(ApiVersion.Default);
       m_serviceName = serviceName;
       m_componentName = componentName;
       m_hostName = hostName;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ServiceServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ServiceServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ServiceServiceTest.java
index deda3eb..ddb22eb 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ServiceServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ServiceServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for ServiceService.
@@ -133,13 +134,13 @@ public class ServiceServiceTest extends BaseServiceTest {
     private String m_artifact_id;
 
     private TestServiceService(String clusterId, String serviceId) {
-      super(clusterId);
+      super(ApiVersion.Default, clusterId);
       m_clusterId = clusterId;
       m_serviceId = serviceId;
     }
 
     private TestServiceService(String clusterId, String serviceId, String artifactId) {
-      super(clusterId);
+      super(ApiVersion.Default, clusterId);
       m_clusterId = clusterId;
       m_serviceId = serviceId;
       m_artifact_id = artifactId;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/SettingServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/SettingServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/SettingServiceTest.java
index 1bc75ff..c53b852 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/SettingServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/SettingServiceTest.java
@@ -29,6 +29,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit test for {@link SettingService}
@@ -75,6 +76,7 @@ public class SettingServiceTest extends BaseServiceTest {
     private String settingName;
 
     private TestSettingService(String settingName) {
+      super(ApiVersion.Default);
       this.settingName = settingName;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/StacksServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/StacksServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/StacksServiceTest.java
index ff62712..b828879 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/StacksServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/StacksServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
 * Unit tests for StacksService.
@@ -141,6 +142,7 @@ public class StacksServiceTest extends BaseServiceTest {
     private String m_stackVersion;
 
     private TestStacksService(String stackName, String stackVersion) {
+      super(ApiVersion.Default);
       m_stackId = stackName;
       m_stackVersion = stackVersion;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/TargetClusterServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/TargetClusterServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/TargetClusterServiceTest.java
index a71b062..2b72570 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/TargetClusterServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/TargetClusterServiceTest.java
@@ -30,7 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
-
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for TargetClusterService.
@@ -79,6 +79,7 @@ public class TargetClusterServiceTest extends BaseServiceTest {
     private String m_targetClusterId;
 
     private TestTargetClusterService(String targetClusterId) {
+      super(ApiVersion.Default);
       m_targetClusterId = targetClusterId;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/TaskAttemptServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/TaskAttemptServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/TaskAttemptServiceTest.java
index 072cd65..0d41be7 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/TaskAttemptServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/TaskAttemptServiceTest.java
@@ -28,6 +28,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for TaskAttemptService.
@@ -65,7 +66,7 @@ public class TaskAttemptServiceTest extends BaseServiceTest {
 
     public TestTaskAttemptService(String clusterName, String workflowId,
         String jobId) {
-      super(clusterName, workflowId, jobId);
+      super(ApiVersion.Default, clusterName, workflowId, jobId);
       this.clusterName = clusterName;
       this.workflowId = workflowId;
       this.jobId = jobId;

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/UpgradeItemServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/UpgradeItemServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/UpgradeItemServiceTest.java
index 25f67a4..4bd7dde 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/UpgradeItemServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/UpgradeItemServiceTest.java
@@ -28,6 +28,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.junit.Assert;
 
 /**
@@ -50,7 +51,7 @@ public class UpgradeItemServiceTest extends BaseServiceTest {
     private Long m_upgradeItemId;
 
     private TestUpgradeItemService(String clusterName, String upgradeId, String upgradeGroupId, Long upgradeItemId) {
-      super(clusterName, upgradeId, upgradeGroupId);
+      super(ApiVersion.Default, clusterName, upgradeId, upgradeGroupId);
 
       m_upgradeItemId = upgradeItemId;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserAuthorizationServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserAuthorizationServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserAuthorizationServiceTest.java
index c0fb6ff..bf712c8 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserAuthorizationServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserAuthorizationServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.junit.Test;
 
@@ -60,7 +61,7 @@ public class UserAuthorizationServiceTest extends BaseServiceTest {
   @Test
   public void testCreateAuthorizationResourceWithUppercaseUsername() {
     // GIVEN
-    UserAuthorizationService userAuthorizationService= new UserAuthorizationService("Jdoe");
+    UserAuthorizationService userAuthorizationService= new UserAuthorizationService(ApiVersion.Default, "Jdoe");
     // WHEN
     ResourceInstance result = userAuthorizationService.createAuthorizationResource("id");
     // THEN
@@ -72,7 +73,7 @@ public class UserAuthorizationServiceTest extends BaseServiceTest {
     private String id;
 
     private TestUserAuthorizationService(String id) {
-      super("jdoe");
+      super(ApiVersion.Default, "jdoe");
       this.id = id;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserPrivilegeServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserPrivilegeServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserPrivilegeServiceTest.java
index 909a4ba..23e1062 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserPrivilegeServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/UserPrivilegeServiceTest.java
@@ -33,6 +33,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.controller.spi.Resource.Type;
 import org.easymock.EasyMock;
@@ -88,7 +89,7 @@ public class UserPrivilegeServiceTest extends BaseServiceTest {
   @Test
   public void testCreatePrivilegeResourcesWithUppercaseUsername() {
     // GIVEN
-    UserPrivilegeService userPrivilegeService = new UserPrivilegeService("User");
+    UserPrivilegeService userPrivilegeService = new UserPrivilegeService(ApiVersion.Default, "User");
     // WHEN
     ResourceInstance result = userPrivilegeService.createPrivilegeResource("test");
     // THEN
@@ -98,7 +99,7 @@ public class UserPrivilegeServiceTest extends BaseServiceTest {
   private class TestUserPrivilegeService extends UserPrivilegeService {
 
     public TestUserPrivilegeService() {
-      super("user");
+      super(ApiVersion.Default, "user");
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ValidationServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ValidationServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ValidationServiceTest.java
index 722e4bc..ef6aef0 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ValidationServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ValidationServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for ValidationService.
@@ -42,8 +43,8 @@ public class ValidationServiceTest extends BaseServiceTest {
 
     //getValidation
     ValidationService service = new TestValidationService("stackName", "stackVersion");
-    Method m = service.getClass().getMethod("getValidation", String.class, HttpHeaders.class, UriInfo.class, String.class, String.class);
-    Object[] args = new Object[] {"body", getHttpHeaders(), getUriInfo(), "stackName", "stackVersion"};
+    Method m = service.getClass().getMethod("getValidation", String.class, HttpHeaders.class, UriInfo.class);
+    Object[] args = new Object[] {"body", getHttpHeaders(), getUriInfo()};
     listInvocations.add(new ServiceTestInvocation(Request.Type.POST, service, m, args, "body"));
 
     return listInvocations;
@@ -54,7 +55,7 @@ public class ValidationServiceTest extends BaseServiceTest {
     private String stackVersion;
 
     private TestValidationService(String stackName, String stackVersion) {
-      super();
+      super(ApiVersion.Default, stackName, stackVersion);
       this.stackName = stackName;
       this.stackVersion = stackVersion;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewDataMigrationServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewDataMigrationServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewDataMigrationServiceTest.java
index e1eb0de..2672410 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewDataMigrationServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewDataMigrationServiceTest.java
@@ -27,6 +27,7 @@ import static org.easymock.EasyMock.verify;
 
 import javax.ws.rs.WebApplicationException;
 
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
 import org.apache.ambari.server.view.ViewDataMigrationUtility;
 import org.apache.ambari.server.view.ViewRegistry;
@@ -54,7 +55,7 @@ public class ViewDataMigrationServiceTest {
     replay(viewRegistry);
     ViewRegistry.initInstance(viewRegistry);
 
-    ViewDataMigrationService service = new ViewDataMigrationService(viewName, version1, instanceName);
+    ViewDataMigrationService service = new ViewDataMigrationService(ApiVersion.Default, viewName, version1, instanceName);
 
     ViewDataMigrationUtility migrationUtility = createStrictMock(ViewDataMigrationUtility.class);
     migrationUtility.migrateData(anyObject(ViewInstanceEntity.class), anyObject(ViewInstanceEntity.class), eq(false));
@@ -73,7 +74,7 @@ public class ViewDataMigrationServiceTest {
     replay(viewRegistry);
     ViewRegistry.initInstance(viewRegistry);
 
-    ViewDataMigrationService service = new ViewDataMigrationService(viewName, version1, instanceName);
+    ViewDataMigrationService service = new ViewDataMigrationService(ApiVersion.Default, viewName, version1, instanceName);
 
     thrown.expect(WebApplicationException.class);
     service.migrateData(version2, instanceName);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewExternalSubResourceServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewExternalSubResourceServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewExternalSubResourceServiceTest.java
index 155f91e..74711e6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewExternalSubResourceServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewExternalSubResourceServiceTest.java
@@ -17,6 +17,7 @@
  */
 package org.apache.ambari.server.api.services;
 
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
 import org.apache.ambari.server.orm.entities.ViewInstanceEntityTest;
@@ -32,7 +33,7 @@ public class ViewExternalSubResourceServiceTest {
     Resource.Type type = new Resource.Type("resource");
 
     ViewInstanceEntity definition = ViewInstanceEntityTest.getViewInstanceEntity();
-    ViewExternalSubResourceService service = new ViewExternalSubResourceService(type, definition);
+    ViewExternalSubResourceService service = new ViewExternalSubResourceService(ApiVersion.Default, type, definition);
 
     Object fooService = new Object();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewPermissionServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewPermissionServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewPermissionServiceTest.java
index 1c9e589..befa939 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewPermissionServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewPermissionServiceTest.java
@@ -30,6 +30,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for ViewPermissionService.
@@ -73,7 +74,7 @@ public class ViewPermissionServiceTest extends BaseServiceTest {
 
     private TestViewPermissionService(String viewName, String version, String permissionId) {
 
-      super(viewName, version);
+      super(ApiVersion.Default, viewName, version);
       this.permissionId = permissionId;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java
index 97943df..6c23960 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/ViewSubResourceServiceTest.java
@@ -43,6 +43,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.ambari.server.api.util.TreeNode;
 import org.apache.ambari.server.controller.spi.Resource;
 import org.apache.ambari.server.orm.entities.ViewInstanceEntity;
@@ -132,7 +133,7 @@ public class ViewSubResourceServiceTest extends BaseServiceTest {
     Resource.Type type = new Resource.Type("subResource");
 
     // get resource
-    ViewSubResourceService service = new ViewSubResourceService(type, viewInstanceEntity);
+    ViewSubResourceService service = new ViewSubResourceService(ApiVersion.Default, type, viewInstanceEntity);
 
     ResultSerializer serializer = service.getResultSerializer(MediaType.TEXT_PLAIN_TYPE);
 
@@ -190,7 +191,7 @@ public class ViewSubResourceServiceTest extends BaseServiceTest {
     Resource.Type type = new Resource.Type("subResource");
 
     // get resource
-    ViewSubResourceService service = new ViewSubResourceService(type, viewInstanceEntity);
+    ViewSubResourceService service = new ViewSubResourceService(ApiVersion.Default, type, viewInstanceEntity);
 
     ResultSerializer serializer = service.getResultSerializer(MediaType.APPLICATION_JSON_TYPE);
 
@@ -219,7 +220,7 @@ public class ViewSubResourceServiceTest extends BaseServiceTest {
      * Construct a view sub-resource service.
      */
     public TestViewSubResourceService(Resource.Type type, ViewInstanceEntity viewInstanceDefinition) {
-      super(type, viewInstanceDefinition);
+      super(ApiVersion.Default, type, viewInstanceDefinition);
     }
 
     public Response getSubResource1(@Context HttpHeaders headers, @Context UriInfo ui,

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/WorkflowServiceTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/WorkflowServiceTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/WorkflowServiceTest.java
index b9cc545..250812f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/WorkflowServiceTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/WorkflowServiceTest.java
@@ -28,6 +28,7 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
 import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.api.util.ApiVersion;
 
 /**
  * Unit tests for WorkflowService.
@@ -61,7 +62,7 @@ public class WorkflowServiceTest extends BaseServiceTest {
     private String clusterName;
 
     public TestWorkflowService(String clusterName) {
-      super(clusterName);
+      super(ApiVersion.Default, clusterName);
       this.clusterName = clusterName;
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/ConfigurationRecommendationCommandTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/ConfigurationRecommendationCommandTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/ConfigurationRecommendationCommandTest.java
index 8f608aa..a63f011 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/ConfigurationRecommendationCommandTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/ConfigurationRecommendationCommandTest.java
@@ -34,6 +34,7 @@ import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorRequest;
 import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorRunner;
 import org.apache.ambari.server.api.services.stackadvisor.recommendations.RecommendationResponse;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.junit.Test;
 
 public class ConfigurationRecommendationCommandTest {
@@ -43,7 +44,7 @@ public class ConfigurationRecommendationCommandTest {
     StackAdvisorRunner saRunner = mock(StackAdvisorRunner.class);
     File file = mock(File.class);
     AmbariMetaInfo metaInfo = mock(AmbariMetaInfo.class);
-    ConfigurationRecommendationCommand command = new ConfigurationRecommendationCommand(file, "1w", "script", 1, saRunner, metaInfo);
+    ConfigurationRecommendationCommand command = new ConfigurationRecommendationCommand(ApiVersion.Default, file, "1w", "script", 1, saRunner, metaInfo);
 
     StackAdvisorRequest request = mock(StackAdvisorRequest.class);
     Map<String, Set<String>> componentHostGroupMap = new HashMap<>();

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea3dc9a0/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommandTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommandTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommandTest.java
index 67048ad..81c36b3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommandTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/commands/StackAdvisorCommandTest.java
@@ -46,6 +46,7 @@ import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorRequestExc
 import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorResponse;
 import org.apache.ambari.server.api.services.stackadvisor.StackAdvisorRunner;
 import org.apache.ambari.server.api.services.stackadvisor.commands.StackAdvisorCommand.StackAdvisorData;
+import org.apache.ambari.server.api.util.ApiVersion;
 import org.apache.commons.io.FileUtils;
 import org.codehaus.jackson.JsonNode;
 import org.codehaus.jackson.annotate.JsonProperty;
@@ -267,7 +268,7 @@ public class StackAdvisorCommandTest {
   class TestStackAdvisorCommand extends StackAdvisorCommand<TestResource> {
     public TestStackAdvisorCommand(File recommendationsDir, String recommendationsArtifactsLifetime, String stackAdvisorScript,
         int requestId, StackAdvisorRunner saRunner, AmbariMetaInfo metaInfo) {
-      super(recommendationsDir, recommendationsArtifactsLifetime, stackAdvisorScript, requestId, saRunner, metaInfo);
+      super(ApiVersion.Default, recommendationsDir, recommendationsArtifactsLifetime, stackAdvisorScript, requestId, saRunner, metaInfo);
     }
 
     @Override


Mime
View raw message