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

Added test case to validate both basic auth and auth2 enable api through basic auth. #13179

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

prasa7
Copy link
Contributor

@prasa7 prasa7 commented Mar 10, 2023

No description provided.

private final String basicAuthSecuredAPIContext = "BasicAuthSecuredAPI";
private final String basicAuthSecuredAPIContext = "BasicAuthAndOauth2SecuredAPI";
Copy link
Member

Choose a reason for hiding this comment

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

Duplicate variables

@@ -1199,6 +1229,16 @@ public void testInvocationWithApiKeysWithoutSubscription() throws Exception {
", but got " + invocationResponseAfterSubscriptionRemoved.getResponseCode());
}

@Test(description = "Testing the invocation with Basic Auth for APIKey Only API", dependsOnMethods = {
"testInvokeBasicAuthAfterCredentialsInvalid"})
Copy link
Member

Choose a reason for hiding this comment

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

Fix the test description

@@ -1199,6 +1229,16 @@ public void testInvocationWithApiKeysWithoutSubscription() throws Exception {
", but got " + invocationResponseAfterSubscriptionRemoved.getResponseCode());
}

@Test(description = "Testing the invocation with Basic Auth for APIKey Only API", dependsOnMethods = {
"testInvokeBasicAuthAfterCredentialsInvalid"})
public void testInvocationWithBasicAuthandOauth2ForAPIKey() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

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

Test method name not conveying what is tested

public void testInvocationWithBasicAuthandOauth2ForAPIKey() throws Exception {
Map<String, String> requestHeaders = new HashMap<>();
requestHeaders.put("accept", "text/xml");
requestHeaders.put("Authorization", "Basic abcce");
Copy link
Member

Choose a reason for hiding this comment

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

Header value should be set correctly

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