Skip to content

Commit

Permalink
Fix issues encountered during migration testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharika Madurapperuma committed Oct 4, 2024
1 parent aea47db commit 19b10aa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected void populateDefaultVersion(API api) throws APIManagementException {
apiMgtDAO.setDefaultVersion(api);
}
protected void populateGatewayVendor(API api) throws APIManagementException {
if (api.getGatewayVendor() == null) {
if (api.getGatewayVendor() == null || "null".equals(api.getGatewayVendor())) {
String gatewayVendor = apiMgtDAO.getGatewayVendorByAPIUUID(api.getUuid());
if (gatewayVendor == null) {
gatewayVendor = APIConstants.WSO2_GATEWAY_ENVIRONMENT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17129,8 +17129,13 @@ public SharedScopeUsage getSharedScopeUsage(String uuid, int tenantId) throws AP
String revisionUuid = apiUsageResultSet.getString("REVISION_UUID");
String GET_SHARED_SCOPE_URI_USAGE_BY_TENANT = SQLConstants.GET_SHARED_SCOPE_URI_USAGE_IN_CURRENT_APIS_BY_TENANT;
if (StringUtils.isNotEmpty(revisionUuid)) {
usedApi.setRevision(true);
GET_SHARED_SCOPE_URI_USAGE_BY_TENANT = SQLConstants.GET_SHARED_SCOPE_URI_USAGE_IN_REVISIONS_BY_TENANT;
APIRevision revision = getRevisionByRevisionUUID(connection, revisionUuid);
// This check is done to make sure this does not belong to a Current API entry of an
// API Product url mapping in the AM_API_URL_MAPPING table
if (revision != null) {
usedApi.setRevision(true);
GET_SHARED_SCOPE_URI_USAGE_BY_TENANT = SQLConstants.GET_SHARED_SCOPE_URI_USAGE_IN_REVISIONS_BY_TENANT;
}
}

try (PreparedStatement psForUriUsage = connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ private static void setMaxTpsFromModelToApiDTO(API api, APIDTO dto) {
convertFromMilliseconds(api.getSandboxTimeUnit())));
}
AIConfiguration aiConfiguration = api.getAiConfiguration();
if (aiConfiguration.getTokenBasedThrottlingConfiguration() != null
if (aiConfiguration != null && aiConfiguration.getTokenBasedThrottlingConfiguration() != null
&& aiConfiguration.getTokenBasedThrottlingConfiguration().isTokenBasedThrottlingEnabled()) {
APIMaxTpsTokenBasedThrottlingConfigurationDTO throttlingConfigurationsDTO
= buildThrottlingConfigurationDTO(aiConfiguration.getTokenBasedThrottlingConfiguration());
Expand Down

0 comments on commit 19b10aa

Please sign in to comment.