use of org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO in project carbon-apimgt by wso2.
the class APIUtilTest method testGetAPIWithGovernanceArtifactAdvancedThrottlingDisabled.
@Test
public void testGetAPIWithGovernanceArtifactAdvancedThrottlingDisabled() throws Exception {
System.setProperty("carbon.home", APIUtilTest.class.getResource("/").getFile());
try {
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID);
API expectedAPI = getUniqueAPI();
final String provider = expectedAPI.getId().getProviderName();
final String tenantDomain = org.wso2.carbon.utils.multitenancy.MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
final int tenantId = -1234;
System.setProperty("carbon.home", "");
File siteConfFile = new File(Thread.currentThread().getContextClassLoader().getResource("tenant-conf.json").getFile());
String tenantConfValue = FileUtils.readFileToString(siteConfFile);
GovernanceArtifact artifact = Mockito.mock(GovernanceArtifact.class);
Registry registry = Mockito.mock(Registry.class);
ApiMgtDAO apiMgtDAO = Mockito.mock(ApiMgtDAO.class);
Resource resource = Mockito.mock(Resource.class);
ServiceReferenceHolder serviceReferenceHolder = Mockito.mock(ServiceReferenceHolder.class);
RealmService realmService = Mockito.mock(RealmService.class);
TenantManager tenantManager = Mockito.mock(TenantManager.class);
APIManagerConfigurationService apiManagerConfigurationService = Mockito.mock(APIManagerConfigurationService.class);
APIManagerConfiguration apiManagerConfiguration = Mockito.mock(APIManagerConfiguration.class);
ThrottleProperties throttleProperties = Mockito.mock(ThrottleProperties.class);
SubscriptionPolicy policy = Mockito.mock(SubscriptionPolicy.class);
SubscriptionPolicy[] policies = new SubscriptionPolicy[] { policy };
QuotaPolicy quotaPolicy = Mockito.mock(QuotaPolicy.class);
RequestCountLimit limit = Mockito.mock(RequestCountLimit.class);
RegistryService registryService = Mockito.mock(RegistryService.class);
UserRegistry userRegistry = Mockito.mock(UserRegistry.class);
APIMConfigService apimConfigService = Mockito.mock(APIMConfigService.class);
Mockito.when(serviceReferenceHolder.getApimConfigService()).thenReturn(apimConfigService);
Mockito.when(apimConfigService.getTenantConfig(tenantDomain)).thenReturn(tenantConfValue);
PowerMockito.mockStatic(ApiMgtDAO.class);
PowerMockito.mockStatic(GovernanceUtils.class);
PowerMockito.mockStatic(MultitenantUtils.class);
PowerMockito.mockStatic(ServiceReferenceHolder.class);
Mockito.when(ApiMgtDAO.getInstance()).thenReturn(apiMgtDAO);
Mockito.when(apiMgtDAO.getAPIID(Mockito.any(String.class))).thenReturn(123);
Mockito.when(apiMgtDAO.getPolicyNames(PolicyConstants.POLICY_LEVEL_SUB, provider)).thenReturn(new String[] { "Unlimited" });
Mockito.when(artifact.getId()).thenReturn("");
Mockito.when(artifact.getAttribute(APIConstants.API_OVERVIEW_PROVIDER)).thenReturn(provider);
Mockito.when(artifact.getAttribute(APIConstants.API_OVERVIEW_CACHE_TIMEOUT)).thenReturn("15");
Mockito.when(artifact.getAttribute(APIConstants.API_OVERVIEW_TIER)).thenReturn("Unlimited");
Mockito.when(MultitenantUtils.getTenantDomain(provider)).thenReturn(tenantDomain);
Mockito.when(ServiceReferenceHolder.getInstance()).thenReturn(serviceReferenceHolder);
Mockito.when(serviceReferenceHolder.getRealmService()).thenReturn(realmService);
Mockito.when(serviceReferenceHolder.getRegistryService()).thenReturn(registryService);
Mockito.when(realmService.getTenantManager()).thenReturn(tenantManager);
Mockito.when(tenantManager.getTenantId(tenantDomain)).thenReturn(tenantId);
Mockito.when(registryService.getConfigSystemRegistry(tenantId)).thenReturn(userRegistry);
String artifactPath = "";
Mockito.when(GovernanceUtils.getArtifactPath(registry, "")).thenReturn(artifactPath);
Mockito.when(registry.get(artifactPath)).thenReturn(resource);
Mockito.when(resource.getLastModified()).thenReturn(expectedAPI.getLastUpdated());
Mockito.when(resource.getCreatedTime()).thenReturn(expectedAPI.getLastUpdated());
Mockito.when(resource.getContent()).thenReturn(tenantConfValue.getBytes());
Mockito.when(serviceReferenceHolder.getAPIManagerConfigurationService()).thenReturn(apiManagerConfigurationService);
Mockito.when(apiManagerConfigurationService.getAPIManagerConfiguration()).thenReturn(apiManagerConfiguration);
Mockito.when(apiManagerConfiguration.getThrottleProperties()).thenReturn(throttleProperties);
Mockito.when(apiMgtDAO.getSubscriptionPolicies(tenantId)).thenReturn(policies);
Mockito.when(policy.getDefaultQuotaPolicy()).thenReturn(quotaPolicy);
Mockito.when(quotaPolicy.getLimit()).thenReturn(limit);
Mockito.when(registry.getTags(artifactPath)).thenReturn(getTagsFromSet(expectedAPI.getTags()));
ArrayList<URITemplate> urlList = getURLTemplateList(expectedAPI.getUriTemplates());
Mockito.when(apiMgtDAO.getAllURITemplates(Mockito.anyString(), Mockito.anyString())).thenReturn(urlList);
CORSConfiguration corsConfiguration = expectedAPI.getCorsConfiguration();
Mockito.when(apiManagerConfiguration.getFirstProperty(APIConstants.CORS_CONFIGURATION_ACCESS_CTL_ALLOW_HEADERS)).thenReturn(corsConfiguration.getAccessControlAllowHeaders().toString());
Mockito.when(apiManagerConfiguration.getFirstProperty(APIConstants.CORS_CONFIGURATION_ACCESS_CTL_ALLOW_METHODS)).thenReturn(corsConfiguration.getAccessControlAllowMethods().toString());
Mockito.when(apiManagerConfiguration.getFirstProperty(APIConstants.CORS_CONFIGURATION_ACCESS_CTL_ALLOW_ORIGIN)).thenReturn(corsConfiguration.getAccessControlAllowOrigins().toString());
API api = APIUtil.getAPI(artifact);
Assert.assertNotNull(api);
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
}
use of org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO in project carbon-apimgt by wso2.
the class APIUtilTest method testGetAPIInformation.
@Test
public void testGetAPIInformation() throws Exception {
System.setProperty("carbon.home", APIUtilTest.class.getResource("/").getFile());
try {
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID);
GovernanceArtifact artifact = Mockito.mock(GovernanceArtifact.class);
Registry registry = Mockito.mock(Registry.class);
Resource resource = Mockito.mock(Resource.class);
API expectedAPI = getUniqueAPI();
String artifactPath = "";
PowerMockito.mockStatic(GovernanceUtils.class);
Mockito.when(GovernanceUtils.getArtifactPath(registry, expectedAPI.getUUID())).thenReturn(artifactPath);
Mockito.when(registry.get(artifactPath)).thenReturn(resource);
Mockito.when(resource.getLastModified()).thenReturn(expectedAPI.getLastUpdated());
DateFormat df = new SimpleDateFormat("E MMM dd HH:mm:ss zzz yyyy", Locale.US);
Date createdTime = df.parse(expectedAPI.getCreatedTime());
Mockito.when(resource.getCreatedTime()).thenReturn(createdTime);
ServiceReferenceHolderMockCreator holderMockCreator = new ServiceReferenceHolderMockCreator(1);
APIManagerConfiguration apimConfiguration = holderMockCreator.getConfigurationServiceMockCreator().getConfigurationMockCreator().getMock();
CORSConfiguration corsConfiguration = expectedAPI.getCorsConfiguration();
Mockito.when(apimConfiguration.getFirstProperty(APIConstants.CORS_CONFIGURATION_ACCESS_CTL_ALLOW_HEADERS)).thenReturn(corsConfiguration.getAccessControlAllowHeaders().toString());
Mockito.when(apimConfiguration.getFirstProperty(APIConstants.CORS_CONFIGURATION_ACCESS_CTL_ALLOW_METHODS)).thenReturn(corsConfiguration.getAccessControlAllowMethods().toString());
Mockito.when(apimConfiguration.getFirstProperty(APIConstants.CORS_CONFIGURATION_ACCESS_CTL_ALLOW_ORIGIN)).thenReturn(corsConfiguration.getAccessControlAllowOrigins().toString());
Mockito.when(artifact.getAttribute(APIConstants.API_OVERVIEW_PROVIDER)).thenReturn(expectedAPI.getId().getProviderName());
Mockito.when(artifact.getAttribute(APIConstants.API_OVERVIEW_NAME)).thenReturn(expectedAPI.getId().getApiName());
Mockito.when(artifact.getAttribute(APIConstants.API_OVERVIEW_VERSION)).thenReturn(expectedAPI.getId().getVersion());
Mockito.when(artifact.getId()).thenReturn(expectedAPI.getUUID());
ApiMgtDAO apiMgtDAO = Mockito.mock(ApiMgtDAO.class);
PowerMockito.mockStatic(ApiMgtDAO.class);
Mockito.when(ApiMgtDAO.getInstance()).thenReturn(apiMgtDAO);
Mockito.when(apiMgtDAO.getAllEnvironments(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)).thenReturn(new ArrayList<org.wso2.carbon.apimgt.api.model.Environment>());
API api = APIUtil.getAPIInformation(artifact, registry);
Assert.assertEquals(expectedAPI.getId(), api.getId());
Assert.assertEquals(expectedAPI.getUUID(), api.getUUID());
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_PROVIDER);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_NAME);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_VERSION);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_THUMBNAIL_URL);
Mockito.verify(artifact, Mockito.atLeastOnce()).getLifecycleState();
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_CONTEXT);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_VISIBILITY);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_VISIBLE_ROLES);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_VISIBLE_TENANTS);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_TRANSPORTS);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_INSEQUENCE);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_OUTSEQUENCE);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_FAULTSEQUENCE);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_DESCRIPTION);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_REDIRECT_URL);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_OWNER);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY);
Mockito.verify(artifact, Mockito.atLeastOnce()).getAttribute(APIConstants.API_OVERVIEW_ENVIRONMENTS);
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
}
use of org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO in project carbon-apimgt by wso2.
the class APIUtilTest method testCreateSwaggerJSONContent.
@Test
public void testCreateSwaggerJSONContent() throws Exception {
System.setProperty("carbon.home", APIUtilTest.class.getResource("/").getFile());
try {
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID);
ServiceReferenceHolder serviceReferenceHolder = Mockito.mock(ServiceReferenceHolder.class);
APIManagerConfigurationService apiManagerConfigurationService = Mockito.mock(APIManagerConfigurationService.class);
APIManagerConfiguration apiManagerConfiguration = Mockito.mock(APIManagerConfiguration.class);
Environment environment = Mockito.mock(Environment.class);
Map<String, Environment> environmentMap = new HashMap<String, Environment>();
environmentMap.put("Production", environment);
PowerMockito.mockStatic(ServiceReferenceHolder.class);
Mockito.when(ServiceReferenceHolder.getInstance()).thenReturn(serviceReferenceHolder);
Mockito.when(serviceReferenceHolder.getAPIManagerConfigurationService()).thenReturn(apiManagerConfigurationService);
Mockito.when(apiManagerConfigurationService.getAPIManagerConfiguration()).thenReturn(apiManagerConfiguration);
Mockito.when(apiManagerConfiguration.getApiGatewayEnvironments()).thenReturn(environmentMap);
Mockito.when(environment.getApiGatewayEndpoint()).thenReturn("");
ApiMgtDAO apiMgtDAO = Mockito.mock(ApiMgtDAO.class);
PowerMockito.mockStatic(ApiMgtDAO.class);
Mockito.when(ApiMgtDAO.getInstance()).thenReturn(apiMgtDAO);
Mockito.when(apiMgtDAO.getAllEnvironments(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)).thenReturn(new ArrayList<org.wso2.carbon.apimgt.api.model.Environment>());
String swaggerJSONContent = APIUtil.createSwaggerJSONContent(getUniqueAPI());
Assert.assertNotNull(swaggerJSONContent);
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
}
use of org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO in project carbon-apimgt by wso2.
the class APIManagerComponentTest method testShouldActivateWhenAllPrerequisitesMet.
@Test
public void testShouldActivateWhenAllPrerequisitesMet() throws Exception {
PowerMockito.mockStatic(APIMgtDBUtil.class);
PowerMockito.mockStatic(APIUtil.class);
PowerMockito.mockStatic(AuthorizationUtils.class);
PowerMockito.mockStatic(RegistryUtils.class);
PowerMockito.mockStatic(ServiceReferenceHolder.class);
PowerMockito.mockStatic(SQLConstantManagerFactory.class);
ServiceReferenceHolder serviceReferenceHolder = Mockito.mock(ServiceReferenceHolder.class);
ComponentContext componentContext = Mockito.mock(ComponentContext.class);
BundleContext bundleContext = Mockito.mock(BundleContext.class);
APIManagerConfiguration configuration = Mockito.mock(APIManagerConfiguration.class);
APIManagerConfigurationService configurationService = Mockito.mock(APIManagerConfigurationService.class);
AuthorizationManager authManager = Mockito.mock(AuthorizationManager.class);
Registry registry = Mockito.mock(Registry.class);
RealmService realmService = Mockito.mock(RealmService.class);
UserRealm userRealm = Mockito.mock(UserRealm.class);
OutputEventAdapterService adapterService = Mockito.mock(OutputEventAdapterService.class);
ThrottleProperties throttleProperties = new ThrottleProperties();
Mockito.doNothing().when(configuration).load(Mockito.anyString());
Mockito.doNothing().when(authManager).authorizeRole(Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
Mockito.doNothing().when(adapterService).create(null);
Mockito.when(componentContext.getBundleContext()).thenReturn(bundleContext);
Mockito.when(registry.resourceExists(Mockito.anyString())).thenReturn(true);
Mockito.when(configuration.getFirstProperty(Mockito.anyString())).thenReturn("").thenReturn(null);
Mockito.when(bundleContext.registerService("", CommonConfigDeployer.class, null)).thenReturn(null);
Mockito.when(authManager.isRoleAuthorized(Mockito.anyString(), Mockito.anyString(), Mockito.anyString())).thenReturn(true);
Mockito.when(serviceReferenceHolder.getRealmService()).thenReturn(realmService);
Mockito.when(serviceReferenceHolder.getAPIManagerConfigurationService()).thenReturn(configurationService);
Mockito.when(serviceReferenceHolder.getOutputEventAdapterService()).thenReturn(adapterService);
Mockito.when(configurationService.getAPIManagerConfiguration()).thenReturn(configuration);
Mockito.when(realmService.getTenantUserRealm(Mockito.anyInt())).thenReturn(userRealm);
Mockito.when(userRealm.getAuthorizationManager()).thenReturn(authManager);
Mockito.when(configuration.getThrottleProperties()).thenReturn(throttleProperties);
PowerMockito.doNothing().when(APIMgtDBUtil.class, "initialize");
PowerMockito.doNothing().when(APIUtil.class, "loadTenantExternalStoreConfig", Mockito.anyString());
PowerMockito.doNothing().when(AuthorizationUtils.class, "addAuthorizeRoleListener", Mockito.anyInt(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
PowerMockito.doNothing().when(SQLConstantManagerFactory.class, "initializeSQLConstantManager");
PowerMockito.when(APIUtil.getMountedPath(null, "")).thenReturn("");
PowerMockito.when(ServiceReferenceHolder.getInstance()).thenReturn(serviceReferenceHolder);
PowerMockito.when(RegistryUtils.getAbsolutePath(null, null)).thenReturn("");
PowerMockito.whenNew(APIManagerConfiguration.class).withAnyArguments().thenReturn(configuration);
PowerMockito.mockStatic(ApiMgtDAO.class);
ApiMgtDAO apiMgtDAO = Mockito.mock(ApiMgtDAO.class);
PowerMockito.when(ApiMgtDAO.getInstance()).thenReturn(apiMgtDAO);
APIManagerConfiguration config = ServiceReferenceHolder.getInstance().getAPIManagerConfigurationService().getAPIManagerConfiguration();
APIManagerComponent apiManagerComponent = new APIManagerComponentWrapper(registry);
GatewayArtifactSynchronizerProperties synchronizerProperties = new GatewayArtifactSynchronizerProperties();
Mockito.when(config.getGatewayArtifactSynchronizerProperties()).thenReturn(synchronizerProperties);
EventHubConfigurationDto eventHubConfigurationDto = new EventHubConfigurationDto();
eventHubConfigurationDto.setEnabled(true);
eventHubConfigurationDto.setInitDelay(0);
eventHubConfigurationDto.setUsername("a");
eventHubConfigurationDto.setPassword("sss".toCharArray());
eventHubConfigurationDto.setServiceUrl("https://localhost");
EventHubConfigurationDto.EventHubPublisherConfiguration eventHubPublisherConfiguration = new EventHubConfigurationDto.EventHubPublisherConfiguration();
eventHubConfigurationDto.setEventHubPublisherConfiguration(eventHubPublisherConfiguration);
Mockito.when(config.getEventHubConfigurationDto()).thenReturn(eventHubConfigurationDto);
try {
apiManagerComponent.activate(componentContext);
} catch (FileNotFoundException f) {
// Exception thrown here means that method was continued without the configuration file
Assert.fail("Should not throw an exception");
}
}
use of org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO in project carbon-apimgt by wso2.
the class APIUtil method getPolicyByName.
public static Tier getPolicyByName(String policyLevel, String policyName, String organization) throws APIManagementException {
int tenantId = APIUtil.getInternalOrganizationId(organization);
ApiMgtDAO apiMgtDAO = ApiMgtDAO.getInstance();
Policy policy;
if (PolicyConstants.POLICY_LEVEL_SUB.equalsIgnoreCase(policyLevel)) {
policy = apiMgtDAO.getSubscriptionPolicy(policyName, tenantId);
} else if (PolicyConstants.POLICY_LEVEL_API.equalsIgnoreCase(policyLevel)) {
policy = apiMgtDAO.getAPIPolicy(policyName, tenantId);
} else if (PolicyConstants.POLICY_LEVEL_APP.equalsIgnoreCase(policyLevel)) {
policy = apiMgtDAO.getApplicationPolicy(policyName, tenantId);
} else {
throw new APIManagementException("No such a policy type : " + policyLevel);
}
if (policy != null) {
if (!APIConstants.UNLIMITED_TIER.equalsIgnoreCase(policy.getPolicyName())) {
Tier tier = new Tier(policy.getPolicyName());
tier.setDescription(policy.getDescription());
tier.setDisplayName(policy.getDisplayName());
Limit limit = policy.getDefaultQuotaPolicy().getLimit();
tier.setTimeUnit(limit.getTimeUnit());
tier.setUnitTime(limit.getUnitTime());
tier.setQuotaPolicyType(policy.getDefaultQuotaPolicy().getType());
// If the policy is a subscription policy
if (policy instanceof SubscriptionPolicy) {
SubscriptionPolicy subscriptionPolicy = (SubscriptionPolicy) policy;
tier.setRateLimitCount(subscriptionPolicy.getRateLimitCount());
tier.setRateLimitTimeUnit(subscriptionPolicy.getRateLimitTimeUnit());
setBillingPlanAndCustomAttributesToTier(subscriptionPolicy, tier);
if (StringUtils.equals(subscriptionPolicy.getBillingPlan(), APIConstants.COMMERCIAL_TIER_PLAN)) {
tier.setMonetizationAttributes(subscriptionPolicy.getMonetizationPlanProperties());
}
}
if (limit instanceof RequestCountLimit) {
RequestCountLimit countLimit = (RequestCountLimit) limit;
tier.setRequestsPerMin(countLimit.getRequestCount());
tier.setRequestCount(countLimit.getRequestCount());
} else if (limit instanceof BandwidthLimit) {
BandwidthLimit bandwidthLimit = (BandwidthLimit) limit;
tier.setRequestsPerMin(bandwidthLimit.getDataAmount());
tier.setRequestCount(bandwidthLimit.getDataAmount());
tier.setBandwidthDataUnit(bandwidthLimit.getDataUnit());
} else {
EventCountLimit eventCountLimit = (EventCountLimit) limit;
tier.setRequestCount(eventCountLimit.getEventCount());
tier.setRequestsPerMin(eventCountLimit.getEventCount());
}
if (PolicyConstants.POLICY_LEVEL_SUB.equalsIgnoreCase(policyLevel)) {
tier.setTierPlan(((SubscriptionPolicy) policy).getBillingPlan());
}
return tier;
} else {
if (APIUtil.isEnabledUnlimitedTier()) {
Tier tier = new Tier(policy.getPolicyName());
tier.setDescription(policy.getDescription());
tier.setDisplayName(policy.getDisplayName());
tier.setRequestsPerMin(Integer.MAX_VALUE);
tier.setRequestCount(Integer.MAX_VALUE);
if (isUnlimitedTierPaid(getTenantDomainFromTenantId(tenantId))) {
tier.setTierPlan(APIConstants.COMMERCIAL_TIER_PLAN);
} else {
tier.setTierPlan(APIConstants.BILLING_PLAN_FREE);
}
return tier;
}
}
}
return null;
}
Aggregations