From ac400b61c7808acd1964bd603153f0d3246ea2f8 Mon Sep 17 00:00:00 2001 From: Prasanna Dangalla Date: Tue, 14 Mar 2023 00:10:17 +0530 Subject: [PATCH] Added suggested fixes in PR> --- .../tests/api/lifecycle/APISecurityTestCase.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APISecurityTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APISecurityTestCase.java index 3d7ffdd7b3..40eae3bcdc 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APISecurityTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APISecurityTestCase.java @@ -106,7 +106,7 @@ public class APISecurityTestCase extends APIManagerLifecycleBaseTest { private final String basicAuthSecuredAPI = "BasicAuthSecuredAPI"; private final String basicAuthAndOauth2SecuredAPI = "BasicAuthAndOauth2SecuredAPI"; private final String basicAuthSecuredAPIContext = "BasicAuthSecuredAPI"; - private final String basicAuthSecuredAPIContext = "BasicAuthAndOauth2SecuredAPI"; + private final String basicAuthAndOauth2SecuredAPI = "BasicAuthAndOauth2SecuredAPI"; private final String API_END_POINT_METHOD = "/customers/123"; private final String API_VERSION_1_0_0 = "1.0.0"; private final String APPLICATION_NAME = "AccessibilityOfDeprecatedOldAPIAndPublishedCopyAPITestCase"; @@ -357,7 +357,7 @@ public void initialize() HttpResponse response7 = restAPIPublisher.addAPI(apiRequest7); apiId7 = response7.getData(); - APIRequest apiRequest8 = new APIRequest(basicAuthAndOauth2SecuredAPI, basicAuthSecuredAPIContext, + APIRequest apiRequest8 = new APIRequest(basicAuthAndOauth2SecuredAPI, basicAuthAndOauth2SecuredAPI, new URL(apiEndPointUrl)); apiRequest8.setVersion(API_VERSION_1_0_0); apiRequest8.setTiersCollection(APIMIntegrationConstants.API_TIER.UNLIMITED); @@ -1029,7 +1029,7 @@ public void testInvokeBasicAuth() throws Exception { String user1 = users[0]; Map requestHeaders1 = new HashMap<>(); requestHeaders1.put("Authorization", - e "Basic " + Base64.encodeBase64String(user1.concat("@").concat(this.user.getUserDomain()).concat(":") + "Basic " + Base64.encodeBase64String(user1.concat("@").concat(this.user.getUserDomain()).concat(":") .concat("randomPassword1").getBytes())); HttpResponse response = HttpRequestUtil.doGet(getAPIInvocationURLHttps(basicAuthSecuredAPIContext, API_VERSION_1_0_0) + API_END_POINT_METHOD, requestHeaders1); @@ -1249,6 +1249,7 @@ public void cleanUpArtifacts() throws Exception { restAPIPublisher.deleteAPI(apiId5); restAPIPublisher.deleteAPI(apiId6); restAPIPublisher.deleteAPI(apiId7); + restAPIPublisher.deleteAPI(apiId8); removeUsers(); }