Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration Tests for Throttle Policy Reset Support Feature #13493

Merged

Conversation

checkThrottling(apiInvocationUrl, requestHeaders, 5);
}

@Test(groups = { "wso2.am" }, description = "Test reset application throttling policy with request count limit")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description incorrect

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with ea0b01f

@Test(groups = { "wso2.am" }, description = "Test reset application throttling policy with request count limit")
public void testResetPolicyWithRequestCountLimit() throws Exception {
//subscribe to API
SubscriptionDTO subscriptionDTO = restAPIStore.subscribeToAPI(apiId,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move subscription code to setEnvironment method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with ea0b01f

requestHeaders.put("accept", "text/xml");
requestHeaders.put("content-type", "application/json");
String apiInvocationUrl = getAPIInvocationURLHttps(APIContext + "/" + APIVersion + "/");

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code untill here should go to setEnvironment method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with ea0b01f

requestHeaders.put("accept", "text/xml");
requestHeaders.put("content-type", "application/json");
String apiInvocationUrl = getAPIInvocationURLHttps(APIContext + "/" + APIVersion + "/");

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code untill here should go to setEnvironment method

Copy link
Contributor Author

@Chanuka-ChandraYapa Chanuka-ChandraYapa May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with ea0b01f

Map<String, String> requestHeaders = new HashMap<String, String>();
requestHeaders.put("Authorization", "Bearer " + accessToken);
requestHeaders.put("accept", "text/xml");
requestHeaders.put("content-type", "application/json");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are already defined content type constants for the values of these content types

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with ea0b01f

@rmsamitha rmsamitha merged commit f9e0982 into wso2:master May 22, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants