From ff3e71389d663cefdb24dc11be0db88eec4add99 Mon Sep 17 00:00:00 2001 From: Nirothipan Date: Thu, 12 Oct 2017 18:16:35 +0530 Subject: [PATCH] making changes requested --- .../apimgt/webapp/publisher/APIPublisherUtilTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtilTest.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtilTest.java index 43ead14f7d..ca1bc1fba4 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtilTest.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherUtilTest.java @@ -58,7 +58,6 @@ public class APIPublisherUtilTest extends BaseAPIPublisherTest { private void buildApiConfigTest() throws UserStoreException, RegistryException { try { startTenantFlowAsTestTenant(); - setUserRealm(); ServletContext servletContext = new MockServletContext(); APIResourceConfiguration apiDef = new APIResourceConfiguration(); List resources = new ArrayList<>(); @@ -118,8 +117,10 @@ public class APIPublisherUtilTest extends BaseAPIPublisherTest { PrivilegedCarbonContext.getThreadLocalCarbonContext().setUserRealm(userRealm); } - private void startTenantFlowAsTestTenant() { + private void startTenantFlowAsTestTenant() throws org.wso2.carbon.user.core.UserStoreException, RegistryException { PrivilegedCarbonContext.startTenantFlow(); - PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain("test"); + PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(1212); + PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain("test.com"); + setUserRealm(); } }