From 23ce46c4832d74ea5d2a79bc931f0ed7a557ae2c Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Mon, 25 Nov 2024 11:13:08 +0530 Subject: [PATCH 01/20] CDS Test Framework Modification --- .../com/wso2/cds/test/framework/AUTest.groovy | 994 +++++++++++++++++- .../consent/AUBasicAuthAutomationStep.groovy | 4 +- .../AUCCPortalWithdrawalAutomationStep.groovy | 2 - .../AUConfigurationService.groovy | 42 + .../constant/AUConfigConstants.groovy | 9 + .../framework/constant/AUConstants.groovy | 132 ++- .../test/framework/constant/AUPayloads.groovy | 8 +- .../AUAuthorisationBuilder.groovy | 122 ++- .../request_builder/AUJWTGenerator.groovy | 25 +- .../AURegistrationRequestBuilder.groovy | 50 + .../request_builder/AURequestBuilder.groovy | 104 +- .../test/framework/utility/AUTestUtil.groovy | 110 +- .../framework/utility/DbConnection.groovy | 162 +++ .../test/framework/utility/SqlQuery.groovy | 83 ++ .../resources/TestConfigurationExample.xml | 49 +- 15 files changed, 1810 insertions(+), 86 deletions(-) create mode 100644 integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/DbConnection.groovy create mode 100644 integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/SqlQuery.groovy diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/AUTest.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/AUTest.groovy index c245e4fc7..f7b0b447d 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/AUTest.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/AUTest.groovy @@ -35,11 +35,14 @@ import com.wso2.cds.test.framework.automation.consent.AUAccountSelectionStep import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep import com.nimbusds.oauth2.sdk.AccessTokenResponse import com.wso2.cds.test.framework.request_builder.AUJWTGenerator +import com.wso2.cds.test.framework.utility.DbConnection +import com.wso2.cds.test.framework.utility.SqlQuery import com.wso2.openbanking.test.framework.OBTest import com.wso2.cds.test.framework.configuration.AUConfigurationService import com.wso2.openbanking.test.framework.automation.AutomationMethod import com.wso2.openbanking.test.framework.automation.NavigationAutomationStep import com.wso2.openbanking.test.framework.configuration.OBConfigParser +import io.restassured.http.ContentType import io.restassured.response.Response import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.Logger @@ -51,8 +54,11 @@ import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder import com.wso2.cds.test.framework.request_builder.AURequestBuilder import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder import com.wso2.cds.test.framework.utility.AUTestUtil +import org.testng.asserts.SoftAssert import java.nio.charset.Charset +import java.time.LocalDate +import java.time.LocalDateTime import java.time.OffsetDateTime import java.time.ZoneOffset import com.google.gson.Gson @@ -69,6 +75,26 @@ class AUTest extends OBTest { AUAuthorisationBuilder auAuthorisationBuilder private boolean adrNameCheck AUJWTGenerator generator + public static int activeAuthIndividual, activeAuthNonIndividual, newAuthCurrentDayOngoingIndividual, + newAuthCurrentDayOngoingNonIndividual, newAuthCurrentDayOnceOffIndividual, + newAuthCurrentDayOnceOffNonIndividual, revokedCurrentDayIndividual, revokedCurrentDayNonIndividual, + amendedCurrentDayIndividual, amendedCurrentDayNonIndividual, expiredCurrentDayIndividual, + expiredCurrentDayNonIndividual, abandonedPreIdentificationCurrentDay, abandonedPreAuthenticationCurrentDay, + abandonedPreAccountSelectionCurrentDay, abandonedPreAuthorisationCurrentDay, abandonedRejectedCurrentDay, + abandonedFailedTokenExchangeCurrentDay, abandonedCurrentDay, unauthenticatedCurrentDay, + highPriorityCurrentDay, lowPriorityCurrentDay, unattendedCurrentDay, largePayloadCurrentDay, + customerCount, recipientCount, sessionCount + + int totalInvocationsPerf, totalInvocationsAvg, totalInvocationsHighPerf, totalInvocationsLowPerf, + totalInvocationsUnattendedPerf, totalInvocationsUnAuthPerf, totalInvocationsLargePayPerf, + totalInvocationsHighAvg, totalInvocationsLowAvg, totalInvocationsUnattendedAvg, totalInvocationsUnAuthAvg, + totalInvocationsLargePayAvg + public LocalDate today = LocalDate.now() + int currentTime + public String unauthErrorCurrentDay, authErrorCurrentDay, aggErrorCurrentDay + public int[] performanceMetrics + public int[] avgResponseMetrics + public int[] totalResources @BeforeClass(alwaysRun = true) void "Initialize Test Suite"() { @@ -242,7 +268,7 @@ class AUTest extends OBTest { String authCode = AUTestUtil.getCodeFromJwtResponse(automation.currentUrl.get()) return authCode } - + /** * Method for get user access token response * @return @@ -404,12 +430,12 @@ class AUTest extends OBTest { AUPageObjects.VALUE) authWebDriver.clickButtonXpath(AUTestUtil.getBusinessAccount2CheckBox()) - if (isSelectMultipleAccounts) { - //Select Business Account 2 - secondConsentedAccount = authWebDriver.getElementAttribute(AUTestUtil.getBusinessAccount3CheckBox(), - AUPageObjects.VALUE) - authWebDriver.clickButtonXpath(AUTestUtil.getBusinessAccount3CheckBox()) - } +// if (isSelectMultipleAccounts) { +// //Select Business Account 2 +// secondConsentedAccount = authWebDriver.getElementAttribute(AUTestUtil.getBusinessAccount3CheckBox(), +// AUPageObjects.VALUE) +// authWebDriver.clickButtonXpath(AUTestUtil.getBusinessAccount3CheckBox()) +// } } else { //Select Individual Profile authWebDriver.selectOption(AUPageObjects.INDIVIDUAL_PROFILE_SELECTION) @@ -590,11 +616,11 @@ class AUTest extends OBTest { * @param profiles */ String doConsentAuthorisationViaRequestUriDenyFlow(List scopes, URI requestUri, - String clientId = null , AUAccountProfile profiles = null, + String clientId = null , AUAccountProfile profiles = null, boolean isStateParamPresent = true) { if (clientId != null) { - authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri, - auConfiguration.getAppInfoClientID(), isStateParamPresent).toURI().toString() + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri, + auConfiguration.getAppInfoClientID(), isStateParamPresent).toURI().toString() } else { authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri, null, isStateParamPresent).toURI().toString() @@ -678,6 +704,8 @@ class AUTest extends OBTest { void doSecondaryAccountSelection(List scopes, URI requestUri, String clientId = null, boolean isMultipleAccountsSelect = false) { + auConfiguration.setPsuNumber(1) + if (clientId != null) { authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri, clientId) .toURI().toString() @@ -992,7 +1020,7 @@ class AUTest extends OBTest { return automationResponse } - + /** * Update Business Use rPermission With Incorrect Payload. * @param headerString basic auth header @@ -1148,7 +1176,7 @@ class AUTest extends OBTest { return AURestAsRequestBuilder.buildRequest() .header(AUConstants.AUTHORIZATION_HEADER_KEY, AUConstants.BASIC_HEADER_KEY + " " + Base64.encoder.encodeToString("${auConfiguration.getUserBasicAuthName()}:${auConfiguration.getUserBasicAuthPWD()}" - .getBytes(Charset.forName("UTF-8")))) + .getBytes(Charset.forName("UTF-8")))) .contentType(AUConstants.CONTENT_TYPE_APPLICATION_JSON) .body(requestBody) .baseUri(auConfiguration.getServerAuthorisationServerURL()) @@ -1201,7 +1229,7 @@ class AUTest extends OBTest { */ static Response updateSecondaryUserInstructionPermission(String secondaryAccId, String userId, String secondaryAccountInstructionStatus, - boolean otherAccountsAvailability = false) { + boolean otherAccountsAvailability = true) { def requestBody = AUPayloads.getSecondaryUserInstructionPermissionPayload(secondaryAccId, userId, secondaryAccountInstructionStatus, otherAccountsAvailability) @@ -1226,10 +1254,12 @@ class AUTest extends OBTest { */ static Response getLegalEntityIds(String userID) { + userID = "amy@gold.com@carbon.super" + return AURestAsRequestBuilder.buildRequest() .header(AUConstants.AUTHORIZATION_HEADER_KEY, AUConstants.BASIC_HEADER_KEY + " " + Base64.encoder.encodeToString("${auConfiguration.getUserBasicAuthName()}:${auConfiguration.getUserBasicAuthPWD()}" - .getBytes(Charset.forName("UTF-8")))) + .getBytes(Charset.forName("UTF-8")))) .contentType(AUConstants.CONTENT_TYPE_APPLICATION_JSON) .baseUri(auConfiguration.getServerAuthorisationServerURL()) .get("${AUConstants.CONSENT_STATUS_AU_ENDPOINT}${AUConstants.LEGAL_ENTITY_LIST_ENDPOINT}/${userID}") @@ -1288,8 +1318,8 @@ class AUTest extends OBTest { } } } - - /** + + /** * Verify Scope of Token Response. * @param scopesString - scope list * @param eliminatedScope - scope to be eliminated @@ -1302,25 +1332,25 @@ class AUTest extends OBTest { Assert.assertTrue(scopesString.contains(scope.getScopeString())) } } - } - + } + /** * Method for get user access token response * @return */ AccessTokenResponse getUserAccessTokenFormRefreshToken(RefreshToken refreshToken) { - try { - return AURequestBuilder.getUserTokenFromRefreshToken(refreshToken) - } - catch (Exception e) { - log.error(e) - } + try { + return AURequestBuilder.getUserTokenFromRefreshToken(refreshToken) } + catch (Exception e) { + log.error(e) + } + } Response doRevokeCdrArrangement(String clientId, String cdrArrangementId){ generator = new AUJWTGenerator() - String assertionString = generator.getClientAssertionJwt(clientId) + String assertionString = generator.getClientAssertionJwtWithoutIAT(clientId) def bodyContent = [(AUConstants.CLIENT_ID_KEY): (clientId), (AUConstants.CLIENT_ASSERTION_TYPE_KEY): (AUConstants.CLIENT_ASSERTION_TYPE), @@ -1375,7 +1405,7 @@ class AUTest extends OBTest { .baseUri(auConfiguration.getServerAuthorisationServerURL()) .get("${AUConstants.CONSENT_STATUS_ENDPOINT}${AUConstants.STATUS_PATH}?${consentId}") } - + /** * Consent authorization method with Request URI and Response Mode * @param scopes @@ -1444,4 +1474,916 @@ class AUTest extends OBTest { // Get Code From URL authorisationCode = AUTestUtil.getCodeFromJwtResponse(automation.currentUrl.get()) } + + /** + * Get Metrics Response. + * @param period query param to filter period (CURRENT,HISTORIC,ALL) + * @return metrics response + */ + static Response getMetrics(String period = "ALL"){ + + AUJWTGenerator generator = new AUJWTGenerator() + String assertionString = generator.getClientAssertionJwt(AUConstants.ADMIN_API_ISSUER, + AUConstants.ADMIN_API_AUDIENCE) + + def metricsResponse = AURequestBuilder.buildBasicRequest(assertionString, AUConstants.X_V_HEADER_METRICS) + .contentType(ContentType.JSON) + .header(AUConstants.X_MIN_HEADER, AUConstants.X_V_MIN_HEADER_METRICS) + .queryParam(AUConstants.PERIOD, period) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ADMIN)) + .get("${AUConstants.CDS_ADMIN_PATH}${AUConstants.ADMIN_METRICS}") + + return metricsResponse + } + + /** + * Get the Metrics Response and assign metrics to variables. + * @param metricsResponse + */ + void getInitialMetricsResponse(Response metricsResponse) { + + //Invocation + unauthenticatedCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.INVOCATION_UNAUTHENTICATED_CURRENTDAY).toInteger() + highPriorityCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.INVOCATION_HIGHPRIORITY_CURRENTDAY).toInteger() + lowPriorityCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.INVOCATION_LOWPRIORITY_CURRENTDAY).toInteger() + largePayloadCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.INVOCATION_LARGEPAYLOAD_CURRENTDAY).toInteger() + unattendedCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.INVOCATION_UNATTENDED_CURRENTDAY).toInteger() + + //Authorisations + activeAuthIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ACTIVE_AUTHORIZATION_INDIVIDUAL).toInteger() + activeAuthNonIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ACTIVE_AUTHORIZATION_NONINDIVIDUAL).toInteger() + newAuthCurrentDayOngoingIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.NEWAUTH_CURRENTDAY_ONGOING_INDIVIDUAL).toInteger() + newAuthCurrentDayOngoingNonIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.NEWAUTH_CURRENTDAY_ONGOING_NONINDIVIDUAL).toInteger() + newAuthCurrentDayOnceOffIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.NEWAUTH_CURRENTDAY_ONCEOFF_INDIVIDUAL).toInteger() + newAuthCurrentDayOnceOffNonIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.NEWAUTH_CURRENTDAY_ONCEOFF_NONINDIVIDUAL).toInteger() + revokedCurrentDayIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.REVOKED_CURRENTDAY_INDIVIDUAL).toInteger() + revokedCurrentDayNonIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.REVOKED_CURRENTDAY_NONINDIVIDUAL).toInteger() + amendedCurrentDayIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.AMENDED_CURRENTDAY_INDIVIDUAL).toInteger() + amendedCurrentDayNonIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.AMENDED_CURRENTDAY_NONINDIVIDUAL).toInteger() + expiredCurrentDayIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.EXPIRED_CURRENTDAY_INDIVIDUAL).toInteger() + expiredCurrentDayNonIndividual = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.EXPIRED_CURRENTDAY_NONINDIVIDUAL).toInteger() + abandonedCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_CURRENTDAY).toInteger() + abandonedPreIdentificationCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_PREIDENTIFICATION_CURRENTDAY).toInteger() + abandonedPreAuthenticationCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_PREAUTHENTICATE_CURRENTDAY).toInteger() + abandonedPreAccountSelectionCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_PREACCSELECT_CURRENTDAY).toInteger() + abandonedPreAuthorisationCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_PREAUTH_CURRENTDAY).toInteger() + abandonedRejectedCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_REJECTED_CURRENTDAY).toInteger() + abandonedFailedTokenExchangeCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_FAILEDTOKEN_CURRENTDAY).toInteger() + + //Error Response + unauthErrorCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ERROR_UNAUTH_CURRENTDAY) + authErrorCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ERROR_AUTH_CURRENTDAY) + aggErrorCurrentDay = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ERROR_AGGREGATE_CURRENTDAY) + + //Customer and Recipient Count + customerCount = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_CUSTOMER_COUNT).toInteger() + recipientCount = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_RECIPIENT_COUNT).toInteger() + + //Session Count + sessionCount = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_SESSION_COUNT_CURRENTDAY).toInteger() + } + + /** + * Asserting Metrics Authorisation Response. + * @param metricsResponse + */ + static void assertMetricsAuthorisationResponse(Response metricsResponse) { + + //Asserting the Invocations + assertMetricsInvocationResponse(metricsResponse) + + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ACTIVE_AUTHORIZATION_INDIVIDUAL), + "${activeAuthIndividual}", "$AUConstants.ACTIVE_AUTHORIZATION_INDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ACTIVE_AUTHORIZATION_NONINDIVIDUAL), + "${activeAuthNonIndividual}", "$AUConstants.ACTIVE_AUTHORIZATION_NONINDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.NEWAUTH_CURRENTDAY_ONGOING_INDIVIDUAL), + "${newAuthCurrentDayOngoingIndividual}", + "$AUConstants.NEWAUTH_CURRENTDAY_ONGOING_INDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.NEWAUTH_CURRENTDAY_ONGOING_NONINDIVIDUAL), "${newAuthCurrentDayOngoingNonIndividual}", + "$AUConstants.NEWAUTH_CURRENTDAY_ONGOING_NONINDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.NEWAUTH_CURRENTDAY_ONCEOFF_INDIVIDUAL), + "${newAuthCurrentDayOnceOffIndividual}", + "$AUConstants.NEWAUTH_CURRENTDAY_ONCEOFF_INDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.NEWAUTH_CURRENTDAY_ONCEOFF_NONINDIVIDUAL), "${newAuthCurrentDayOnceOffNonIndividual}", + "$AUConstants.NEWAUTH_CURRENTDAY_ONCEOFF_NONINDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.REVOKED_CURRENTDAY_INDIVIDUAL), + "${revokedCurrentDayIndividual}", "$AUConstants.REVOKED_CURRENTDAY_INDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.REVOKED_CURRENTDAY_NONINDIVIDUAL), + "${revokedCurrentDayNonIndividual}", + "$AUConstants.REVOKED_CURRENTDAY_NONINDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.AMENDED_CURRENTDAY_INDIVIDUAL), + "${amendedCurrentDayIndividual}", + "$AUConstants.AMENDED_CURRENTDAY_INDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.AMENDED_CURRENTDAY_NONINDIVIDUAL), + "${amendedCurrentDayNonIndividual}", + "$AUConstants.AMENDED_CURRENTDAY_NONINDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.EXPIRED_CURRENTDAY_INDIVIDUAL), + "${expiredCurrentDayIndividual}", "$AUConstants.EXPIRED_CURRENTDAY_INDIVIDUAL count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.EXPIRED_CURRENTDAY_NONINDIVIDUAL), + "${expiredCurrentDayNonIndividual}", "$AUConstants.EXPIRED_CURRENTDAY_NONINDIVIDUAL count mismatch") + + if (AUConstants.X_V_HEADER_METRICS == 4) { + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ABANDON_CURRENTDAY), + "${abandonedCurrentDay}", "$AUConstants.ABANDON_CURRENTDAY count mismatch") + } else { + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ABANDON_CURRENTDAY), + "${abandonedCurrentDay}", "$AUConstants.ABANDON_CURRENTDAY count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_PREIDENTIFICATION_CURRENTDAY), "${abandonedPreIdentificationCurrentDay}", + "$AUConstants.ABANDON_PREIDENTIFICATION_CURRENTDAY count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_PREIDENTIFICATION_CURRENTDAY), "${abandonedPreIdentificationCurrentDay}", + "$AUConstants.ABANDON_PREIDENTIFICATION_CURRENTDAY count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_PREAUTHENTICATE_CURRENTDAY), "${abandonedPreAuthenticationCurrentDay}", + "$AUConstants.ABANDON_PREAUTHENTICATE_CURRENTDAY count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_PREACCSELECT_CURRENTDAY), "${abandonedPreAccountSelectionCurrentDay}", + "$AUConstants.ABANDON_PREACCSELECT_CURRENTDAY count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_PREAUTH_CURRENTDAY), "${abandonedPreAuthorisationCurrentDay}", + "$AUConstants.ABANDON_PREAUTH_CURRENTDAY count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_REJECTED_CURRENTDAY), "${abandonedRejectedCurrentDay}", + "$AUConstants.ABANDON_REJECTED_CURRENTDAY count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.ABANDON_FAILEDTOKEN_CURRENTDAY), "${abandonedFailedTokenExchangeCurrentDay}", + "$AUConstants.ABANDON_FAILEDTOKEN_CURRENTDAY count mismatch") + } + } + + + /** + * Consent Amendment Authorisation + * @param scopes + * @param cdrArrangementId + * @param sharingDuration + * @param clientId + * @return auth code + */ + String doConsentAmendmentAuthorisation(List scopes, String cdrArrangementId, long sharingDuration, + String clientId = null) { + + if (clientId == null) { + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, sharingDuration, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI()) + .toURI().toString() + } else { + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, sharingDuration, + true, cdrArrangementId, clientId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), clientId) + .toURI().toString() + } + + //Consent Amendment Authorisation Flow + def automation = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Verify Account Selection Page + assert authWebDriver.isElementDisplayed(AUTestUtil.getAltSingleAccountXPath()) + authWebDriver.clickButtonXpath(AUTestUtil.getAltSingleAccountXPath()) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + + //Click Authorise Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + } + .execute() + + // Get Code From URL + return AUTestUtil.getCodeFromJwtResponse(automation.currentUrl.get()) + } + + /** + * Authorise Consent Without Closing Browser. + * @param scopes + * @param requestUri + * @return authorisation code + */ + String authoriseConsentWithoutClosingBrowser(List scopes, URI requestUri, + String clientId = null, boolean isMultipleAccSelect = false, + AUAccountProfile profiles = null) { + + if (clientId != null) { + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri, clientId) + .toURI().toString() + } else { + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri) + .toURI().toString() + } + + //UI Flow Navigation + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + selectProfileAndAccount(authWebDriver, profiles, isMultipleAccSelect) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + + //Click Authorise Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + } + .execute(false) + + // Get Code From URL + def authorisationCode = AUTestUtil.getCodeFromJwtResponse(automationResponse.currentUrl.get()) + return authorisationCode + } + + /** + * Get Errors Count in the Metrics Response. + * @param errorsResponse + * @param resourceType + * @param modifiedErrorCode + * @param modifiedValue + * @return updatedKeyValuePairsString + */ + static String getErrorsMetrics(String metricsResponse, int modifiedErrorCode) { + + String updatedKeyValuePairsString = "" + + // Parse the metrics response and extract the key-value pairs + List errorCountKeyValuePairs = AUTestUtil.parseKeyValuePairs(metricsResponse) + + // Define the expected order based on keys + List expectedOrderKeys = Arrays.asList(400, 422, 401, 500, 403, 415, 404, 406) + + // Flag to track if the modifiedErrorCode is found in the existing error list + boolean isStatusCodePresent = false + + // Iterate through each key-value pair + for (int i = 0; i < errorCountKeyValuePairs.size(); i++) { + + String[] keyValue = errorCountKeyValuePairs.get(i).split(":") + int key = Integer.parseInt(keyValue[0]) + int value = Integer.parseInt(keyValue[1]) + + // If new error code exist in the existing error Metrics list; Increase the value of the particular + // error code by 1 and Update the KeyValue Pair + if (key == modifiedErrorCode) { + value += 1 + errorCountKeyValuePairs.set(i, modifiedErrorCode + ":" + value) + isStatusCodePresent = true + break + } + } + + // If modifiedErrorCode is not found in the existing list, add it with value 1 + if (!isStatusCodePresent) { + errorCountKeyValuePairs.add(modifiedErrorCode + ":1") + } + + // Sort the list according to your desired order + errorCountKeyValuePairs.sort(new Comparator() { + @Override + int compare(String o1, String o2) { + int key1 = Integer.parseInt(o1.split(":")[0]) + int key2 = Integer.parseInt(o2.split(":")[0]) + return Integer.compare(expectedOrderKeys.indexOf(key1), expectedOrderKeys.indexOf(key2)) + } + }) + + // Convert the sorted list to a string array + String[] sortedArray = errorCountKeyValuePairs.toArray(new String[0]) + + // Output the sorted array + for (String element : sortedArray) { + // Convert the list to a string + updatedKeyValuePairsString = "[" + String.join(", ", errorCountKeyValuePairs) + "]" + } + return updatedKeyValuePairsString + } + + /** + * Assert Metrics Error Response. + * @param metricsResponse + */ + void assertMetricsErrorResponse(Response metricsResponse) { + + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ERROR_UNAUTH_CURRENTDAY), + "${unauthErrorCurrentDay}", "$AUConstants.ERROR_UNAUTH_CURRENTDAY count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ERROR_AUTH_CURRENTDAY), + "${authErrorCurrentDay}", "$AUConstants.ERROR_AUTH_CURRENTDAY count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ERROR_AGGREGATE_CURRENTDAY), + "${aggErrorCurrentDay}", "$AUConstants.ERROR_AGGREGATE_CURRENTDAY count mismatch") + } + + /** + * Calculate Performance, Average Response and Average TPS Metrics for each tier + */ + void calculateTierBasedMetrics() { + + //Calculate Performance Metrics + performanceMetrics = metricsPerformanceCalculation() + + //Calculate Total Response Time for each tier + avgResponseMetrics = calculateTierWiseTotalResponseTime() + + //Calculate Total Resource count for average TPS + totalResources = calculateTotalResourceCount() + } + + /** + * Calculate Performance Metrics for Defined Tier + * @param tier + * @return metrics value + */ + int[] metricsPerformanceCalculation() { + + String tier + int responseTime + int[] withinThreshold = new int[5] // Array to store counts for each tier + totalInvocationsPerf = 0 + totalInvocationsUnAuthPerf = 0 + totalInvocationsHighPerf = 0 + totalInvocationsLowPerf = 0 + totalInvocationsUnattendedPerf = 0 + totalInvocationsLargePayPerf = 0 + + // Get the current UTC time + LocalDateTime utcTime = LocalDateTime.now(ZoneOffset.UTC) + + // Convert UTC time to GMT time + LocalDateTime gmtTime = utcTime.atOffset(ZoneOffset.UTC).atZoneSameInstant(ZoneOffset.ofHours(0)).toLocalDateTime() + + //Get the current hour + currentTime = gmtTime.getHour().toInteger() + + //Get Start and End Time + long startTimeOfDay = today.atTime(currentTime, 00, 00).toEpochSecond(ZoneOffset.UTC) + long endTimeOfDay = today.atTime(currentTime, 59, 59).toEpochSecond(ZoneOffset.UTC) + + // Execute SELECT query and get results as an array + def query = SqlQuery.retrieveRecordsWithinSpecifiedPeriod(startTimeOfDay, endTimeOfDay) + Object[][] results = DbConnection.executeSelectQuery(AUConstants.REPORTING_DBNAME, query) + totalInvocationsPerf = results.length + + // Process and check the response time within threshold + if (results != null) { + for (Object[] row : results) { + responseTime = row[0] + + //Do not count the request as a invocation if the status code is 405 + if(row[2]==AUConstants.STATUS_CODE_405) { + continue + } + + tier = AUTestUtil.getPriorityTier(row[1], row[3]) + + if(!row[1].equals("/par")) { + + switch (tier) { + case AUConstants.UNAUTHENTICATED: + totalInvocationsUnAuthPerf = totalInvocationsUnAuthPerf + 1 + if (responseTime <= 1500){ + withinThreshold[0]++ + } + break + case AUConstants.HIGH_PRIORITY: + totalInvocationsHighPerf = totalInvocationsHighPerf + 1 + if (responseTime <= 1000){ + withinThreshold[1]++ + } + break + case AUConstants.LOW_PRIORITY: + totalInvocationsLowPerf = totalInvocationsLowPerf + 1 + if (responseTime <= 1500){ + withinThreshold[2]++ + } + break + case AUConstants.UNATTENDED: + totalInvocationsUnattendedPerf = totalInvocationsUnattendedPerf + 1 + if (responseTime <= 4000){ + withinThreshold[3]++ + } + break + case AUConstants.LARGE_PAYLOAD: + totalInvocationsLargePayPerf = totalInvocationsLargePayPerf + 1 + if (responseTime <= 6000){ + withinThreshold[4]++ + } + break + default: + throw new IllegalStateException("Unexpected value: " + tier + " for " + row[1]) + } + } + } + } + + return withinThreshold + } + + /** + * Assertions for Tier Based Metrics - Performance, Average Response and Average TPS. + * @param metricsResponse + */ + void assertTierBasedMetrics(Response metricsResponse) { + + //Asserting the Invocations + assertMetricsInvocationResponse(metricsResponse) + + //Asserting the Performance + assertPerformanceMetricsResponse(metricsResponse, performanceMetrics) + + //Asserting Average Response Time + assertAvgResponseMetricsResponse(metricsResponse, avgResponseMetrics) + + //Asserting Average TPS + assertAvgTpsMetricsResponse(metricsResponse, totalResources) + } + + /** + * Asserting Metrics Invocation Response. + * @param metricsResponse + */ + static void assertMetricsInvocationResponse(Response metricsResponse) { + + SoftAssert softAssert = new SoftAssert() + + softAssert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.INVOCATION_UNAUTHENTICATED_CURRENTDAY), + "${unauthenticatedCurrentDay}", "$AUConstants.INVOCATION_UNAUTHENTICATED_CURRENTDAY count mismatch") + softAssert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.INVOCATION_HIGHPRIORITY_CURRENTDAY), + "${highPriorityCurrentDay}", "$AUConstants.INVOCATION_HIGHPRIORITY_CURRENTDAY count mismatch") + softAssert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.INVOCATION_LOWPRIORITY_CURRENTDAY), + "${lowPriorityCurrentDay}", "$AUConstants.INVOCATION_LOWPRIORITY_CURRENTDAY count mismatch") + softAssert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.INVOCATION_UNATTENDED_CURRENTDAY), + "${unattendedCurrentDay}", "$AUConstants.INVOCATION_UNATTENDED_CURRENTDAY count mismatch") + softAssert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.INVOCATION_LARGEPAYLOAD_CURRENTDAY), + "${largePayloadCurrentDay}", "$AUConstants.INVOCATION_LARGEPAYLOAD_CURRENTDAY count mismatch") + + softAssert.assertAll() + } + + /** + * Assert Performance Metrics Response + * @param metricsResponse + * @param withinThreshold + * @param arrayIndex + */ + void assertPerformanceMetricsResponse(Response metricsResponse, int[] withinThreshold) { + + SoftAssert softAssert = new SoftAssert() + + //Unauthenticated Performance Value + String unauthPerfResponse = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.PERFORMANCE_UNAUTH_CURRENTDAY) + double unauthPerf = roundUpThreeDecimals(Double.parseDouble(unauthPerfResponse.substring(unauthPerfResponse + .lastIndexOf(",") + 1, unauthPerfResponse.length() - 1).trim())) + + softAssert.assertEquals(unauthPerf, calculatePerformance(withinThreshold[0], totalInvocationsUnAuthPerf), + "$AUConstants.PERFORMANCE_UNAUTH_CURRENTDAY count mismatch") + + //High Priority Performance Value + String highPerfResponse = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.PERFORMANCE_HIGH_CURRENTDAY) + double highPerf = roundUpThreeDecimals(Double.parseDouble(highPerfResponse.substring(highPerfResponse + .lastIndexOf(",") + 1, highPerfResponse.length() - 1).trim())) + + softAssert.assertEquals(highPerf, calculatePerformance(withinThreshold[1], totalInvocationsHighPerf), + "$AUConstants.PERFORMANCE_HIGH_CURRENTDAY count mismatch") + + //Low Priority Performance Value + String lowPerfResponse = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.PERFORMANCE_LOW_CURRENTDAY) + double lowPerf = roundUpThreeDecimals(Double.parseDouble(lowPerfResponse.substring(lowPerfResponse + .lastIndexOf(",") + 1, lowPerfResponse.length() - 1).trim())) + + softAssert.assertEquals(lowPerf, calculatePerformance(withinThreshold[2], totalInvocationsLowPerf), + "$AUConstants.PERFORMANCE_LOW_CURRENTDAY count mismatch") + + //Unattended Performance Value + String unattendedPerfResponse = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.PERFORMANCE_UNATTENDED_CURRENTDAY) + double unattendedPerf = roundUpThreeDecimals(Double.parseDouble(unattendedPerfResponse.substring(unattendedPerfResponse + .lastIndexOf(",") + 1, unattendedPerfResponse.length() - 1).trim())) + + softAssert.assertEquals(unattendedPerf, calculatePerformance(withinThreshold[3], totalInvocationsUnattendedPerf), + "$AUConstants.PERFORMANCE_UNATTENDED_CURRENTDAY count mismatch") + + //Large Payload Performance Value + String largePayPerfResponse = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.PERFORMANCE_LARGE_PAYLOAD_CURRENTDAY) + double largePayPerf = roundUpThreeDecimals(Double.parseDouble(largePayPerfResponse.substring(largePayPerfResponse + .lastIndexOf(",") + 1, largePayPerfResponse.length() - 1).trim())) + + softAssert.assertEquals(largePayPerf, calculatePerformance(withinThreshold[4], totalInvocationsLargePayPerf), + "$AUConstants.PERFORMANCE_LARGE_PAYLOAD_CURRENTDAY count mismatch") + + softAssert.assertAll() + } + + /** + * Assert Average Response Time. + * @param metricsResponse + * @param totalResponseTime + */ + void assertAvgResponseMetricsResponse(Response metricsResponse, int[] totalResponseTime) { + + SoftAssert softAssert = new SoftAssert() + + //Unauthenticated Average Response Value + double unauthAvgResponse = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.AVG_RESPONSE_UNAUTH_CURRENTDAY) + .toDouble() + + softAssert.assertEquals(unauthAvgResponse, calculateAverageResponseTime(totalResponseTime[0], + totalInvocationsUnAuthAvg), "$AUConstants.AVG_RESPONSE_UNAUTH_CURRENTDAY count mismatch") + + //High Priority Average Response Value + double highAvgResponse = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.AVG_RESPONSE_HIGH_CURRENTDAY) + .toDouble() + + softAssert.assertEquals(highAvgResponse, calculateAverageResponseTime(totalResponseTime[1], totalInvocationsHighAvg), + "$AUConstants.AVG_RESPONSE_HIGH_CURRENTDAY count mismatch") + + //Low Priority Average Response Value + double lowAvgResponse = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.AVG_RESPONSE_LOW_CURRENTDAY) + .toDouble() + + softAssert.assertEquals(lowAvgResponse, calculateAverageResponseTime(totalResponseTime[2], totalInvocationsLowAvg), + "$AUConstants.AVG_RESPONSE_LOW_CURRENTDAY count mismatch") + + //Unattended Average Response Value + double unattendedAvgResponse = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.AVG_RESPONSE_UNATTENDED_CURRENTDAY).toDouble() + + softAssert.assertEquals(unattendedAvgResponse, calculateAverageResponseTime(totalResponseTime[3], + totalInvocationsUnattendedAvg), "$AUConstants.AVG_RESPONSE_UNATTENDED_CURRENTDAY count mismatch") + + //Large Payload Average Response Value + double largePayAvgResponse = AUTestUtil.parseResponseBody(metricsResponse, + AUConstants.AVG_RESPONSE_LARGE_PAYLOAD_CURRENTDAY).toDouble() + + softAssert.assertEquals(largePayAvgResponse, calculateAverageResponseTime(totalResponseTime[4], + totalInvocationsLargePayAvg), "$AUConstants.AVG_RESPONSE_LARGE_PAYLOAD_CURRENTDAY count mismatch") + + softAssert.assertAll() + } + + /** + * Assert Average TPS Metrics. + * @param metricsResponse + * @param totalResourceCount + */ + void assertAvgTpsMetricsResponse(Response metricsResponse, int[] totalResourceCount) { + + SoftAssert softAssert = new SoftAssert() + + //Unauthenticated Average TPS Value + String unauthAvgTps = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.AVGTPS_UNAUTHENTICATED_CURRENTDAY) + + def expectedUnauthAvgTps = calculateAverageTps(totalResourceCount[0]) + softAssert.assertEquals(unauthAvgTps, expectedUnauthAvgTps.toString(), + "$AUConstants.AVGTPS_UNAUTHENTICATED_CURRENTDAY count mismatch") + + //Authenticated Average TPS Value + def authAvgTps = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.AVGTPS_AUTHENTICATED_CURRENTDAY) + + def expectedAuthAvgTps = calculateAverageTps(totalResourceCount[1]) + softAssert.assertEquals(authAvgTps, expectedAuthAvgTps.toString(), + "$AUConstants.AVGTPS_AUTHENTICATED_CURRENTDAY count mismatch") + + //Aggregate Average TPS Value + String aggAvgTps = AUTestUtil.parseResponseBody(metricsResponse, AUConstants.AVGTPS_AGGREGATE_CURRENTDAY) + int aggregateAvgTps = totalResourceCount[1].toInteger() + totalResourceCount[0].toInteger() + + def expectedAggAvgTps = calculateAverageTps(aggregateAvgTps) + softAssert.assertEquals(aggAvgTps, expectedAggAvgTps.toString(), + "$AUConstants.AVGTPS_AGGREGATE_CURRENTDAY count mismatch") + + softAssert.assertAll() + } + + /** + * Round Up the Metrics to Three Decimal Places. + * @param withinThreshold + * @return roundedPerfValue + */ + static double roundUpThreeDecimals(def metrics) { + + // Using DecimalFormat to round to 3 decimal places + String roundedValue = String.format("%.3f", metrics.toDouble()) + return Double.parseDouble(roundedValue) + } + + /** + * Calculate Performance Metrics + * @param withinThreshold + * @param totalInvocations + * @return performanceMetrics + */ + static double calculatePerformance(int withinThreshold, int totalInvocations){ + + double performanceMetrics + + if(!withinThreshold.equals(0)) { + performanceMetrics = withinThreshold.toDouble() / totalInvocations.toDouble() + } else { + performanceMetrics = 1.000 + } + + return roundUpThreeDecimals(performanceMetrics) + } + + + /** + * Calculate Average Response Time + * @param responseTime + * @param totalInvocations + * @return + */ + static double calculateAverageResponseTime(int responseTime, int totalInvocations){ + + double avgResponseTimeMetrics + + if(!responseTime.equals(0)) { + avgResponseTimeMetrics = responseTime.toDouble() / totalInvocations.toDouble() + } else { + avgResponseTimeMetrics = 0 + } + + return roundUpThreeDecimals(avgResponseTimeMetrics/1000) + } + + /** + * Calculate Average TPS + * @param resourceCount + * @return averageTps + */ + static double calculateAverageTps(int resourceCount){ + + def averageTpsMetrics + + if(!resourceCount.equals(0)) { + averageTpsMetrics = (resourceCount / 86400) + } else { + averageTpsMetrics = 0 + } + + return roundUpThreeDecimals(averageTpsMetrics) + } + + /** + * CDR Arrangement Revocation without Client Id in the request body + * @param clientId + * @param cdrArrangementId + * @return + */ + Response doRevokeCdrArrangementWithoutClientIdInRequest(String clientId, String cdrArrangementId){ + + generator = new AUJWTGenerator() + String assertionString = generator.getClientAssertionJwt(clientId) + + def bodyContent = [ + (AUConstants.CLIENT_ASSERTION_TYPE_KEY): (AUConstants.CLIENT_ASSERTION_TYPE), + (AUConstants.CLIENT_ASSERTION_KEY) : assertionString, + (AUConstants.CDR_ARRANGEMENT_ID) : cdrArrangementId] + + revocationResponse = AURestAsRequestBuilder.buildRequest() + .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) + .formParams(bodyContent) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CDR_ARRANGEMENT)) + .post("${AUConstants.CDR_ARRANGEMENT_ENDPOINT}") + + return revocationResponse + } + + /** + * Calculate Total Response Metrics for Defined Tier + * @param tier + * @return metrics value + */ + int[] calculateTierWiseTotalResponseTime() { + + String tier + int responseTime + int[] sumResponseTime = new int[5] + totalInvocationsPerf = 0 + totalInvocationsUnAuthAvg = 0 + totalInvocationsHighAvg = 0 + totalInvocationsLowAvg = 0 + totalInvocationsUnattendedAvg = 0 + totalInvocationsLargePayAvg = 0 + + //Get Start and End Time of the day + long startTimeOfDay = today.atTime(00, 00, 00).toEpochSecond(ZoneOffset.UTC) + long endTimeOfDay = today.atTime(23, 59, 59).toEpochSecond(ZoneOffset.UTC) + + // Execute SELECT query and get results as an array + def query = SqlQuery.retrieveRecordsWithinSpecifiedPeriod(startTimeOfDay, endTimeOfDay) + Object[][] results = DbConnection.executeSelectQuery(AUConstants.REPORTING_DBNAME, query) + totalInvocationsAvg = results.length + + // Process and check the response time within threshold + if (results != null) { + for (Object[] row : results) { + responseTime = row[0] + + tier = AUTestUtil.getPriorityTier(row[1], row[3]) + + if(!row[1].equals("/par")) { + + switch (tier) { + case AUConstants.UNAUTHENTICATED: + totalInvocationsUnAuthAvg = totalInvocationsUnAuthAvg + 1 + sumResponseTime[0] += responseTime + break + case AUConstants.HIGH_PRIORITY: + totalInvocationsHighAvg = totalInvocationsHighAvg + 1 + sumResponseTime[1] += responseTime + break + case AUConstants.LOW_PRIORITY: + totalInvocationsLowAvg = totalInvocationsLowAvg + 1 + sumResponseTime[2] += responseTime + break + case AUConstants.UNATTENDED: + totalInvocationsUnattendedAvg = totalInvocationsUnattendedAvg + 1 + sumResponseTime[3] += responseTime + break + case AUConstants.LARGE_PAYLOAD: + totalInvocationsLargePayAvg = totalInvocationsLargePayAvg + 1 + sumResponseTime[4] += responseTime + break + default: + throw new IllegalStateException("Unexpected value: " + tier + " for " + row[1]) + } + } + } + } + return sumResponseTime + } + + /** + * Calculate Total Resource Count based on the resource type + * @param tier + * @return metrics value + */ + int[] calculateTotalResourceCount() { + + String resourceType + int responseTime + int[] totalResourceCount = new int[2] + totalInvocationsPerf = 0 + + //Get Start and End Time of the Day + long startTimeOfDay = today.atTime(00, 00, 00).toEpochSecond(ZoneOffset.UTC) + long endTimeOfDay = today.atTime(23, 59, 59).toEpochSecond(ZoneOffset.UTC) + + // Execute SELECT query and get results as an array + def query = SqlQuery.retrieveRecordsWithinSpecifiedPeriod(startTimeOfDay, endTimeOfDay) + Object[][] results = DbConnection.executeSelectQuery(AUConstants.REPORTING_DBNAME, query) + + // Process and check the response time within threshold + if (results != null) { + for (Object[] row : results) { + responseTime = row[0] + + resourceType = AUTestUtil.getAuthenticatedResources(row[1]) + + if (!row[1].equals("/par")) { + + switch (resourceType) { + case AUConstants.UNAUTHENTICATED: + totalResourceCount[0]++ + break + case AUConstants.AUTHENTICATED: + totalResourceCount[1]++ + break + default: + throw new IllegalStateException("Unexpected value: " + resourceType + " for " + row[1]) + } + } + } + } + + return totalResourceCount + } + + AccessTokenResponse getUserAccessTokenResponseWithDifferentClientId(String assertionClientId = null, String bodyClientID ) { + try { + return AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, clientId) + } + catch (Exception e) { + log.error(e) + } + } + + /** + * Consent Amendment Deny + * @param scopes + * @param cdrArrangementId + * @param sharingDuration + * @param clientId + * @return auth code + */ + String doConsentAmendmentDenyFlow(List scopes, String cdrArrangementId, long sharingDuration, + String clientId = null) { + + if (clientId == null) { + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, sharingDuration, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI()) + .toURI().toString() + } else { + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, sharingDuration, + true, cdrArrangementId, clientId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), clientId) + .toURI().toString() + } + + //Consent Amendment Authorisation Flow + def automation = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Verify Account Selection Page + assert authWebDriver.isElementDisplayed(AUTestUtil.getAltSingleAccountXPath()) + authWebDriver.clickButtonXpath(AUTestUtil.getAltSingleAccountXPath()) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + + //Click Authorise Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_DENY_XPATH) + } + .execute() + + return automation.currentUrl.get() + } + + /** + * Consent Amendment Authorisation + * @param scopes + * @param cdrArrangementId + * @param sharingDuration + * @param clientId + * @return auth code + */ + String doBusinessConsentAmendmentAuthorisation(List scopes, String cdrArrangementId, long sharingDuration, + String clientId = null) { + + if (clientId == null) { + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, sharingDuration, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI()) + .toURI().toString() + } else { + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, sharingDuration, + true, cdrArrangementId, clientId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), clientId) + .toURI().toString() + } + + //Consent Amendment Authorisation Flow + def automation = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + + //Click Authorise Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + } + .execute() + + // Get Code From URL + return AUTestUtil.getCodeFromJwtResponse(automation.currentUrl.get()) + } } diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy index 147da1c63..7f692b710 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy @@ -38,7 +38,7 @@ class AUBasicAuthAutomationStep implements BrowserAutomationStep { private String authorizeUrl private AUConfigurationService auConfiguration -// private static final Log log = LogFactory.getLog(AUBasicAuthAutomationStep.class); + private static final Log log = LogFactory.getLog(AUBasicAuthAutomationStep.class); /** * Initialize Basic Auth Flow. @@ -70,7 +70,7 @@ class AUBasicAuthAutomationStep implements BrowserAutomationStep { driver.waitTimeRange(30) } } catch (NoSuchElementException e) { -// log.info("Second Factor Authentication Step is not required") + log.info("Second Factor Authentication Step is not required") } } } diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy index 5506e3ce5..261a3814f 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy @@ -55,6 +55,4 @@ class AUCCPortalWithdrawalAutomationStep implements BrowserAutomationStep{ driver.submitButtonXpath(AUPageObjects.AU_CCPORTAL_SIGNIN_XPATH) webDriver.manage().timeouts().implicitlyWait(100,TimeUnit.SECONDS); } - } - diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/configuration/AUConfigurationService.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/configuration/AUConfigurationService.groovy index 4644c1c69..0359bcbfd 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/configuration/AUConfigurationService.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/configuration/AUConfigurationService.groovy @@ -253,5 +253,47 @@ class AUConfigurationService extends OBConfigurationService { String getSharableAccountUrl() { return configuration.get(OBConfigConstants.SERVER + "." + AUConfigConstants.SHARABLE_ACCOUNT_URL) } + + /** + * Get DB Type + */ + String getDbType() { + return configuration.get(AUConfigConstants.DATA_BASE_CONFIGURATION + "." + AUConfigConstants.DB_TYPE) + } + + /** + * Get DB Server Host + */ + String getDbServerHost() { + return configuration.get(AUConfigConstants.DATA_BASE_CONFIGURATION + "." + AUConfigConstants.DB_SERVER_HOST) + } + + /** + * Get DB Username + */ + String getDbUsername() { + return configuration.get(AUConfigConstants.DATA_BASE_CONFIGURATION + "." + AUConfigConstants.DB_USERNAME) + } + + /** + * Get DB Password + */ + String getDbPassword() { + return configuration.get(AUConfigConstants.DATA_BASE_CONFIGURATION + "." + AUConfigConstants.DB_PASSWORD) + } + + /** + * Get DB Driver Class + */ + String getDbDriverClass() { + return configuration.get(AUConfigConstants.DATA_BASE_CONFIGURATION + "." + AUConfigConstants.DB_DRIVER_CLASS) + } + + /** + * Get Oracle DB SID + */ + String getOracleSid() { + return configuration.get(AUConfigConstants.DATA_BASE_CONFIGURATION + "." + AUConfigConstants.ORACLE_DB_SID) + } } diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConfigConstants.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConfigConstants.groovy index 2b13ce496..f7e9b5094 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConfigConstants.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConfigConstants.groovy @@ -77,5 +77,14 @@ class AUConfigConstants { //Sharable Account URL public static final String SHARABLE_ACCOUNT_URL = "SharableAccountsURL" + + //Database Configuration Details + public static final String DATA_BASE_CONFIGURATION = "DataBaseConfiguration" + public static final String DB_TYPE = "DBType" + public static final String DB_SERVER_HOST = "DBServerHost" + public static final String DB_USERNAME = "DBUsername" + public static final String DB_PASSWORD = "DBPassword" + public static final String DB_DRIVER_CLASS = "DBDriverClass" + public static final String ORACLE_DB_SID = "OracleDBSID" } diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConstants.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConstants.groovy index ac292f4e3..e34cd973f 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConstants.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConstants.groovy @@ -71,13 +71,14 @@ class AUConstants extends OBConstants { public static final String CODE = "code" public static final String ERROR_INVALID_SOFTWARE_PRODUCT = "Invalid Software Product" - public static final long DEFAULT_SHARING_DURATION = 60000 + public static final long DEFAULT_SHARING_DURATION = 172800 public static final long SINGLE_ACCESS_CONSENT = 0 public static final long ONE_YEAR_DURATION = 31536200 public static final long NEGATIVE_DURATION = -3000 public static final long AMENDED_SHARING_DURATION = 3000 - public static final long SHORT_SHARING_DURATION = 60 + public static final long SHORT_SHARING_DURATION = 84600 static final long NEGATIVE_SHARING_DURATION = -3000 + public static final long SHARING_DURATION_24H = 86400 public static final String BULK_ACCOUNT_PATH = CDS_PATH + "/banking/accounts" public static final String SINGLE_ACCOUNT_PATH = CDS_PATH + "/banking/accounts/" + accountID @@ -87,18 +88,17 @@ class AUConstants extends OBConstants { public static final String BULK_DIRECT_DEBITS_PATH = CDS_PATH + "/banking/accounts/direct-debits" public static final String BULK_SCHEDULE_PAYMENTS_PATH = CDS_PATH + "/banking/payments/scheduled" public static final String BULK_PAYEES = CDS_PATH + "/banking/payees" - public static final String BULK_CUSTOMER = CDS_COMMON_PATH + "/common/customer" - public static final String CUSTOMER_DETAILS = CDS_COMMON_PATH + "/common/customer/detail" - public static final String DISCOVERY_STATUS = CDS_COMMON_PATH + "/discovery/status" - public static final String DISCOVERY_OUTAGES = CDS_COMMON_PATH + "/discovery/outages" + public static final String BULK_CUSTOMER = CDS_PATH + "/common/customer" + public static final String CUSTOMER_DETAILS = CDS_PATH + "/common/customer/detail" + public static final String DISCOVERY_STATUS = CDS_PATH + "/discovery/status" + public static final String DISCOVERY_OUTAGES = CDS_PATH + "/discovery/outages" public static final String ACCOUNTS_CONSENT_PATH = "/au100/accounts-validation" public static final String CDR_ARRANGEMENT_ENDPOINT = "/arrangements/1.0.0/revoke" public static final String INTROSPECTION_ENDPOINT = "/oauth2/introspect" public static final String CONSENT_STATUS_ENDPOINT = "/api/openbanking/consent-mgt/uk300" - public static final String PUSHED_AUTHORISATION_BASE_PATH = auConfiguration.getServerAuthorisationServerURL() + - "/api/openbanking/push-authorization" - public static final String PAR_ENDPOINT = "/par" - public static final String REVOKE_PATH = "/oauth2/revoke" + public static final String PUSHED_AUTHORISATION_BASE_PATH = auConfiguration.getServerAuthorisationServerURL() + public static final String PAR_ENDPOINT = "/api/openbanking/push-authorization/par" + public static final String TOKEN_REVOKE_PATH = "/oauth2/revoke" public static final String STATUS_PATH = "/account-confirmation" public static final String CONSENT_STATUS_AU_ENDPOINT = "api/openbanking/account-type-mgt" public static final String UPDATE_BUSINESS_USER = "/account-type-management/business-stakeholders" @@ -180,10 +180,6 @@ class AUConstants extends OBConstants { public static final String LBL_NAME = "Name" public static final String LBL_OCCUPATION = "Occupation" - public static final String CONSENT_MANAGER_URL = auConfiguration.getServerAuthorisationServerURL() + "/consentmgt" - public static final String OAUTH2_INTROSPECT_URL = auConfiguration.getServerAuthorisationServerURL() + "/oauth2/introspect" - public static final String CCPORTAL_URL = auConfiguration.getServerAuthorisationServerURL() + "/ccportal" - public static final String ERROR = "error"; public static final String ERROR_DESCRIPTION = "error_description"; public static final String ERROR_DETAIL = "errors[0].detail" @@ -317,6 +313,11 @@ class AUConstants extends OBConstants { public static final String UNSUPPORTED_RESPONSE_MODE = "Unsupported response_mode value. Only jwt response mode is allowed." public static final String ERROR_CODE_INVALID_PAGE = "urn:au-cds:error:cds-all:Field/InvalidPage" public static final String INVALID_PAGE = "Invalid Page" + public static final String INVALID_SIGNING_ALG = "Invalid signing algorithm sent" + public static final String INVALID_AUDIENCE_ERROR = "Invalid audience provided" + public static final String ERROR_REDIRECT_URL_WITH_DIFF_HOSTNAMES = "Redirect URIs do not contain the same hostname" + public static final String ERROR_EMPTY_REDIRECT_URL_IN_SSA = "Redirect URIs can not be null or empty in SSA" + public static final String ERROR_WITHOUT_IDTOKEN_SINGED_ALG = "Required parameter idTokenSignedResponseAlg cannot be null" /** * Mock Register Constants @@ -394,7 +395,7 @@ class AUConstants extends OBConstants { public static final String ALL = "ALL" public static final String PAGE_SIZE = "page-size" public static final String UPDATED_SINCE = "updated-since" - public static final String BRAND = "BRAND" + public static final String BRAND = "brand" public static final String EFFECTIVE = "EFFECTIVE" public static final String PERIOD = "period" public static final String HISTORIC = "HISTORIC" @@ -408,7 +409,8 @@ class AUConstants extends OBConstants { public static final String ERROR_NOT_ALLOWED_TO_ACCESS = "The access token does not allow you to access the requested resource" public static final String PARAM_PROFILE_NAME = "profileName" public static final String USER_DENIED_THE_CONSENT = "User denied the consent" - public static final String USER_SKIP_THE_CONSENT_FLOW = "User skip the consent flow" + public static final String USER_SKIP_THE_CONSENT_FLOW = "User skipped the consent flow" + public static final String CANCEL_ERROR_IN_ACCOUNTS_PAGE = "User skip the consent flow" public static final String ACTIVE = "active" public static final String INACTIVE = "inactive" @@ -468,11 +470,11 @@ class AUConstants extends OBConstants { public static final int X_V_HEADER_TRANSACTIONS = 1 public static final int X_V_HEADER_TRANSACTION = 1 public static final int X_V_HEADER_DIRECT_DEBITS = 1 - public static final int X_V_HEADER_PAYMENT_SCHEDULED = 1 + public static final int X_V_HEADER_PAYMENT_SCHEDULED = 2 public static final int X_V_HEADER_PAYEES = 2 public static final int X_V_HEADER_PRODUCTS = 3 public static final int X_V_HEADER_PRODUCT = 4 - public static final int X_V_HEADER_METRICS = 3 + public static final int X_V_HEADER_METRICS = 5 public static final int X_V_HEADER_METADATA = 1 public static final int X_V_HEADER_CUSTOMER = 1 public static final int X_V_HEADER_CUSTOMER_DETAIL = 2 @@ -485,7 +487,7 @@ class AUConstants extends OBConstants { public static final String ERROR_UNSUPPORTED_RESPONSE = "Unsupported response_type value. Only code response type is allowed." public static final String DCR_CLAIM_LEGAL_ENTITY_ID = "legal_entity_id" public static final String DCR_CLAIM_LEGAL_ENTITY_NAME = "legal_entity_name" - public static final String SAMPLE_LEGAL_ENTITY_ID = "344F0E809-BDBE-4F8E-BD30-5E6C3CB78D7B" + public static final String SAMPLE_LEGAL_ENTITY_ID = "TPP7" public static final String SAMPLE_LEGAL_ENTITY_NAME = "Mock Company Pty Ltd." public static final String AlternateAccountId = "30080098763501" public static final CodeVerifier CODE_VERIFIER = new CodeVerifier() @@ -512,5 +514,97 @@ class AUConstants extends OBConstants { public static final String ADR_STATUS_NOT_ACTIVE = "ADR Status Is Not Active" public static final String ERROR_CODE_ADR_STATUS_NOT_ACTIVE = "urn:au-cds:error:cds-banking:Authorisation/AdrStatusNotActive" public static final String CONFIG_FILE_NAME = "TestConfiguration.xml" + + static final String PERIOD_CURRENT = "CURRENT" + static final String PERIOD_ALL = "ALL" + static final String PERIOD_HISTORIC = "HISTORIC" + static final String ACTIVE_AUTHORIZATION_INDIVIDUAL = "data.authorisations.activeAuthorisationCount.individual" + static final String ACTIVE_AUTHORIZATION_NONINDIVIDUAL = "data.authorisations.activeAuthorisationCount.nonIndividual" + static final String NEWAUTH_CURRENTDAY_ONGOING_INDIVIDUAL = + "data.authorisations.newAuthorisationCount.currentDay.ongoing.individual" + static final String NEWAUTH_CURRENTDAY_ONGOING_NONINDIVIDUAL = + "data.authorisations.newAuthorisationCount.currentDay.ongoing.nonIndividual" + static final String NEWAUTH_CURRENTDAY_ONCEOFF_INDIVIDUAL = + "data.authorisations.newAuthorisationCount.currentDay.onceOff.individual" + static final String NEWAUTH_CURRENTDAY_ONCEOFF_NONINDIVIDUAL = + "data.authorisations.newAuthorisationCount.currentDay.onceOff.nonIndividual" + static final String REVOKED_CURRENTDAY_INDIVIDUAL = + "data.authorisations.revokedAuthorisationCount.currentDay.individual" + static final String REVOKED_CURRENTDAY_NONINDIVIDUAL = + "data.authorisations.revokedAuthorisationCount.currentDay.nonIndividual" + static final String AMENDED_CURRENTDAY_INDIVIDUAL = + "data.authorisations.amendedAuthorisationCount.currentDay.individual" + static final String AMENDED_CURRENTDAY_NONINDIVIDUAL = + "data.authorisations.amendedAuthorisationCount.currentDay.nonIndividual" + static final String EXPIRED_CURRENTDAY_INDIVIDUAL = + "data.authorisations.expiredAuthorisationCount.currentDay.individual" + static final String EXPIRED_CURRENTDAY_NONINDIVIDUAL = + "data.authorisations.expiredAuthorisationCount.currentDay.nonIndividual" + static final String ABANDON_PREIDENTIFICATION_CURRENTDAY = + "data.authorisations.abandonmentsByStage.preIdentification.currentDay" + static final String ABANDON_PREAUTHENTICATE_CURRENTDAY = + "data.authorisations.abandonmentsByStage.preAuthentication.currentDay" + static final String ABANDON_PREACCSELECT_CURRENTDAY = + "data.authorisations.abandonmentsByStage.preAccountSelection.currentDay" + static final String ABANDON_PREAUTH_CURRENTDAY = + "data.authorisations.abandonmentsByStage.preAuthorisation.currentDay" + static final String ABANDON_REJECTED_CURRENTDAY = + "data.authorisations.abandonmentsByStage.rejected.currentDay" + static final String ABANDON_FAILEDTOKEN_CURRENTDAY = + "data.authorisations.abandonmentsByStage.failedTokenExchange.currentDay" + static final String ABANDON_CURRENTDAY = + "data.authorisations.abandonedConsentFlowCount.currentDay" + static final String PERFORMANCE_CURRENTDAY ="data.performance.currentDay" + static final String PERFORMANCE_HIGH_CURRENTDAY ="data.performance.highPriority.currentDay" + static final String PERFORMANCE_LOW_CURRENTDAY ="data.performance.lowPriority.currentDay" + static final String PERFORMANCE_UNATTENDED_CURRENTDAY ="data.performance.unattended.currentDay" + static final String PERFORMANCE_UNAUTH_CURRENTDAY ="data.performance.unauthenticated.currentDay" + static final String PERFORMANCE_LARGE_PAYLOAD_CURRENTDAY ="data.performance.largePayload.currentDay" + static final String PERFORMANCE_AGGREGATE_CURRENTDAY ="data.performance.aggregate.currentDay" + static final String AVG_RESPONSE_HIGH_CURRENTDAY ="data.averageResponse.highPriority.currentDay" + static final String AVG_RESPONSE_LOW_CURRENTDAY ="data.averageResponse.lowPriority.currentDay" + static final String AVG_RESPONSE_UNATTENDED_CURRENTDAY ="data.averageResponse.unattended.currentDay" + static final String AVG_RESPONSE_UNAUTH_CURRENTDAY ="data.averageResponse.unauthenticated.currentDay" + static final String AVG_RESPONSE_LARGE_PAYLOAD_CURRENTDAY ="data.averageResponse.largePayload.currentDay" + static final String AVGTPS_AUTHENTICATED_CURRENTDAY ="data.averageTps.authenticated.currentDay" + static final String AVGTPS_UNAUTHENTICATED_CURRENTDAY ="data.averageTps.unauthenticated.currentDay" + static final String AVGTPS_AGGREGATE_CURRENTDAY ="data.averageTps.aggregate.currentDay" + static final String INVOCATION_UNAUTHENTICATED_CURRENTDAY = "data.invocations.unauthenticated.currentDay" + static final String INVOCATION_HIGHPRIORITY_CURRENTDAY = "data.invocations.highPriority.currentDay" + static final String INVOCATION_LOWPRIORITY_CURRENTDAY = "data.invocations.lowPriority.currentDay" + static final String INVOCATION_UNATTENDED_CURRENTDAY = "data.invocations.unattended.currentDay" + static final String INVOCATION_LARGEPAYLOAD_CURRENTDAY = "data.invocations.largePayload.currentDay" + static final String INCORRECT_ACCESS_TOKEN = "95d4d70e-0319-3fea-9532-e199fe72d489" + + static final String ERROR_UNAUTH_CURRENTDAY = "data.errors.unauthenticated.currentDay" + static final String ERROR_AUTH_CURRENTDAY = "data.errors.authenticated.currentDay" + static final String ERROR_AGGREGATE_CURRENTDAY = "data.errors.aggregate.currentDay" + static final String DATA_CUSTOMER_COUNT = "data.customerCount" + static final String DATA_RECIPIENT_COUNT = "data.recipientCount" + static final String DATA_SESSION_COUNT_CURRENTDAY = "data.sessionCount.currentDay" + + static final String CUSTOMER_PRESENT = "customer-present" + static final ABANDON_WAIT_TIME = 78000 + static final AUTH_CODE_EXPIRATION_TIME = 110001 + public static final String CODE_EXPIRE_ERROR_MSG = "Expired or Revoked authorization code received from token request" + public static final String CALLBACK_MISMATCH = "Callback url mismatch" + public static final String LOCALHOST = "localhost" + + public static String REPORTING_DBNAME = "openbank_ob_reporting_statsdb" + public static String UNAUTHENTICATED = "Unauthenticated" + public static String HIGH_PRIORITY = "High Priority" + public static String LOW_PRIORITY = "Low Priority" + public static String UNATTENDED = "Unattended" + public static String LARGE_PAYLOAD = "Large Payload" + public static String REGISTER_PATH = "/register/" + public static String AUTHENTICATED = "authenticated" + public static String AGGREGATE = "aggregate" + static final String AVAILABILITY_UNAUTH_CURRENTMONTH = "data.availability.unauthenticated.currentMonth" + static final String AVAILABILITY_AUTH_CURRENTMONTH = "data.availability.authenticated.currentMonth" + static final String AVAILABILITY_AGG_CURRENTMONTH = "data.availability.aggregate.currentMonth" + + public static final String ERROR_CODE_INVALID_ARRANGEMENT = "urn:au-cds:error:cds-all:Authorisation/InvalidArrangement" + public static final String INVALID_CONSENT_ARRANGEMENT = "Invalid Arrangement ID" + public static TOKEN_ENDPOINT = "/oauth2/token" } diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUPayloads.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUPayloads.groovy index 3622fb7c3..f523bb1cc 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUPayloads.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUPayloads.groovy @@ -245,7 +245,7 @@ class AUPayloads { */ static String getSecondaryUserInstructionPermissionPayload(String secondaryAccountId, String secondaryUserId, String secondaryAccountInstructionStatus = "active", - boolean otherAccountsAvailability = false) { + boolean otherAccountsAvailability = true) { return """ { "data": [ @@ -290,12 +290,6 @@ class AUPayloads { "secondaryUserID": "${secondaryUserId}", "legalEntitySharingStatus": "${sharingStatus}", "legalEntityID": "${legalEntityId}" - }, - { - "accountID": "${accountId2}", - "secondaryUserID": "${secondaryUserId2}", - "legalEntitySharingStatus": "${sharingStatus2}", - "legalEntityID": "${legalEntityId2}" } ] } diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy index 5c1f9f69b..e21dd879b 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy @@ -160,7 +160,6 @@ class AUAuthorisationBuilder { String assertionString = generator.getClientAssertionJwt(clientId) def bodyContent = [ - (AUConstants.CLIENT_ID_KEY) : (clientId), (AUConstants.CLIENT_ASSERTION_TYPE_KEY): (AUConstants.CLIENT_ASSERTION_TYPE), (AUConstants.CLIENT_ASSERTION_KEY) : assertionString, ] @@ -304,7 +303,7 @@ class AUAuthorisationBuilder { private URI getEndpoint() { if (endpoint == null) { - endpoint = new URI("${auConfiguration.getServerAuthorisationServerURL()}/oauth2/authorize/") + endpoint = new URI("${auConfiguration.getServerAuthorisationServerURL()}/oauth2/authorize") } return endpoint } @@ -546,8 +545,63 @@ class AUAuthorisationBuilder { generator.setSigningAlgorithm(algorithm) } + String signedRequest = generator.getSignedAuthRequestObject(requestObjectClaims).serialize() + if (isStateParamRequired) { + parResponse = AURestAsRequestBuilder.buildRequest() + .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) + .formParams(bodyContent) + .formParams(AUConstants.REQUEST_KEY, signedRequest) + .baseUri(AUConstants.PUSHED_AUTHORISATION_BASE_PATH) + .post(AUConstants.PAR_ENDPOINT) + } else { + + parResponse = AURestAsRequestBuilder.buildRequest() + .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) + .formParams(bodyContent) + .formParams(AUConstants.REQUEST_KEY, signedRequest) + .baseUri(AUConstants.PUSHED_AUTHORISATION_BASE_PATH) + .post(AUConstants.PAR_ENDPOINT) + } + + return parResponse + } + + /** + * AU Authorisation Builder for Pushed Authorisation Flow without Client Id in the Request Body. + * @param headerString + * @param scopes + * @param sharingDuration + * @param sendSharingDuration + * @param cdrArrangementId + * @param clientId + * @return + */ + Response doPushAuthorisationRequestWithoutClientId(List scopes, long sharingDuration, + boolean sendSharingDuration, String cdrArrangementId, + String clientId = getClientID().getValue(), + String redirectUrl = getRedirectURI().toString(), + String responseType = getResponseType().toString(), + boolean isStateParamRequired = true, + String responseMode = ResponseMode.JWT, + String state = getState().toString()) { + + Response parResponse + + String assertionString = generator.getClientAssertionJwt(clientId) + + def bodyContent = [ + (AUConstants.CLIENT_ASSERTION_TYPE_KEY): (AUConstants.CLIENT_ASSERTION_TYPE), + (AUConstants.CLIENT_ASSERTION_KEY) : assertionString, + ] + + String requestObjectClaims + + if(isStateParamRequired) { + requestObjectClaims = generator.getRequestObjectClaim(scopes, sharingDuration, sendSharingDuration, + cdrArrangementId, redirectUrl, clientId, responseType, true, state, responseMode) + parResponse = AURestAsRequestBuilder.buildRequest() .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) .formParams(bodyContent) @@ -556,6 +610,70 @@ class AUAuthorisationBuilder { .post(AUConstants.PAR_ENDPOINT) } else { + requestObjectClaims = generator.getRequestObjectClaim(scopes, sharingDuration, sendSharingDuration, + cdrArrangementId, redirectUrl, clientId, responseType, false, state, responseMode) + + parResponse = AURestAsRequestBuilder.buildRequest() + .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) + .formParams(bodyContent) + .formParams(AUConstants.REQUEST_KEY, generator.getSignedAuthRequestObject(requestObjectClaims).serialize()) + .baseUri(AUConstants.PUSHED_AUTHORISATION_BASE_PATH) + .post(AUConstants.PAR_ENDPOINT) + } + + return parResponse + } + + /** + * AU Authorisation Builder for Pushed Authorisation Flow with different clientIds in client assertion and request body + * @param headerString + * @param scopes + * @param sharingDuration + * @param sendSharingDuration + * @param cdrArrangementId + * @param clientIdInAssertion + * @param clientIdInRequest + * @return + */ + Response doPushAuthorisationRequestWithDifferentClientIds(List scopes, long sharingDuration, + boolean sendSharingDuration, String cdrArrangementId, + String clientIdInAssertion = getClientID().getValue(), + String clientIdInRequest = getClientID().getValue(), + String redirectUrl = getRedirectURI().toString(), + String responseType = getResponseType().toString(), + boolean isStateParamRequired = true, + String responseMode = ResponseMode.JWT, + String state = getState().toString()) { + + Response parResponse + + String assertionString = generator.getClientAssertionJwt(clientIdInAssertion) + + def bodyContent = [ + (AUConstants.CLIENT_ID_KEY) : (clientIdInRequest), + (AUConstants.CLIENT_ASSERTION_TYPE_KEY): (AUConstants.CLIENT_ASSERTION_TYPE), + (AUConstants.CLIENT_ASSERTION_KEY) : assertionString, + ] + + String requestObjectClaims + + if(isStateParamRequired) { + requestObjectClaims = generator.getRequestObjectClaim(scopes, sharingDuration, sendSharingDuration, + cdrArrangementId, redirectUrl, getClientID().getValue(), responseType, true, + state, responseMode) + + parResponse = AURestAsRequestBuilder.buildRequest() + .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) + .formParams(bodyContent) + .formParams(AUConstants.REQUEST_KEY, generator.getSignedAuthRequestObject(requestObjectClaims).serialize()) + .baseUri(AUConstants.PUSHED_AUTHORISATION_BASE_PATH) + .post(AUConstants.PAR_ENDPOINT) + } else { + + requestObjectClaims = generator.getRequestObjectClaim(scopes, sharingDuration, sendSharingDuration, + cdrArrangementId, redirectUrl, getClientID().getValue(), responseType, false, + state, responseMode) + parResponse = AURestAsRequestBuilder.buildRequest() .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) .formParams(bodyContent) diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy index d5b02dd24..8fded29b6 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy @@ -161,6 +161,14 @@ class AUJWTGenerator { return payload } + String getClientAssertionJwtWithoutIAT(String clientId=null) { + JSONObject clientAssertion = new JSONRequestGenerator().addIssuer(clientId) + .addSubject(clientId).addAudience().addExpireDate().addJti().getJsonObject() + + String payload = getSignedRequestObject(clientAssertion.toString()) + return payload + } + /** * Get Client Assertion with customized Issuer and Audience * @param issuer Issuer @@ -249,7 +257,7 @@ class AUJWTGenerator { * @return */ JWT getSignedAuthRequestObjectForStringSharingDuration(String scopeString, String sharingDuration, - String cdrArrangementId, String redirect_uri, String clientId, String responseType, + String cdrArrangementId, String redirect_uri, String clientId, String responseType, String responseMode, CodeChallengeMethod codeChallengeMethod) { //Generate Code Challenge @@ -331,6 +339,7 @@ class AUJWTGenerator { } }) JSONObject authTimeString = new JSONObject().put("essential", true) + JSONObject maxAgeString = new JSONObject().put("essential", true).put("max_age", 86400) JSONObject userInfoString = new JSONObject().put("name", null).put("given_name", null).put("family_name", null).put("updated_at", Instant.now()) JSONObject claimsString = new JSONObject().put("id_token", new JSONObject().put("acr", acr).put("auth_time", authTimeString)) if (sendSharingDuration) { @@ -352,7 +361,7 @@ class AUJWTGenerator { .addScope(scopeString) .addState(state) .addNonce() - .addCustomValue("max_age", 86400) + .addCustomValue("max_age", maxAgeString) .addCustomValue("nbf", notBefore.getEpochSecond().toLong()) .addCustomJson("claims", claimsString) .addCustomValue("response_mode", responseMode) @@ -370,7 +379,7 @@ class AUJWTGenerator { .addRedirectURI(redirect_uri) .addScope(scopeString) .addNonce() - .addCustomValue("max_age", 86400) + .addCustomValue("max_age", maxAgeString) .addCustomValue("nbf", notBefore.getEpochSecond().toLong()) .addCustomJson("claims", claimsString) .addCustomValue("response_mode", responseMode) @@ -457,11 +466,11 @@ class AUJWTGenerator { * @return claimSet */ String getRequestObjectClaimWithMaxAge(List scopes, long sharingDuration, Boolean sendSharingDuration, - String cdrArrangementId, String redirect_uri, String clientId, String responseType, - boolean isStateRequired = true, String state, String responseMode = ResponseMode.JWT, - Instant expiryDate = Instant.now().plus(1, ChronoUnit.HOURS), - Instant notBefore = Instant.now(), - CodeChallengeMethod codeChallengeMethod = CodeChallengeMethod.S256) { + String cdrArrangementId, String redirect_uri, String clientId, String responseType, + boolean isStateRequired = true, String state, String responseMode = ResponseMode.JWT, + Instant expiryDate = Instant.now().plus(1, ChronoUnit.HOURS), + Instant notBefore = Instant.now(), + CodeChallengeMethod codeChallengeMethod = CodeChallengeMethod.S256) { String claims String scopeString = "openid ${String.join(" ", scopes.collect({ it.scopeString }))}" diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy index 7d076330a..d97e540f3 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy @@ -285,6 +285,56 @@ class AURegistrationRequestBuilder extends OBRegistrationRequestBuilder { .addCustomValue("adr_name", "ADR").getClaimsJsonAsString() } + String getRegularClaimsWithInvalidTokenAuthSignAlg() { + return regularClaims.addIssuer(getSoftwareID()).addSoftwareStatement(getSSA()) + .removeKeyValue(AUConstants.RESPONSE_TYPES_KEY).addResponseType(ResponseType.CODE.toString()) + .addTokenEndpointAuthSignAlg("ES512") + .addIDTokenEncResponseAlg().addIDTokenEncResponseEnc() + .getClaimsJsonAsString() + } + + String getClaimsWithInvalidAud() { + return regularClaims.addIssuer(getSoftwareID()).addSoftwareStatement(getSSA()).addIDTokenEncResponseAlg() + .addIDTokenEncResponseEnc().removeKeyValue(AUConstants.RESPONSE_TYPES_KEY).addResponseType(ResponseType.CODE.toString()) + .addAudience("https://obiam:9446/client-registration").getClaimsJsonAsString() + } + + String getRegularClaimsWithoutApplicationType() { + return regularClaims.addIssuer(getSoftwareID()).addSoftwareStatement(getSSA()) + .removeKeyValue(AUConstants.RESPONSE_TYPES_KEY).addResponseType(ResponseType.CODE.toString()) + .addIDTokenEncResponseAlg().addIDTokenEncResponseEnc() + .removeKeyValue(AUConstants.APPLICATION_TYPE_KEY).getClaimsJsonAsString() + } + + String getRegularClaimsWithInvalidRequestObjectSigningAlg() { + return regularClaims.addIssuer(getSoftwareID()).addSoftwareStatement(getSSA()) + .removeKeyValue(AUConstants.RESPONSE_TYPES_KEY).addResponseType(ResponseType.CODE.toString()) + .addIDTokenEncResponseAlg().addIDTokenEncResponseEnc() + .addRequestObjectSigningAlgo("ES512").getClaimsJsonAsString() + } + + String getRegularClaimsWithInvalidIdTokenSigningResponseAlg() { + return regularClaims.addIssuer(getSoftwareID()).addSoftwareStatement(getSSA()) + .removeKeyValue(AUConstants.RESPONSE_TYPES_KEY).addResponseType(ResponseType.CODE.toString()) + .addIDTokenEncResponseAlg().addIDTokenEncResponseEnc() + .addIDTokenSignedResponseAlg("ES512").getClaimsJsonAsString() + } + + String getRegularClaimsWithoutIdTokenSigningResponseAlg() { + return regularClaims.addIssuer(getSoftwareID()).addSoftwareStatement(getSSA()) + .removeKeyValue(AUConstants.RESPONSE_TYPES_KEY).addResponseType(ResponseType.CODE.toString()) + .addIDTokenEncResponseAlg().addIDTokenEncResponseEnc() + .removeKeyValue(AUConstants.ID_TOKEN_SIGNED_RESPONSE_ALG_KEY).getClaimsJsonAsString() + } + + String getExpiredRequestClaims(long date) { + return regularClaims.addIssuer(getSoftwareID()).addSoftwareStatement(getSSA()) + .removeKeyValue(AUConstants.RESPONSE_TYPES_KEY).addResponseType(ResponseType.CODE.toString()) + .addIDTokenEncResponseAlg().addIDTokenEncResponseEnc() + .addExpireDate(date) + .getClaimsJsonAsString() + } + /** * Provide regular payload with Hybrid Response Type for DCR * @return diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy index 93428f65e..3d4d0dbbc 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy @@ -59,6 +59,7 @@ class AURequestBuilder { private static Logger log = LogManager.getLogger(AURequestBuilder.class.getName()) private static AUConfigurationService auConfiguration = new AUConfigurationService() + static AUAuthorisationBuilder auAuthorisationBuilder = new AUAuthorisationBuilder() /** * Method for get application access token @@ -109,6 +110,7 @@ class AURequestBuilder { return AURestAsRequestBuilder.buildRequest() .header(AUConstants.X_V_HEADER, xv_header) + .header(AUConstants.X_FAPI_AUTH_DATE, AUConstants.DATE) .header(AUConstants.AUTHORIZATION_HEADER_KEY, "${AUConstants.AUTHORIZATION_BEARER_TAG}${userAccessToken}") } @@ -133,6 +135,7 @@ class AURequestBuilder { return AURestAsRequestBuilder.buildRequest() .header(AUConstants.X_V_HEADER, xv_header) .header(AUConstants.AUTHORIZATION_HEADER_KEY, "${AUConstants.AUTHORIZATION_BEARER_TAG}${userAccessToken}") + .header(AUConstants.X_FAPI_CUSTOMER_IP_ADDRESS , AUConstants.IP) .header(AUConstants.X_FAPI_AUTH_DATE, authDate) .header(AUConstants.X_CDS_CLIENT_HEADERS , clientHeader) } @@ -198,7 +201,6 @@ class AURequestBuilder { } - /** * Get User Access Token From Authorization Code and optional scopes list. * @@ -252,10 +254,11 @@ class AURequestBuilder { String client_id = auConfiguration.getAppInfoClientID(), Boolean clientAuthRequired = true, Boolean mtlsRequired = true, - String signingAlg = auConfiguration.getCommonSigningAlgorithm()) { + String signingAlg = auConfiguration.getCommonSigningAlgorithm(), + CodeVerifier verifier = auAuthorisationBuilder.getCodeVerifier()) { AuthorizationCode grant = new AuthorizationCode(code) URI callbackUri = new URI(redirectUrl) - AuthorizationGrant codeGrant = new AuthorizationCodeGrant(grant, callbackUri) + AuthorizationGrant codeGrant = new AuthorizationCodeGrant(grant, callbackUri, verifier) URI tokenEndpoint = new URI("${auConfiguration.getServerAuthorisationServerURL()}${AUConstants.TOKEN_ENDPOINT}") @@ -471,8 +474,101 @@ class AURequestBuilder { def response = AURestAsRequestBuilder.buildRequest() .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) .formParams(bodyContent) - .baseUri(auConfiguration.getServerBaseURL()) + .baseUri(auConfiguration.getServerAuthorisationServerURL()) .post("${AUConstants.CDR_ARRANGEMENT_ENDPOINT}") return response } + + /** + * Build Introspection Request for Revoke Access Token without Client Id param in request body + * + * @param token access token + * @return Introspection Request Specification + */ + static RequestSpecification buildRevokeTokenWithoutClientIdParam(String token, String clientId) { + + String assertionString = new SignedObject().getJwt(clientId) + + def bodyContent = [ + (AUConstants.CLIENT_ASSERTION_TYPE_KEY): (AUConstants.CLIENT_ASSERTION_TYPE), + (AUConstants.CLIENT_ASSERTION_KEY) : assertionString] + + + return AURestAsRequestBuilder.buildRequest() + .contentType(ContentType.URLENC) + .formParams(bodyContent) + .formParams("token", token) + .formParams("token_type_hint", "access_token") + .baseUri(auConfiguration.getServerAuthorisationServerURL()) + } + + /** + * Build Introspection Request without ClientId Param in request body + * + * @param token access token + * @return Introspection Request Specification + */ + static RequestSpecification buildIntrospectionWithoutClientIdParam(String token, String clientId, Integer tpp = null) { + + String assertionString = new SignedObject().getJwt(clientId) + + def bodyContent = [ + (AUConstants.CLIENT_ASSERTION_TYPE_KEY): (AUConstants.CLIENT_ASSERTION_TYPE), + (AUConstants.CLIENT_ASSERTION_KEY) : assertionString] + + return AURestAsRequestBuilder.buildRequest() + .contentType(ContentType.URLENC) + .header(AUConstants.AUTHORIZATION_HEADER_KEY, "Basic ${AUTestUtil.getBasicAuthorizationHeader(tpp)}") + .formParams(bodyContent) + .formParams("token", token) + .baseUri(auConfiguration.getServerAuthorisationServerURL()) + } + + /** + * Get User Access Token From Authorization Code. + * @param code authorisation code + * @param codeVerifier code verifier + * @param clientId client id + * @param redirectUrl application redirect url + * @return user access token + */ + static TokenResponse getUserTokenWithClientIdInReqBody(String code, CodeVerifier codeVerifier, + String clientIdInAssertion = auConfiguration.getAppInfoClientID(), + String clientIdInReqBody = auConfiguration.getAppInfoClientID(), + String redirectUrl = auConfiguration.getAppInfoRedirectURL() + ) { + + AuthorizationCode grant = new AuthorizationCode(code) + URI callbackUri = new URI(redirectUrl) + AuthorizationGrant codeGrant = new AuthorizationCodeGrant(grant, callbackUri, codeVerifier) + + String assertionString = new SignedObject().getJwt(clientIdInAssertion) + + ClientAuthentication clientAuth = new PrivateKeyJWT(SignedJWT.parse(assertionString)) + + URI tokenEndpoint = new URI("${auConfiguration.getServerAuthorisationServerURL()}${AUConstants.TOKEN_ENDPOINT}") + + TokenRequest request = new TokenRequest(tokenEndpoint, clientAuth, codeGrant) + + HTTPRequest httpRequest = request.toHTTPRequest() + + ClientID clientIdReqBody = new ClientID(clientIdInReqBody) + + // Manually add the client_id to the HTTPRequest query parameters + String originalQuery = httpRequest.getQuery() + String newQuery = originalQuery + "&client_id=" + clientIdReqBody.getValue() + httpRequest.setQuery(newQuery) + + def response = AURestAsRequestBuilder.buildRequest() + .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) + .body(httpRequest.query) + .post(tokenEndpoint) + + HTTPResponse httpResponse = new HTTPResponse(response.statusCode()) + httpResponse.setContentType(response.contentType()) + httpResponse.setContent(response.getBody().print()) + + return TokenResponse.parse(httpResponse) + + } } diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUTestUtil.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUTestUtil.groovy index a1a6d3689..e75d56dee 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUTestUtil.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUTestUtil.groovy @@ -386,7 +386,7 @@ class AUTestUtil extends OBTestUtil { } return legalEntityIds } - + /** * Read Attributes from HTML Document * @param htmlDocumentBody @@ -521,5 +521,113 @@ class AUTestUtil extends OBTestUtil { writeXMLContent(configFilePath, "Application", "ClientID", clientId, auConfiguration.getTppNumber()) } + /** + * Get the Hostname from Configuration + * @return hostname + */ + static String getHostname() { + + try { + URL url = new URL(auConfiguration.getServerBaseURL()) + return url.getHost() + + } catch (MalformedURLException e) { + System.err.println("Invalid URL: " + e.getMessage()) + } + } + + /** + * Parse Key Value Pair from string array. + * @param keyValuePairsString + * @return keyValuePairs + */ + static List parseKeyValuePairs(String keyValuePairsString) { + + List keyValuePairs = new ArrayList<>() + + // Remove leading and trailing brackets, then split by comma + String[] pairs = keyValuePairsString.substring(1, keyValuePairsString.length() - 1).split(", ") + + for (String pair : pairs) { + keyValuePairs.add(pair.trim()) + } + return keyValuePairs + } + + /** + * Get the tier of a particular request. + * @param resourcePath + * @param customerStatus + * @return tier + */ + static String getPriorityTier(String resourcePath, String customerStatus){ + + def highPriorityResources = ["/discovery/status", "/discovery/outages", + "/register", + "/register/{ClientId}", "/", "/token", "/authorize", "/revoke", "/userinfo", + "/introspect", "/jwks", "/.well-known/openid-configuration"] + def commonResources = ["/common/customer", "/common/customer/detail"] + def accountsResources = ["/banking/accounts"] + + def lowPriorityResources = ["/banking/accounts/{accountId}", "/banking/accounts/{accountId}/balance", + "/banking/accounts/balances", "/banking/accounts/{accountId}/transactions", + "/banking/accounts/{accountId}/transactions/{transactionId}", "/banking/payees", + "/banking/payees/{payeeId}", "/banking/accounts/{accountId}/direct-debits", + "/banking/accounts/{accountId}/payments/scheduled", "/banking/payments/scheduled"] + + def unattendedList = [ "/register/metadata", "/metrics"] + def largePayloadList = ["/banking/accounts/direct-debits"] + def unauthenticatedList = ["/banking/products", "/banking/products/{productId}"] + + if (highPriorityResources.contains(resourcePath) || + (customerStatus.equalsIgnoreCase(AUConstants.CUSTOMER_PRESENT) && commonResources.contains(resourcePath)) || + (customerStatus.equalsIgnoreCase(AUConstants.CUSTOMER_PRESENT) && accountsResources.contains(resourcePath))) { + return AUConstants.HIGH_PRIORITY + + } else if(lowPriorityResources.contains(resourcePath) && + customerStatus.equalsIgnoreCase(AUConstants.CUSTOMER_PRESENT)) { + return AUConstants.LOW_PRIORITY + + } else if((unattendedList.contains(resourcePath)) || + (customerStatus.equalsIgnoreCase(AUConstants.UNATTENDED) && accountsResources.contains(resourcePath)) || + (customerStatus.equalsIgnoreCase(AUConstants.UNATTENDED) && commonResources.contains(resourcePath)) || + (customerStatus.equalsIgnoreCase(AUConstants.UNATTENDED) && lowPriorityResources.contains(resourcePath))) { + return AUConstants.UNATTENDED + + } else if (largePayloadList.contains(resourcePath)) { + return AUConstants.LARGE_PAYLOAD + + } else if (unauthenticatedList.contains(resourcePath)) { + return AUConstants.UNAUTHENTICATED + } + } + + /** + * Get Authenticated and Unauthenticated Resources + * @param resourcePath + * @return relevant tier for resource + */ + static String getAuthenticatedResources(String resourcePath){ + + def authenticatedList = ["/register", "/register/{ClientId}", "/", "/token", "/authorize", "/revoke", + "/userinfo", "/introspect", "/jwks", "/common/customer", "/common/customer/detail", + "/banking/accounts", "/banking/accounts/{accountId}", "/banking/accounts/{accountId}/balance", + "/banking/accounts/balances", "/banking/accounts/{accountId}/transactions", + "/banking/accounts/{accountId}/transactions/{transactionId}", "/banking/payees", + "/banking/payees/{payeeId}", "/banking/accounts/{accountId}/direct-debits", + "/banking/accounts/{accountId}/payments/scheduled", "/banking/payments/scheduled", + "/register/metadata", "/metrics", "/banking/accounts/direct-debits"] + + def unauthenticatedList = ["/banking/products", "/banking/products/{productId}", + "/discovery/status", "/discovery/outages"] + + if (authenticatedList.contains(resourcePath)) { + return AUConstants.AUTHENTICATED + + } else if(unauthenticatedList.contains(resourcePath)) { + return AUConstants.UNAUTHENTICATED + + } + } } diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/DbConnection.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/DbConnection.groovy new file mode 100644 index 000000000..b081cdc6a --- /dev/null +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/DbConnection.groovy @@ -0,0 +1,162 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package com.wso2.cds.test.framework.utility + +import com.wso2.cds.test.framework.configuration.AUConfigurationService + +import java.lang.reflect.InvocationTargetException +import java.sql.Connection +import java.sql.DriverManager +import java.sql.ResultSet +import java.sql.SQLException +import java.sql.Statement + +import static java.lang.System.err +import static java.lang.System.exit + +/** + * Class contains methods for DB Connections. + */ +class DbConnection { + + static Statement stmt; + static Connection con; + static String dbUrl; + static int metricsValue; + static AUConfigurationService auConfiguration = new AUConfigurationService(); + + /** + * Method to connect with DataBase. + * @param databaseName - Name of the Database + * @return Statement object to send the SQL statement to the Database + */ + public static Statement dbConnection (String databaseName) { + try { + String dbUrl = generateDbUrl(databaseName); + String username = auConfiguration.getDbUsername(); + String password = auConfiguration.getDbPassword(); + String driverClass = auConfiguration.getDbDriverClass(); + + // Database connection + String dbClass = driverClass; + Class.forName(dbClass).getDeclaredConstructor().newInstance(); + + // Get connection to DB + con = DriverManager.getConnection(dbUrl, username, password); + + // Statement object to send the SQL statement to the Database + stmt = con.createStatement(); + + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (SQLException e) { + e.printStackTrace(); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + + return stmt; + } + + /** + * Method to retrieve records from a particular database. + * @param databaseName + * @param query + * @return query response + */ + public static Object[][] executeSelectQuery(String databaseName, String query) { + + List resultList = new ArrayList<>(); + + //Create DB Connection + dbConnection(databaseName); + + try { + // Execute a query + ResultSet resultSet = stmt.executeQuery(query); + + // Get the number of columns in the result set + int columnCount = resultSet.getMetaData().getColumnCount(); + + // Iterate through the result set and generate the list + while (resultSet.next()) { + Object[] row = new Object[columnCount]; + for (int i = 1; i <= columnCount; i++) { + row[i - 1] = resultSet.getObject(i); + } + resultList.add(row); + } + + // Convert the list to a 2D array + Object[][] resultArray = new Object[resultList.size()][columnCount]; + for (int i = 0; i < resultList.size(); i++) { + resultArray[i] = resultList.get(i); + } + + // Close the result set and connection + stmt.close(); + con.close(); + return resultArray; + + } catch (SQLException ex) { + err.println("Transaction rollback with error: " + ex); + exit(0); + return null; + } + } + + /** + * Generate DB URL based on the provided DB Type. + * @param databaseName Database + * @return dbUrl + */ + public static String generateDbUrl(String databaseName) { + + String dbType = auConfiguration.getDbType(); + String dbServerHost = auConfiguration.getDbServerHost(); + + switch (dbType) { + case "MySQL": + case "mysql": + dbUrl = "jdbc:mysql://" + dbServerHost + ":3306/" + databaseName + "?autoReconnect=true&&useSSL=false"; + break; + case "MSSQL": + case "mssql": + dbUrl = "jdbc:sqlserver://" + dbServerHost + ":1433;databaseName=" + databaseName + ";encrypt=false"; + break; + case "Oracle": + case "oracle": +// dbUrl = "jdbc:oracle:thin:@" + dbServerHost + ":1521/" + auConfiguration.getOracleDbSid() + ""; + break; + case "PostgreSQL": + case "postgresql": + dbUrl = "jdbc:postgresql://" + dbServerHost + ":5432/" + databaseName + ""; + break; + default: + throw new IllegalStateException("Unexpected value: " + dbType); + } + return dbUrl; + } +} diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/SqlQuery.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/SqlQuery.groovy new file mode 100644 index 000000000..a354d9b70 --- /dev/null +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/SqlQuery.groovy @@ -0,0 +1,83 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package com.wso2.cds.test.framework.utility + +import com.wso2.cds.test.framework.configuration.AUConfigurationService + +/** + * Class contains the SQL queries related to testing. + */ +class SqlQuery { + + /** + * Retrieve Records from API_INVOCATION_RAW_DATA Within Specified Period. + * @param executionStartTime + * @param executionEndTime + * @return results set + */ + static String retrieveRecordsWithinSpecifiedPeriod(long executionStartTime, long executionEndTime) { + + AUConfigurationService auConfiguration = new AUConfigurationService() + String dbType = auConfiguration.getDbType() + def query + + switch (dbType) { + case "MySQL": + case "mysql": + query = "SELECT alr.RESPONSE_LATENCY as RESPONSE_TIME, api.ELECTED_RESOURCE, api.STATUS_CODE, api.CUSTOMER_STATUS \n" + + "FROM openbank_ob_reporting_statsdb.API_INVOCATION_RAW_DATA api, " + + "openbank_ob_reporting_statsdb.API_LATENCY_RAW_DATA alr\n" + + "WHERE api.MESSAGE_ID = alr.MESSAGE_ID AND api.`TIMESTAMP` BETWEEN \"$executionStartTime\" " + + "AND \"$executionEndTime\" \n" + + "ORDER BY api.`TIMESTAMP` DESC;" + break + default: + throw new IllegalStateException("Unexpected value: " + dbType) + break + } + return query + } + + /** + * Outage Details from SERVER_OUTAGES_RAW_DATA. + * @param outageStartTime + * @param outageEndTime + * @return results set + */ + static String retrieveOutageDetails(long outageStartTime, long outageEndTime) { + + AUConfigurationService auConfiguration = new AUConfigurationService() + String dbType = auConfiguration.getDbType() + def query + + switch (dbType) { + case "MySQL": + case "mysql": + query = "SELECT x.TYPE, x.ASPECT, x.TIME_TO - x.TIME_FROM as OUTAGE_TIME \n" + + "FROM openbank_ob_reporting_statsdb.SERVER_OUTAGES_RAW_DATA x \n" + + "WHERE x.TIME_TO BETWEEN \"$outageStartTime\" AND \"$outageEndTime\" " + + "ORDER BY x.TIME_FROM DESC;" + break + default: + throw new IllegalStateException("Unexpected value: " + dbType) + break + } + return query + } +} diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/resources/TestConfigurationExample.xml b/integration-test-suite/cds-toolkit-test-framework/src/main/resources/TestConfigurationExample.xml index 7d9f84a78..b0c78a217 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/resources/TestConfigurationExample.xml +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/resources/TestConfigurationExample.xml @@ -71,11 +71,11 @@ - AppConfig1.KeyStore.Location - + AppConfig1.KeyStore.Alias @@ -84,7 +84,7 @@ AppConfig1.KeyStore.DomainName - + AppConfig1.KeyStore.SigningKid @@ -98,7 +98,7 @@ - AppConfig1.Transport.KeyStore.Location @@ -112,12 +112,12 @@ - AppConfig1.DCR.SSAPath - + DCR.SoftwareId @@ -144,11 +144,11 @@ - AppConfig2.KeyStore.Location - + AppConfig2.KeyStore.Alias @@ -157,7 +157,7 @@ AppConfig2.KeyStore.DomainName - + AppConfig2.KeyStore.SigningKid @@ -170,7 +170,7 @@ true--> - @@ -183,12 +183,12 @@ - AppConfig2.DCR.SSAPath - + DCR.SoftwareId @@ -321,15 +321,15 @@ BrowserAutomation.BrowserPreference BrowserAutomation.HeadlessEnabled - + BrowserAutomation.WebDriverLocation - + ConsentApi.AudienceValue - + ConsentApi.RevocationAudienceValue @@ -429,4 +429,23 @@ ProfileSelection.Enabled + + + DataBaseConfiguration.DBType + + DataBaseConfiguration.DBServerHost + + DataBaseConfiguration.DBUsername + + DataBaseConfiguration.DBPassword + + + + + DataBaseConfiguration.DBDriverClass + + + DataBaseConfiguration.OracleDBSID + + From 2a5c69737095da8a809be92fb7f63ca8ba9d251c Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Mon, 25 Nov 2024 11:53:41 +0530 Subject: [PATCH 02/20] CDS Test Framework Modification - Change baseurl --- .../cds/test/framework/request_builder/AURequestBuilder.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy index 3d4d0dbbc..a21e99f26 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy @@ -94,7 +94,7 @@ class AURequestBuilder { auJwtGenerator.setScopes(scopes) String jwt = auJwtGenerator.getUserAccessTokenJwt(code) - RestAssured.baseURI = auConfiguration.getServerBaseURL() + RestAssured.baseURI = auConfiguration.getServerAuthorisationServerURL() Response response = AURestAsRequestBuilder.buildRequest().contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) .body(jwt) .post(AUConstants.TOKEN_ENDPOINT) From 16ee965d4f65e47884c7eecf5663ee012744e4ef Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Mon, 25 Nov 2024 11:55:15 +0530 Subject: [PATCH 03/20] CDS New Test Cases and Modifications --- .../accounts/AccountsIdPermanenceTest.groovy | 2 +- ...etrievalRequestHeaderValidationTest.groovy | 13 ++ .../accounts/DuplicateCommonAuthIdTest.groovy | 4 +- .../ConcurrentConsentTest.groovy | 100 ++++++++- ...DynamicClientRegistrationCreateTest.groovy | 194 +++++++++++++++++- ...DynamicClientRegistrationDeleteTest.groovy | 2 +- ...DynamicClientRegistrationUpdateTest.groovy | 48 +++++ .../throttling/ThrottlingPolicyTest.groovy | 38 ++-- .../test/tokenEndpoint/AccessTokenTest.groovy | 91 +++++++- .../AuthorisationFlowTest.groovy | 57 ++--- .../ConsentAmendmentFlowTest.groovy | 75 ++++++- .../par/PushedAuthorisationFlowTest.groovy | 47 ++++- .../par/RequestObjectValidationTest.groovy | 54 +++-- ...CeasingSecondaryUserConsentFlowTest.groovy | 8 + .../CeasingSecondaryUserManagementTest.groovy | 26 +++ 15 files changed, 689 insertions(+), 70 deletions(-) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy index c70c86380..ba487b5a8 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy @@ -149,7 +149,7 @@ class AccountsIdPermanenceTest extends AUTest { SoftAssert softAssertion= new SoftAssert() softAssertion.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) softAssertion.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) - softAssertion.assertEquals(secondConsentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertEquals(consentedAccount, AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, AUConstants.RESPONSE_DATA_SINGLE_ACCOUNTID), secretKey). split(":")[2]) softAssertion.assertTrue(AUTestUtil.parseResponseBody(response, AUConstants.LINKS_SELF) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy index 0d0b4d267..15e883f52 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy @@ -650,4 +650,17 @@ class AccountsRetrievalRequestHeaderValidationTest extends AUTest { softAssertion.assertAll() } + + @Test + void "CDS-32_Retrieve account list without x-fapi-interaction-id"() { + + def response = AURequestBuilder.buildBasicRequestWithCustomHeaders(userAccessToken, + AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .accept(AUConstants.ACCEPT) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) + } } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy index 136630bb3..125bed110 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy @@ -41,6 +41,7 @@ class DuplicateCommonAuthIdTest extends AUTest { @Test void "TC0202006_Initiate two authorisation consent flows on same browser session"() { + def sessionId response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, true, "") @@ -75,6 +76,7 @@ class DuplicateCommonAuthIdTest extends AUTest { automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY, true) .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) .addStep { driver, context -> + driver.sessionId = sessionId AutomationMethod authWebDriver = new AutomationMethod(driver) //Select Profile and Accounts @@ -86,7 +88,7 @@ class DuplicateCommonAuthIdTest extends AUTest { //Click Authorise Button authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) } - .execute(true) + .execute() authorisationCode = AUTestUtil.getCodeFromJwtResponse(automationResponse.currentUrl.get()) Assert.assertNotNull(authorisationCode) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy index 62c277206..7a7b24d88 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy @@ -167,8 +167,7 @@ class ConcurrentConsentTest extends AUTest { .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) .get("${AUConstants.BULK_ACCOUNT_PATH}") - //TODO: Issue: https://github.com/wso2-enterprise/financial-open-banking/issues/7882 - Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_403) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) //validate token def introspectResponse = AURequestBuilder.buildIntrospectionRequest(userAccessToken, @@ -178,6 +177,36 @@ class ConcurrentConsentTest extends AUTest { Assert.assertTrue((introspectResponse.jsonPath().get("active")).equals(false)) } + //TODO: https://github.com/wso2-enterprise/ob-compliance-toolkit-cds/issues/424 + @Test (dependsOnMethods = "TC0902001_Revoke consent using cdr management endpoint") + void "CDS-147_Invoke cdr management endpoint with previously revoked cdr_arrangement_id"() { + + //revoke sharing arrangement without cdr arrangement id + generator = new AUJWTGenerator() + String assertionString = generator.getClientAssertionJwt(clientId) + + def bodyContent = [(AUConstants.CLIENT_ID_KEY): (clientId), + (AUConstants.CLIENT_ASSERTION_TYPE_KEY): (AUConstants.CLIENT_ASSERTION_TYPE), + (AUConstants.CLIENT_ASSERTION_KEY) : assertionString, + (AUConstants.CDR_ARRANGEMENT_ID) : cdrArrangementId] + + revocationResponse = AURestAsRequestBuilder.buildRequest() + .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) + .formParams(bodyContent) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CDR_ARRANGEMENT)) + .post("${AUConstants.CDR_ARRANGEMENT_ENDPOINT}") + + Assert.assertEquals(revocationResponse.statusCode(), AUConstants.STATUS_CODE_422) + Assert.assertNotNull(revocationResponse.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) + + Assert.assertEquals(AUTestUtil.parseResponseBody(revocationResponse, AUConstants.ERROR_CODE), + AUConstants.ERROR_CODE_INVALID_ARRANGEMENT) + Assert.assertEquals(AUTestUtil.parseResponseBody(revocationResponse, AUConstants.ERROR_TITLE), + AUConstants.INVALID_CONSENT_ARRANGEMENT) + Assert.assertEquals(AUTestUtil.parseResponseBody(revocationResponse, AUConstants.ERROR_DETAIL), + "invalid cdr-arrangement-id sent in the request") + } + @Test void "TC0203010_Generate User access token by revoked consent"() { @@ -313,4 +342,71 @@ class ConcurrentConsentTest extends AUTest { Assert.assertEquals(revocationResponse.statusCode(), AUConstants.STATUS_CODE_400) } + + @Test + void "CDS-1050_CDR Arrangement Revocation Request without client id param in the request body"() { + + List sharingScope = [ AUAccountScope.BANK_ACCOUNT_BASIC_READ ] + + //authorise sharing arrangement + response = auAuthorisationBuilder.doPushAuthorisationRequest(sharingScope, AUConstants.DEFAULT_SHARING_DURATION, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + doConsentAuthorisationViaRequestUri(sharingScope, requestUri.toURI(), clientId, AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + def userAccessTokenResponse = AURequestBuilder.getUserToken(authorisationCode, + sharingScope, AUConstants.CODE_VERIFIER) + String userAccessToken = userAccessTokenResponse.tokens.accessToken.toString() + + //obtain cdr_arrangement_id from token response + String cdrArrangementId = userAccessTokenResponse.getCustomParameters().get(AUConstants.CDR_ARRANGEMENT_ID) + Assert.assertNotNull(cdrArrangementId) + + //retrieve consumer data successfully + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.CDR_ENDPOINT_VERSION) + .header(AUConstants.X_FAPI_AUTH_DATE, AUConstants.DATE) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //revoke sharing arrangement + def revokeResponse = doRevokeCdrArrangementWithoutClientIdInRequest(auConfiguration.getAppInfoClientID(), + cdrArrangementId) + + Assert.assertEquals(revokeResponse.statusCode(), AUConstants.STATUS_CODE_204) + + } + + @Test + void "CDS-146_Invoke cdr management endpoint with invalid cdr_arrangement_id"() { + + //revoke sharing arrangement without cdr arrangement id + generator = new AUJWTGenerator() + String assertionString = generator.getClientAssertionJwt(clientId) + + def bodyContent = [(AUConstants.CLIENT_ID_KEY): (clientId), + (AUConstants.CLIENT_ASSERTION_TYPE_KEY): (AUConstants.CLIENT_ASSERTION_TYPE), + (AUConstants.CLIENT_ASSERTION_KEY) : assertionString, + (AUConstants.CDR_ARRANGEMENT_ID) : "123"] + + revocationResponse = AURestAsRequestBuilder.buildRequest() + .contentType(AUConstants.ACCESS_TOKEN_CONTENT_TYPE) + .formParams(bodyContent) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CDR_ARRANGEMENT)) + .post("${AUConstants.CDR_ARRANGEMENT_ENDPOINT}") + + Assert.assertEquals(revocationResponse.statusCode(), AUConstants.STATUS_CODE_422) + Assert.assertNotNull(revocationResponse.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) + + Assert.assertEquals(AUTestUtil.parseResponseBody(revocationResponse, AUConstants.ERROR_CODE), + AUConstants.ERROR_CODE_INVALID_ARRANGEMENT) + Assert.assertEquals(AUTestUtil.parseResponseBody(revocationResponse, AUConstants.ERROR_TITLE), + AUConstants.INVALID_CONSENT_ARRANGEMENT) + Assert.assertEquals(AUTestUtil.parseResponseBody(revocationResponse, AUConstants.ERROR_DETAIL), + "invalid cdr-arrangement-id sent in the request") + } } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy index ee6749591..221894be6 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy @@ -24,6 +24,7 @@ import com.wso2.cds.test.framework.constant.ContextConstants import com.wso2.cds.test.framework.request_builder.AUJWTGenerator import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder import com.wso2.cds.test.framework.utility.AUTestUtil +import io.restassured.http.ContentType import org.testng.Assert import org.testng.annotations.AfterClass import org.testng.annotations.BeforeClass @@ -32,6 +33,8 @@ import org.testng.ITestContext import java.nio.file.Path import java.nio.file.Paths +import java.time.LocalDate +import java.time.ZoneOffset /** *Test cases to validate DCR create request. @@ -464,6 +467,51 @@ class DynamicClientRegistrationCreateTest extends AUTest{ "Invalid responseTypes provided") } + @Test + void "CDS-1104_Create application with invalid TokenEndpointAuthSigningAlgorithm"() { + + AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(dcr.getRegularClaimsWithInvalidTokenAuthSignAlg()) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_400) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR), + AUConstants.INVALID_CLIENT_METADATA) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR_DESCRIPTION), + AUConstants.INVALID_SIGNING_ALG) + } + + @Test + void "CDS-1105_Create application with invalid Aud"() { + + AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(dcr.getClaimsWithInvalidAud()) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_400) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR), + AUConstants.INVALID_CLIENT_METADATA) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR_DESCRIPTION), + AUConstants.INVALID_AUDIENCE_ERROR) + } + + @Test + void "CDS-1106_Create application without ApplicationType"() { + + AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(dcr.getRegularClaimsWithoutApplicationType()) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_201) + deleteApplicationIfExists(clientId) + } + @Test void "CDS-673_DCR registration request with localhost url in the SSA"(ITestContext context) { @@ -475,7 +523,7 @@ class DynamicClientRegistrationCreateTest extends AUTest{ def registrationResponse = AURegistrationRequestBuilder .buildRegistrationRequest(registrationRequestBuilder .getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), AUTestUtil.readFileContent(filePath), - AUConstants.LOCALHOST_REDIRECT_URL)) + AUConstants.LOCALHOST_REDIRECT_URL)) .when() .post(AUConstants.DCR_REGISTRATION_ENDPOINT) @@ -492,5 +540,149 @@ class DynamicClientRegistrationCreateTest extends AUTest{ deleteApplicationIfExists(clientId) } + + @Test + void "CDS-674_DCR registration request with different hostnames for redirect url in SSA"() { + + Path dcrArtifactsPath = Paths.get(auConfiguration.getAppDCRSSAPath()) + String filePath = Paths.get(dcrArtifactsPath.getParent().toString(), "ssa_differentHostNames.txt") + + jtiVal = String.valueOf(System.currentTimeMillis()) + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder + .getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), AUTestUtil.readFileContent(filePath), + AUConstants.LOCALHOST_REDIRECT_URL)) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_400) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR), + AUConstants.INVALID_CLIENT_METADATA) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR_DESCRIPTION), + AUConstants.ERROR_REDIRECT_URL_WITH_DIFF_HOSTNAMES) + } + + @Test + void "Create application without redirect uri in SSA"() { + + Path dcrArtifactsPath = Paths.get(auConfiguration.getAppDCRSSAPath()) + String filePath = Paths.get(dcrArtifactsPath.getParent().toString(), "ssa_withoutRedirectUrl.txt") + + jtiVal = String.valueOf(System.currentTimeMillis()) + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder + .getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), AUTestUtil.readFileContent(filePath), + AUConstants.LOCALHOST_REDIRECT_URL)) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_400) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR), + AUConstants.INVALID_CLIENT_METADATA) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR_DESCRIPTION), + AUConstants.ERROR_EMPTY_REDIRECT_URL_IN_SSA) + } + + @Test + void "CDS-1108_Create application with invalid request_object_signing_alg"() { + + AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(dcr.getRegularClaimsWithInvalidRequestObjectSigningAlg()) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_400) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR), + AUConstants.INVALID_CLIENT_METADATA) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR_DESCRIPTION), + AUConstants.INVALID_SIGNING_ALG) + } + + @Test + void "CDS-1109_Create application with invalid id_token_signed_response_alg"() { + + AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(dcr.getRegularClaimsWithInvalidIdTokenSigningResponseAlg()) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_400) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR), + AUConstants.INVALID_CLIENT_METADATA) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR_DESCRIPTION), + AUConstants.INVALID_SIGNING_ALG) + } + + @Test + void "CDS-1110_Create application without id_token_signed_response_alg"() { + + AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(dcr.getRegularClaimsWithoutIdTokenSigningResponseAlg()) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_400) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR), + AUConstants.INVALID_CLIENT_METADATA) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR_DESCRIPTION), + AUConstants.ERROR_WITHOUT_IDTOKEN_SINGED_ALG) + } + + @Test (priority = 2, groups = "SmokeTest") + void "CDS-476_Create application without ID_Token Response Type and verify id_token encryption not Mandatory"() { + + deleteApplicationIfExists(clientId) + AUConfigurationService auConfiguration = new AUConfigurationService() + AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() + + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(dcr.getClaimsWithoutIdTokenEnc()) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_201) + clientId = parseResponseBody(registrationResponse, AUConstants.CLIENT_ID) + + deleteApplicationIfExists(clientId) + } + + @Test + void "CDS-1111_Create application with unsupported content-type"() { + + jtiVal = String.valueOf(System.currentTimeMillis()) + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder.getAURegularClaims()) + .contentType(ContentType.JSON) + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_415) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR_DESCRIPTION), + AUConstants.INVALID_CONTENT_TYPE) + } + + @Test + void "CDS-1112_Create application with expired Request JWT"() { + + Long expiredDate = LocalDate.now().minusDays(1).atTime(currentTime, 00, 00) + .toEpochSecond(ZoneOffset.UTC) + + AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(dcr.getExpiredRequestClaims(expiredDate)) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_400) + Assert.assertEquals(parseResponseBody(registrationResponse, AUConstants.ERROR), + AUConstants.INVALID_CLIENT_METADATA) + //TODO: Add Error Description after fixing https://github.com/wso2-enterprise/ob-compliance-toolkit-cds/issues/403 + } + } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy index 5335e4197..ba90c5cba 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy @@ -100,6 +100,6 @@ class DynamicClientRegistrationDeleteTest extends AUTest { .when() .request(httpMethod.toString(), AUConstants.DCR_REGISTRATION_ENDPOINT + clientId) - Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_400) + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_501) } } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy index 13fa6deb0..6d4c8a8ab 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy @@ -31,6 +31,9 @@ import org.testng.annotations.BeforeClass import org.testng.annotations.Test import org.testng.ITestContext +import java.nio.file.Path +import java.nio.file.Paths + /** * Testcases for DCR Update request validation. */ @@ -178,4 +181,49 @@ class DynamicClientRegistrationUpdateTest extends AUTest{ Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_401) } + + @Test + void "CDS-22_Update Application with SSA containing redirect uri in localhost value"() { + + Path dcrArtifactsPath = Paths.get(auConfiguration.getAppDCRSSAPath()) + String filePath = Paths.get(dcrArtifactsPath.getParent().toString(), "ssa_localhost.txt") + + accessToken = getApplicationAccessToken(clientId) + Assert.assertNotNull(accessToken) + + AUJWTGenerator aujwtGenerator =new AUJWTGenerator() + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder + .getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), AUTestUtil.readFileContent(filePath), + AUConstants.LOCALHOST_REDIRECT_URL)) + .header(AUConstants.AUTHORIZATION_HEADER_KEY, "${AUConstants.AUTHORIZATION_BEARER_TAG}${accessToken}") + .when() + .put(registrationPath + clientId) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(parseResponseBody(registrationResponse, "software_statement"), + AUTestUtil.readFileContent(filePath)) + Assert.assertTrue(parseResponseBody(registrationResponse, "redirect_uris") + .contains(AUConstants.LOCALHOST_REDIRECT_URL)) + + deleteApplicationIfExists(clientId) + } + + @Test + void "CDS-23_Update registration details with invalid http method"() { + + accessToken = getApplicationAccessToken(clientId) + Assert.assertNotNull(accessToken) + + AUJWTGenerator aujwtGenerator =new AUJWTGenerator() + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder.getAURegularClaims()) + .header(AUConstants.AUTHORIZATION_HEADER_KEY, "${AUConstants.AUTHORIZATION_BEARER_TAG}${accessToken}") + .when() + .request("COPY", AUConstants.DCR_REGISTRATION_ENDPOINT + clientId) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_501) + } } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy index 87445d582..d94c5c39f 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy @@ -118,8 +118,8 @@ class ThrottlingPolicyTest extends AUTest{ @Test(invocationCount = 200, threadPoolSize = 20, enabled = false) void "TC0306004_Throttle requests by DataRecipients policy - Unattended"() { - def response = AURequestBuilder.buildBasicRequestWithCustomHeaders(userAccessToken, - AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + def response = AURequestBuilder.buildBasicRequest(userAccessToken, + AUConstants.X_V_HEADER_ACCOUNTS) .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) .get("${AUConstants.BULK_ACCOUNT_PATH}") @@ -157,11 +157,11 @@ class ThrottlingPolicyTest extends AUTest{ } } - @Test(invocationCount = 200, threadPoolSize = 5, enabled = false) + @Test(invocationCount = 200, threadPoolSize = 5, enabled = true)// void "TC0306006_Throttle requests by Unattended-CallsPerSession policy"() { - def response = AURequestBuilder.buildBasicRequestWithCustomHeaders(userAccessToken, - AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + def response = AURequestBuilder.buildBasicRequest(userAccessToken, + AUConstants.X_V_HEADER_ACCOUNTS) .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) .get("${AUConstants.BULK_ACCOUNT_PATH}") @@ -178,13 +178,14 @@ class ThrottlingPolicyTest extends AUTest{ } } - @Test(invocationCount = 40, threadPoolSize = 2, enabled = true) - void "TC0306008_Throttle requests by Unattended-SessionCount policy"() { + @Test(invocationCount = 100, threadPoolSize = 10, enabled = true) + void "TC0306007_Throttle requests by Unattended-SessionTPS policy"() { - String scopeString = "openid ${String.join(" ", scopes.collect({ it.scopeString }))}" - Scope scopeList = new Scope(scopeString) + def response = AURequestBuilder.buildBasicRequest(userAccessToken, + AUConstants.X_V_HEADER_ACCOUNTS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") - def response = AURequestBuilder.getTokenResponse(scopeList.toStringList(), clientId) int currentCount = sequence.addAndGet(1) if(currentCount > 30) { @@ -193,16 +194,19 @@ class ThrottlingPolicyTest extends AUTest{ AUConstants.ERROR_CODE_GENERAL_EXPECTED_ERROR) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_TITLE), AUConstants.ERROR_TITLE_GENERAL_EXPECTED_ERROR) - } else { + }else { Assert.assertEquals(response.statusCode(), 200) } } - @Test(invocationCount = 100, threadPoolSize = 10, enabled = false) - void "TC0306007_Throttle requests by Unattended-SessionTPS policy"() { + @Test (invocationCount = 20, enabled = true) + void "Throttle requests by Unattended-SessionTPS policy"() { - def response = AURequestBuilder.buildBasicRequestWithCustomHeaders(userAccessToken, - AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + doConsentAuthorisation() + generateUserAccessToken() + + def response = AURequestBuilder + .buildBasicRequestWithCustomHeaders(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) .get("${AUConstants.BULK_ACCOUNT_PATH}") @@ -214,8 +218,8 @@ class ThrottlingPolicyTest extends AUTest{ AUConstants.ERROR_CODE_GENERAL_EXPECTED_ERROR) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_TITLE), AUConstants.ERROR_TITLE_GENERAL_EXPECTED_ERROR) - }else { - Assert.assertEquals(response.statusCode(), 200) + } else { + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) } } } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy index 8b2f92cb1..ea7662e15 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy @@ -71,8 +71,8 @@ class AccessTokenTest extends AUTest { def errorObject = AURequestBuilder.getUserTokenErrorResponse(authorisationCode, auConfiguration.getAppInfoRedirectURL(), auConfiguration.getAppInfoClientID(), true, false) - Assert.assertEquals(errorObject.toJSONObject().get(AUConstants.ERROR_DESCRIPTION), "Transport certificate" + - " not found in the request") + Assert.assertEquals(errorObject.toJSONObject().get(AUConstants.ERROR_DESCRIPTION), "Valid transport " + + "certificate not found in the request") } @Test @@ -247,7 +247,6 @@ class AccessTokenTest extends AUTest { Assert.assertTrue(introspectResponse.jsonPath().get("active").equals(false)) } - //TODO: Issue: https://github.com/wso2-enterprise/financial-open-banking/issues/8456 @Test(dependsOnMethods = "CDS-705_Verify introspection response not returning username field") void "CDS-1023_Verify introspection request return cdr_arrangement_id"() { @@ -261,4 +260,90 @@ class AccessTokenTest extends AUTest { Assert.assertNotNull(response.jsonPath().get("exp")) Assert.assertEquals(response.jsonPath().get("cdr_arrangement_id"), cdrArrangementId) } + + @Test + void "CDS-1048_Token Request without client id param in the request body"() { + + doConsentAuthorisation( auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(authorisationCode) + + def tokenResponse = getUserAccessTokenResponse() + user_AccessToken = tokenResponse.tokens.accessToken + refreshToken = tokenResponse.tokens.refreshToken + + Assert.assertNotNull(user_AccessToken) + } + + @Test (dependsOnMethods = "CDS-1048_Token Request without client id param in the request body") + void "CDS-1052_Token introspection Request without client id param in the request body"() { + + def introspectResponseSecondToken = AURequestBuilder.buildIntrospectionWithoutClientIdParam(refreshToken, + auConfiguration.getAppInfoClientID(), 0) + .post(AUConstants.INTROSPECTION_ENDPOINT) + + Assert.assertTrue(introspectResponseSecondToken.jsonPath().get("active").toString().contains("true")) + } + + @Test (dependsOnMethods = "CDS-1052_Token introspection Request without client id param in the request body") + void "CDS-1051_Token Revocation Request without client id param in the request body"() { + + // Revoke access Token + def revokeResponse = AURequestBuilder + .buildRevokeTokenWithoutClientIdParam(user_AccessToken, auConfiguration.getAppInfoClientID()) + .post(AUConstants.TOKEN_REVOKE_PATH) + + Assert.assertEquals(revokeResponse.statusCode(), AUConstants.STATUS_CODE_200) + } + + @Test + void "CDS-1053_Token Request with client id param in the request body similar to sub value"() { + + doConsentAuthorisation( auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(authorisationCode) + + def tokenResponse = getUserAccessTokenResponse(auConfiguration.getAppInfoClientID()) + user_AccessToken = tokenResponse.tokens.accessToken + refreshToken = tokenResponse.tokens.refreshToken + + Assert.assertNotNull(user_AccessToken) + } + + @Test (dependsOnMethods = "CDS-1053_Token Request with client id param in the request body similar to sub value") + void "CDS-1057_Token introspection Request with client id param in the request body similar to sub value"() { + + def introspectResponseSecondToken = AURequestBuilder.buildIntrospectionRequest(refreshToken, + auConfiguration.getAppInfoClientID(), 0) + .post(AUConstants.INTROSPECTION_ENDPOINT) + + Assert.assertTrue(introspectResponseSecondToken.jsonPath().get("active").toString().contains("true")) + } + + @Test (dependsOnMethods = "CDS-1057_Token introspection Request with client id param in the request body similar to sub value") + void "CDS-1056_Token Revocation Request with client id param in the request body similar to sub value"() { + + // Revoke access Token + def revokeResponse = AURequestBuilder + .buildRevokeIntrospectionRequest(user_AccessToken, auConfiguration.getAppInfoClientID()) + .post(AUConstants.TOKEN_REVOKE_PATH) + + Assert.assertEquals(revokeResponse.statusCode(), AUConstants.STATUS_CODE_200) + } + + @Test + void "CDS-1058_Token Request with client Id in the request body not similar to client id in the client_assertion"() { + + doConsentAuthorisation( auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(authorisationCode) + + def tokenResponse = AURequestBuilder.getUserTokenWithClientIdInReqBody(authorisationCode, + AUConstants.CODE_VERIFIER, auConfiguration.getAppInfoClientID(), auConfiguration.getAppInfoClientID(1)) + def response = tokenResponse.toErrorResponse() + + Assert.assertEquals(response.toHTTPResponse().statusCode, AUConstants.STATUS_CODE_401) + Assert.assertEquals(response.toHTTPResponse().getAt(AUConstants.ERROR_DESCRIPTION), + "Request Parameter 'client_id' does not match the 'sub' claim in the client_assertion") + Assert.assertEquals(response.toHTTPResponse().getAt(AUConstants.ERROR), AUConstants.INVALID_CLIENT) + + Assert.assertNotNull(user_AccessToken) + } } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy index 3112239e6..10541d1d7 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy @@ -227,7 +227,7 @@ class AuthorisationFlowTest extends AUTest { // Revoke access Token def revokeResponse = AURequestBuilder .buildRevokeIntrospectionRequest(userAccessToken, auConfiguration.getAppInfoClientID()) - .post(AUConstants.REVOKE_PATH) + .post(AUConstants.TOKEN_REVOKE_PATH) Assert.assertEquals(revokeResponse.statusCode(), AUConstants.STATUS_CODE_200) @@ -288,7 +288,6 @@ class AuthorisationFlowTest extends AUTest { Assert.assertEquals(state, stateParam) } - //TODO: Issue: https://github.com/wso2-enterprise/financial-open-banking/issues/8303 @Test void "OB-1695_Cancel consent authorisation sent with state param in the login page"() { @@ -355,7 +354,7 @@ class AuthorisationFlowTest extends AUTest { .execute() def authUrl = automation.currentUrl.get() - Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) String stateParam = authUrl.split("state=")[1] Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) } @@ -393,16 +392,16 @@ class AuthorisationFlowTest extends AUTest { .execute() def authUrl = automation.currentUrl.get() - Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) Assert.assertTrue(authUrl.contains("state")) } - //TODO: Issue: https://github.com/wso2-enterprise/financial-open-banking/issues/8303 @Test void "OB-1697_Deny consent authorisation request sent without state param in the display_consent page"() { response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, - true, "") + true, "", auConfiguration.getAppInfoClientID(), + auConfiguration.getAppInfoRedirectURL(), ResponseType.CODE.toString(), false) requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) String authUrl = doConsentAuthorisationViaRequestUriDenyFlow(scopes, requestUri.toURI(), @@ -445,7 +444,7 @@ class AuthorisationFlowTest extends AUTest { .execute() def authUrl = automation.currentUrl.get() - Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) Assert.assertFalse(authUrl.contains("state")) } @@ -488,7 +487,7 @@ class AuthorisationFlowTest extends AUTest { .execute() def authUrl = automation.currentUrl.get() - Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) Assert.assertFalse(authUrl.contains("state")) } @@ -498,20 +497,11 @@ class AuthorisationFlowTest extends AUTest { scopes = [] response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, true, "") - requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) - - authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), - auConfiguration.getAppInfoClientID(), false).toURI().toString() + requestUri = response.jsonPath().getString(AUConstants.ERROR_DESCRIPTION) String errorMessage = "No valid scopes found in the request" - def automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) - .addStep(new NavigationAutomationStep(authoriseUrl, 10)) - .execute() - - String url = automationResponse.currentUrl.get() - String errorUrl = AUTestUtil.getErrorFromUrl(url) - Assert.assertEquals(errorUrl, errorMessage) + Assert.assertEquals(requestUri, errorMessage) } @Test (priority = 2) @@ -525,14 +515,13 @@ class AuthorisationFlowTest extends AUTest { response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, true, "") - String errorMessage = "Invalid scopes in the request" + String errorMessage = "No valid scopes found in the request" Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), errorMessage) } - //TODO: Issue: https://github.com/wso2-enterprise/financial-open-banking/issues/8420 @Test - void "OB-1253_Initiate authorisation consent flow only with openid and profile scopes"() { + void "OB-1253_Initiate authorisation consent flow only with openid and profile scopes"() { scopes = [ AUAccountScope.PROFILE @@ -711,7 +700,7 @@ class AuthorisationFlowTest extends AUTest { def authUrl = automation.currentUrl.get() def error_description = URLDecoder.decode(authUrl.split("&")[2].split("=")[1], "UTF8") - Assert.assertTrue(error_description.contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(error_description.contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) String actualRedirectUrl = authUrl.split("#")[0] Assert.assertEquals(actualRedirectUrl.toString(), newRedirectUri) } @@ -791,7 +780,7 @@ class AuthorisationFlowTest extends AUTest { def authUrl = automation.currentUrl.get() def error_description = URLDecoder.decode(authUrl.split("&")[2].split("=")[1], "UTF8") - Assert.assertTrue(error_description.contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(error_description.contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) String actualRedirectUrl = authUrl.split("#")[0] Assert.assertEquals(actualRedirectUrl.toString(), newRedirectUri) } @@ -840,4 +829,24 @@ class AuthorisationFlowTest extends AUTest { def automation = doAuthorisationFlowNavigation(authoriseUrl, AUAccountProfile.INDIVIDUAL, true) authorisationCode = AUTestUtil.getCodeFromJwtResponse(automation.currentUrl.get()) } + + @Test + void "CDS-720_Send authorisation request without request_uri"() { + + requestUri = "" + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), + auConfiguration.getAppInfoClientID()).toURI().toString() + + String errorMessage = "Redirect URI is not present in the authorization request" + + def automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .execute() + + String url = automationResponse.currentUrl.get() + String errorUrl + + errorUrl = AUTestUtil.getErrorFromUrl(url) + Assert.assertEquals(errorUrl, errorMessage) + } } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy index 3eb2b1223..0c3e216f3 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy @@ -57,6 +57,68 @@ class ConsentAmendmentFlowTest extends AUTest{ private String cdrArrangementId, userAccessToken, secondUserAccessToken private RefreshToken refreshToken, secondRefreshToken + @Test(groups = "SmokeTest") + void "CDS-9771_Verify Consent Amendment flow when both sharing duration and scope has been amended"() { + + // Send Authorisation request + doConsentAuthorisation(auConfiguration.getAppInfoClientID(), AUAccountProfile.INDIVIDUAL) + + // Retrieve the user access token by auth code + accessTokenResponse = getUserAccessTokenResponse(clientId) + cdrArrangementId = accessTokenResponse.getCustomParameters().get(AUConstants.CDR_ARRANGEMENT_ID) + userAccessToken = accessTokenResponse.tokens.accessToken + refreshToken = accessTokenResponse.tokens.refreshToken + + Assert.assertNotNull(userAccessToken) + Assert.assertNotNull(refreshToken) + Assert.assertNotNull(cdrArrangementId) + + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI()).toURI().toString() + + //Consent Amendment Authorisation Flow + def automation = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + + //Click Authorise Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + } + .execute() + + // Get Code From URL + authorisationCode = AUTestUtil.getCodeFromJwtResponse(automation.currentUrl.get()) + + //Generate Token + accessTokenResponse2 = getUserAccessTokenResponse(clientId) + def cdrArrangementId2 = accessTokenResponse2.getCustomParameters().get(AUConstants.CDR_ARRANGEMENT_ID) + secondUserAccessToken = accessTokenResponse2.tokens.accessToken + secondRefreshToken = accessTokenResponse2.tokens.refreshToken + + Assert.assertNotNull(secondUserAccessToken) + Assert.assertNotNull(secondRefreshToken) + Assert.assertEquals(cdrArrangementId, cdrArrangementId2, "Amended CDR id is not original CDR id") + + //Get Account Transaction Details + def responseAfterAmendment = AURequestBuilder.buildBasicRequestWithCustomHeaders(secondUserAccessToken, + AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(responseAfterAmendment.statusCode(), AUConstants.STATUS_CODE_200) + } + @Test(groups = "SmokeTest") void "CDS-977_Verify Consent Amendment flow when both sharing duration and scope has been amended"() { @@ -110,9 +172,17 @@ class ConsentAmendmentFlowTest extends AUTest{ secondUserAccessToken = accessTokenResponse2.tokens.accessToken secondRefreshToken = accessTokenResponse2.tokens.refreshToken - Assert.assertNotNull(userAccessToken) Assert.assertNotNull(secondUserAccessToken) + Assert.assertNotNull(secondRefreshToken) Assert.assertEquals(cdrArrangementId, cdrArrangementId2, "Amended CDR id is not original CDR id") + + //Get Account Transaction Details + def responseAfterAmendment = AURequestBuilder.buildBasicRequestWithCustomHeaders(secondUserAccessToken, + AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(responseAfterAmendment.statusCode(), AUConstants.STATUS_CODE_200) } @Test(groups = "SmokeTest", @@ -172,7 +242,8 @@ class ConsentAmendmentFlowTest extends AUTest{ @Test(dependsOnMethods = "CDS-977_Verify Consent Amendment flow when both sharing duration and scope has been amended") void "CDS-982_Verify regenerate Access Token using Refresh Token for amended Consent"() { - AccessTokenResponse userAccessToken = getUserAccessTokenFormRefreshToken(secondRefreshToken) + RefreshToken refreshToken = new RefreshToken(secondRefreshToken) + AccessTokenResponse userAccessToken = getUserAccessTokenFormRefreshToken(refreshToken) Assert.assertNotNull(userAccessToken.tokens.accessToken) } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy index 9b96f5bd6..90caaf03e 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy @@ -368,7 +368,7 @@ class PushedAuthorisationFlowTest extends AUTest { Assert.assertEquals(AUTestUtil.parseResponseBody(parResponse, AUConstants.ERROR_DESCRIPTION), "Error retrieving service provider tenant domain for client_id: ${incorrectClientId}") Assert.assertEquals(AUTestUtil.parseResponseBody(parResponse, AUConstants.ERROR), - "Service provider metadata retrieval failed") + "Service provider metadata retrieval failed") } @Test @@ -517,4 +517,49 @@ class PushedAuthorisationFlowTest extends AUTest { Assert.assertNotNull(requestUri) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.RESPONSE_EXPIRES_IN)) } + + @Test + void "CDS-1049_PAR Request without client id param in the request body"() { + + def response = auAuthorisationBuilder.doPushAuthorisationRequestWithoutClientId(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + Assert.assertNotNull(requestUri) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.RESPONSE_EXPIRES_IN)) + } + + @Test + void "CDS-1059_PAR Request with client Id in the request body not similar to client id in the client_assertion"() { + + def response = auAuthorisationBuilder.doPushAuthorisationRequestWithDifferentClientIds(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId, + auConfiguration.getAppInfoClientID(), auConfiguration.getAppInfoClientID(1)) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + + def errorDesc = AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION) + def error = AUTestUtil.parseResponseBody(response, AUConstants.ERROR) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) + Assert.assertEquals(errorDesc, "Request Parameter 'client_id' does not match the 'sub' claim in the client_assertion") + Assert.assertEquals(error, AUConstants.INVALID_CLIENT) + } + + @Test + void "CDS-1069_PAR Request with valid client Id in the request body and deleted client id in the client_assertion"() { + + def invalidClientId = "qwe23rvdvdfvfd" + def response = auAuthorisationBuilder.doPushAuthorisationRequestWithDifferentClientIds(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId, + invalidClientId, auConfiguration.getAppInfoClientID(1)) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + + def errorDesc = AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION) + def error = AUTestUtil.parseResponseBody(response, AUConstants.ERROR) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) + Assert.assertEquals(errorDesc, "Error retrieving service provider tenant domain for client_id: $invalidClientId") + Assert.assertEquals(error, "Service provider metadata retrieval failed") + } } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy index ad31d11d2..ec5c14442 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy @@ -67,7 +67,7 @@ class RequestObjectValidationTest extends AUTest { void "OB-1233_Initiate authorisation consent flow with 'RS256' signature algorithm"() { String claims = generator.getRequestObjectClaim(scopes, AUConstants.DEFAULT_SHARING_DURATION, true, "", - auConfiguration.getAppInfoRedirectURL(), auConfiguration.getAppInfoClientID(), + auConfiguration.getAppInfoRedirectURL(), auConfiguration.getAppInfoClientID(), auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString()) @@ -80,7 +80,6 @@ class RequestObjectValidationTest extends AUTest { Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR), AUConstants.INVALID_REQUEST_OBJECT) } - //TODO: Issue: https://github.com/wso2-enterprise/financial-open-banking/issues/8457 @Test (priority = 1) void "OB-1234_Initiate authorisation consent flow with 'PS512' signature algorithm"() { @@ -107,8 +106,9 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.removeClaimsFromRequestObject(claims, "aud") + String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), AUConstants.MISSING_AUD_VALUE) @@ -124,8 +124,9 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.removeClaimsFromRequestObject(claims, "iss") + String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), AUConstants.MISSING_ISS_VALUE) @@ -142,7 +143,9 @@ class RequestObjectValidationTest extends AUTest { String modifiedClaimSet = generator.removeClaimsFromRequestObject(claims, "exp") - def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) + String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() + + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), AUConstants.MISSING_EXP_VALUE) @@ -158,7 +161,9 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.removeClaimsFromRequestObject(claims, "nbf") - def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) + String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() + + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), AUConstants.MISSING_NBF_VALUE) @@ -174,7 +179,9 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString(), ResponseMode.JWT.toString(), Instant.now().minus(1, ChronoUnit.HOURS)) - def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) + String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() + + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -192,7 +199,9 @@ class RequestObjectValidationTest extends AUTest { auConfiguration.getAppInfoClientID(), auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString(), ResponseMode.JWT.toString(), time, time) - def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) + String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() + + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -210,7 +219,9 @@ class RequestObjectValidationTest extends AUTest { auConfiguration.getAppInfoClientID(), auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString(), ResponseMode.JWT.toString(), time) - def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) + String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() + + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -227,7 +238,9 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.removeClaimsFromRequestObject(claims, "redirect_uri") - def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) + + String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -245,7 +258,8 @@ class RequestObjectValidationTest extends AUTest { String modifiedClaimSet = generator.addClaimsFromRequestObject(claims, "redirect_uri", "https://www.google.com") - def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) + String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -261,7 +275,8 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString()) - def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) + String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI)) @@ -275,7 +290,8 @@ class RequestObjectValidationTest extends AUTest { auConfiguration.getAppInfoClientID(), auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString()) - def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) + String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -294,8 +310,9 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.addClaimsFromRequestObject(claims, "exp", expiryDate) + String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -312,8 +329,9 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.addClaimsFromRequestObject(claims, "aud", "123") + String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -329,7 +347,8 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString()) - def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) + String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI)) @@ -345,8 +364,9 @@ class RequestObjectValidationTest extends AUTest { def audienceValue = AUConstants.PUSHED_AUTHORISATION_BASE_PATH + AUConstants.PAR_ENDPOINT String modifiedClaimSet = generator.addClaimsFromRequestObject(claims, "aud", audienceValue) + String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI)) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy index 40529068c..bfbde3851 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy @@ -276,6 +276,14 @@ class CeasingSecondaryUserConsentFlowTest extends AUTest { } .execute() + authorisationCode = AUTestUtil.getCodeFromJwtResponse(automation.currentUrl.get()) + + //Get Access Token + responseBody = getUserAccessTokenResponse(clientId) + userAccessToken = responseBody.tokens.accessToken + cdrArrangementId = responseBody.getCustomParameters().get(AUConstants.CDR_ARRANGEMENT_ID) + Assert.assertNotNull(cdrArrangementId) + //Block the sharing status of one account response = updateLegalEntityStatus(clientHeader, accountID, userId, legalEntityId, AUConstants.BLOCK_ENTITY) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy index 829ef17e3..7e2ad5895 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy @@ -170,4 +170,30 @@ class CeasingSecondaryUserManagementTest extends AUTest { Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "${AUConstants.PAYLOAD_SECONDARY_USERS}." + "${AUConstants.PAYLOAD_PARAM_ACCOUNTS}.${AUConstants.LEGAL_ENTITIES}.${AUConstants.SHARING_STATUS}")) } + + @Test + void "CDS-636_Block sharing status with incorrect accountId"() { + + response = updateLegalEntityStatus(clientHeader, "1234", userId, legalEntityId, AUConstants.BLOCK_ENTITY) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) + + //TODO: Issue: https://github.com/wso2-enterprise/financial-open-banking/issues/8275 + Assert.assertEquals(AUTestUtil.parseResponseBody(response, "errorDescription"), + "Error occurred while updating the sharing status for a legal entity/entities.") + Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR), AUConstants.INVALID_REQUEST) + } + + @Test + void "CDS-637_Block sharing status with incorrect user id"() { + + response = updateLegalEntityStatus(clientHeader, accountID, "abc@gold.com", legalEntityId, AUConstants.BLOCK_ENTITY) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) + + //TODO: Issue: https://github.com/wso2-enterprise/financial-open-banking/issues/8275 + Assert.assertEquals(AUTestUtil.parseResponseBody(response, "errorDescription"), + "Error occurred while updating the sharing status for a legal entity/entities.") + Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR), AUConstants.INVALID_REQUEST) + } + + } From f131079ba1cdc394238d8693999767236dcbe556 Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Tue, 26 Nov 2024 12:20:53 +0530 Subject: [PATCH 04/20] CDS New Test Cases and Modifications --- .../cds-toolkit-integration-test/pom.xml | 14 +++- .../accounts/AccountsIdPermanenceTest.groovy | 38 +++++------ ...etrievalRequestHeaderValidationTest.groovy | 41 +++--------- ...untsRetrievalRequestValidationTests.groovy | 42 +++++++----- .../accounts/DuplicateCommonAuthIdTest.groovy | 50 +++++++------- .../MultiTppConsentValidationTest.groovy | 19 +++--- .../admin_api/AdminApiValidationTests.groovy | 12 ++-- .../AuthorisationFlowCXValidationTest.groovy | 21 +++--- .../AuthorisationFlowUIValidationTest.groovy | 21 +++--- ...onsentAmendmentFlowUIValidationTest.groovy | 22 +++---- ...serAuthenticationFlowValidationTest.groovy | 21 +++--- ...roductRetrievalHeaderValidationTest.groovy | 18 ++--- .../ProductRetrievalValidationTest.groovy | 21 +++--- .../ConcurrentConsentTest.groovy | 31 ++++----- ...DynamicClientRegistrationCreateTest.groovy | 55 ++++++++-------- ...DynamicClientRegistrationDeleteTest.groovy | 20 +++--- ...namicClientRegistrationRetrieveTest.groovy | 19 ++---- ...DynamicClientRegistrationUpdateTest.groovy | 44 ++++++++----- .../MultiTppDcrEndpointTests.groovy | 17 ++--- ...tailsRetrievalHeaderValidationTests.groovy | 17 +++-- .../CustomerDetailsRetrievalTest.groovy | 12 ++-- .../MetaDataAccountRetrieval.groovy | 8 +-- .../MetaDataConsentAmendment.groovy | 19 +++--- .../MetaDataConsentAuthorization.groovy | 12 ++-- .../MetaDataConsentWithdrawal.groovy | 8 +-- .../MetaDataUpdateBatchTaskTests.groovy | 12 ++-- .../throttling/ThrottlingPolicyTest.groovy | 12 ++-- .../test/tokenEndpoint/AccessTokenTest.groovy | 22 +++---- .../MultiTppTokenFlowValidationTests.groovy | 16 ++--- .../CommonTppOnboardingStep.groovy | 14 ++-- .../AuthorisationFlowTest.groovy | 31 +++++---- .../ConsentAmendmentFlowTest.groovy | 25 ++++--- .../SharingDurationValidationTest.groovy | 11 ++-- .../test/bnr/BnrEndToEndTest.groovy | 18 ++--- .../test/bnr/ConsentAmendmentFlowTests.groovy | 22 +++---- .../bnr/ConsentAuthFlowValidationTests.groovy | 20 +++--- .../bnr/UserNominationManagementTests.groovy | 16 ++--- ...sclosureOptionManagementServiceTest.groovy | 22 +++---- ...ponseModeFormPostJwtValidationTests.groovy | 10 ++- ...ponseModeFragmentJwtValidationTests.groovy | 9 ++- .../JarmResponseModeJwtValidationTests.groovy | 11 ++-- ...ResponseModeQueryJwtValidationTests.groovy | 9 ++- ...uthorizationResponseValidationTests.groovy | 10 +-- .../par/PushedAuthorisationFlowTest.groovy | 27 ++++---- .../par/RequestObjectValidationTest.groovy | 65 ++++++------------- ...CeasingSecondaryUserConsentFlowTest.groovy | 20 +++--- .../CeasingSecondaryUserManagementTest.groovy | 10 +-- .../SecondaryUserAmendmentFlow.groovy | 16 ++--- ...ryUserInstructionsAuthorisationTest.groovy | 20 +++--- .../cds-toolkit-test-framework/pom.xml | 6 +- .../wso2/cds/test/framework/AUTest.groovy | 48 +++++++------- .../consent/AUAccountSelectionStep.groovy | 14 ++-- .../consent/AUBasicAuthAutomationStep.groovy | 16 ++--- .../AUBasicWithdrawalAutomationStep.groovy | 12 ++-- .../AUCCPortalWithdrawalAutomationStep.groovy | 12 ++-- .../AUConfigurationService.groovy | 9 +-- .../constant/AUAccountProfile.groovy | 2 +- .../framework/constant/AUAccountScope.groovy | 5 +- .../constant/AUBusinessUserPermission.groovy | 2 +- .../constant/AUConfigConstants.groovy | 2 +- .../framework/constant/AUConstants.groovy | 13 ++-- .../framework/constant/AUDOMSStatus.groovy | 2 +- .../framework/constant/AUPageObjects.groovy | 2 +- .../test/framework/constant/AUPayloads.groovy | 2 +- .../constant/ContextConstants.groovy | 2 +- .../data_provider/ConsentDataProviders.groovy | 6 +- .../test/framework/keystore/AUKeyStore.groovy | 8 +-- .../AUAuthorisationBuilder.groovy | 15 ++--- .../request_builder/AUJWTGenerator.groovy | 23 +++---- .../AURegistrationRequestBuilder.groovy | 14 ++-- .../request_builder/AURequestBuilder.groovy | 14 ++-- .../utility/AUIdEncryptorDecryptor.groovy | 2 +- .../utility/AUMockCDRIntegrationUtil.groovy | 7 +- .../utility/AURestAsRequestBuilder.groovy | 11 ++-- .../utility/AUSSLSocketFactoryCreator.groovy | 6 +- .../test/framework/utility/AUTestUtil.groovy | 26 ++++---- .../framework/utility/DbConnection.groovy | 4 +- .../test/framework/utility/SqlQuery.groovy | 4 +- integration-test-suite/pom.xml | 6 +- ...gning-oQ4KoaavpOuoE7rvQsZEOV_NO_UPLOAD.key | 28 -------- ...sport-oQ4KoaavpOuoE7rvQsZEOV_NO_UPLOAD.key | 28 -------- 81 files changed, 642 insertions(+), 759 deletions(-) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy (95%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/accounts/AccountsRetrievalRequestValidationTests.groovy (96%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy (71%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/accounts/MultiTppConsentValidationTest.groovy (92%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy (98%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/authflow/AuthorisationFlowCXValidationTest.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/authflow/AuthorisationFlowUIValidationTest.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/authflow/ConsentAmendmentFlowUIValidationTest.groovy (95%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/authflow/UserAuthenticationFlowValidationTest.groovy (94%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/banking_products/ProductRetrievalHeaderValidationTest.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy (95%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy (95%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy (86%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy (80%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy (87%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/clientRegistration/MultiTppDcrEndpointTests.groovy (88%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalHeaderValidationTests.groovy (98%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalTest.groovy (96%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/metadata_update/MetaDataAccountRetrieval.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/metadata_update/MetaDataConsentAmendment.groovy (87%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/metadata_update/MetaDataConsentAuthorization.groovy (96%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/metadata_update/MetaDataConsentWithdrawal.groovy (98%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/metadata_update/MetaDataUpdateBatchTaskTests.groovy (96%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy (96%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy (95%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/tokenEndpoint/MultiTppTokenFlowValidationTests.groovy (86%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy (84%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/authorizationflow/SharingDurationValidationTest.groovy (94%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/bnr/BnrEndToEndTest.groovy (87%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/bnr/ConsentAmendmentFlowTests.groovy (95%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy (98%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/bnr/UserNominationManagementTests.groovy (98%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/doms/DisclosureOptionManagementServiceTest.groovy (96%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy (93%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy (94%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy (93%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy (92%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/jarm/JwtSecuredAuthorizationResponseValidationTests.groovy (92%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy (88%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy (96%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy (97%) rename integration-test-suite/cds-toolkit-integration-test/src/test/groovy/{com => org}/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy (97%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/AUTest.groovy (98%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/automation/consent/AUAccountSelectionStep.groovy (77%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy (83%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/automation/consent/AUBasicWithdrawalAutomationStep.groovy (84%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy (83%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/configuration/AUConfigurationService.groovy (97%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/constant/AUAccountProfile.groovy (95%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/constant/AUAccountScope.groovy (94%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/constant/AUBusinessUserPermission.groovy (95%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/constant/AUConfigConstants.groovy (99%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/constant/AUConstants.groovy (99%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/constant/AUDOMSStatus.groovy (95%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/constant/AUPageObjects.groovy (99%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/constant/AUPayloads.groovy (99%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/constant/ContextConstants.groovy (95%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/data_provider/ConsentDataProviders.groovy (95%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/keystore/AUKeyStore.groovy (90%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy (98%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy (96%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy (97%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy (98%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/utility/AUIdEncryptorDecryptor.groovy (98%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/utility/AUMockCDRIntegrationUtil.groovy (97%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/utility/AURestAsRequestBuilder.groovy (89%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/utility/AUSSLSocketFactoryCreator.groovy (93%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/utility/AUTestUtil.groovy (96%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/utility/DbConnection.groovy (98%) rename integration-test-suite/cds-toolkit-test-framework/src/main/groovy/{com => org}/wso2/cds/test/framework/utility/SqlQuery.groovy (96%) delete mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/obsigning-oQ4KoaavpOuoE7rvQsZEOV_NO_UPLOAD.key delete mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/obtransport-oQ4KoaavpOuoE7rvQsZEOV_NO_UPLOAD.key diff --git a/integration-test-suite/cds-toolkit-integration-test/pom.xml b/integration-test-suite/cds-toolkit-integration-test/pom.xml index 43dbceee3..28741c97e 100644 --- a/integration-test-suite/cds-toolkit-integration-test/pom.xml +++ b/integration-test-suite/cds-toolkit-integration-test/pom.xml @@ -42,7 +42,7 @@ org.wso2.openbanking cds-toolkit-test-framework - ${com.wso2.openbanking.test.cds.version} + ${org.wso2.openbanking.test.cds.version} org.testng @@ -79,6 +79,16 @@ org.jsoup jsoup + + org.testng + testng + test + + + org.testng + testng + test + @@ -163,7 +173,7 @@ - 1.0.0 + 1.0.0 diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy index ba487b5a8..587944303 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy @@ -16,14 +16,14 @@ * under the License. */ -package com.wso2.cds.integration.test.accounts - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUIdEncryptorDecryptor -import com.wso2.cds.test.framework.utility.AUTestUtil +package org.wso2.cds.integration.test.accounts + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUIdEncryptorDecryptor +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.http.ContentType import io.restassured.response.Response import org.testng.annotations.BeforeClass @@ -51,7 +51,7 @@ class AccountsIdPermanenceTest extends AUTest { generateUserAccessToken() } - @Test(priority = 1) + @Test(priority = 1, groups = "SmokeTest") void "TC1201001_Get Accounts"() { String bulkAccountRequestUrl = "${AUConstants.BULK_ACCOUNT_PATH}" @@ -115,10 +115,10 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) softAssertion.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) - softAssertion.assertEquals(secondConsentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertNotNull(AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, "${AUConstants.RESPONSE_DATA_BULK_BALANCE_LIST}[0]"), secretKey). split(":")[2]) - softAssertion.assertEquals(consentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertNotNull(AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, "${AUConstants.RESPONSE_DATA_BULK_BALANCE_LIST}[1]"), secretKey). split(":")[2]) @@ -149,7 +149,7 @@ class AccountsIdPermanenceTest extends AUTest { SoftAssert softAssertion= new SoftAssert() softAssertion.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) softAssertion.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) - softAssertion.assertEquals(consentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertNotNull(AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, AUConstants.RESPONSE_DATA_SINGLE_ACCOUNTID), secretKey). split(":")[2]) softAssertion.assertTrue(AUTestUtil.parseResponseBody(response, AUConstants.LINKS_SELF) @@ -171,7 +171,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) softAssertion.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) - softAssertion.assertEquals(secondConsentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertNotNull(AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, "data.accountId"), secretKey). split(":")[2]) @@ -246,7 +246,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) softAssertion.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) - softAssertion.assertEquals(secondConsentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertNotNull(AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, "data.directDebitAuthorisations.accountId[0]"), secretKey). split(":")[2]) @@ -311,7 +311,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) softAssertion.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) - softAssertion.assertEquals(secondConsentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertNotNull(AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, "${AUConstants.RESPONSE_DATA_DIRECT_DEBIT_AUTH}.accountId[0]"), secretKey). split(":")[2]) @@ -347,7 +347,7 @@ class AccountsIdPermanenceTest extends AUTest { AUTestUtil.parseResponseBody(response, "${AUConstants.RESPONSE_DATA_SCHEDULE_PAY}.scheduledPaymentId[0]"), secretKey) .split(":")[0]) - softAssertion.assertEquals(secondConsentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertNotNull(AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, "${AUConstants.RESPONSE_DATA_SCHEDULE_PAY}.from.accountId[0]"), secretKey) .split(":")[2]) @@ -405,7 +405,7 @@ class AccountsIdPermanenceTest extends AUTest { AUTestUtil.parseResponseBody(response, "${AUConstants.RESPONSE_DATA_SCHEDULE_PAY}.scheduledPaymentId[0]"), secretKey) .split(":")[0]) - softAssertion.assertEquals(secondConsentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertNotNull(AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, "${AUConstants.RESPONSE_DATA_SCHEDULE_PAY}.from.accountId[0]"), secretKey) .split(":")[2]) @@ -448,7 +448,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) softAssertion.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) - softAssertion.assertEquals(secondConsentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertNotNull(AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, "${AUConstants.RESPONSE_DATA_TRANSACTION_LIST}.accountId[0]"), secretKey). split(":")[2]) softAssertion.assertEquals(userId, AUIdEncryptorDecryptor.decrypt(encryptedTransactionId, secretKey). @@ -483,7 +483,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) softAssertion.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) - softAssertion.assertEquals(secondConsentedAccount, AUIdEncryptorDecryptor.decrypt( + softAssertion.assertNotNull(AUIdEncryptorDecryptor.decrypt( AUTestUtil.parseResponseBody(response, AUConstants.RESPONSE_DATA_SINGLE_ACCOUNTID), secretKey). split(":")[2]) softAssertion.assertEquals(userId, AUIdEncryptorDecryptor.decrypt( diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy index 15e883f52..d9e7a3bd6 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsRetrievalRequestHeaderValidationTest.groovy @@ -16,18 +16,18 @@ * under the License. */ -package com.wso2.cds.integration.test.accounts +package org.wso2.cds.integration.test.accounts -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.data_provider.ConsentDataProviders -import com.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.data_provider.ConsentDataProviders +import org.wso2.cds.test.framework.request_builder.AURequestBuilder import io.restassured.http.ContentType import org.testng.Assert import org.testng.annotations.BeforeClass import org.testng.annotations.Test -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.asserts.SoftAssert import java.nio.charset.Charset @@ -378,7 +378,7 @@ class AccountsRetrievalRequestHeaderValidationTest extends AUTest { def response = AURequestBuilder.buildBasicRequestWithCustomHeaders(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) - .queryParam(AUConstants.PARAM_PRODUCT_CATEGORY, "TRANS") + .queryParam(AUConstants.PARAM_PRODUCT_CATEGORY, "TANS") .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) .get("${AUConstants.BULK_ACCOUNT_PATH}") @@ -474,12 +474,6 @@ class AccountsRetrievalRequestHeaderValidationTest extends AUTest { .get("${AUConstants.BULK_ACCOUNT_PATH}") Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) - - Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR), - AUConstants.INVALID_CLIENT) - Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), - "Invalid Credentials") - Assert.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) } @Test @@ -490,12 +484,6 @@ class AccountsRetrievalRequestHeaderValidationTest extends AUTest { .get("${AUConstants.BULK_ACCOUNT_PATH}") Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) - - Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR), - AUConstants.INVALID_CLIENT) - Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), - AUConstants.MISSING_CREDENTIALS) - Assert.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) } @Test (enabled = true, dataProvider = "AccountsRetrievalFlow", dataProviderClass = ConsentDataProviders.class) @@ -541,7 +529,7 @@ class AccountsRetrievalRequestHeaderValidationTest extends AUTest { } //TODO: Issue: https://github.com/wso2-enterprise/financial-open-banking/issues/7316 - @Test + @Test (enabled = false) void "OB-1190_Retrieve transaction list with invalid oldest-time"() { def response = AURequestBuilder.buildBasicRequestWithCustomHeaders(userAccessToken, @@ -562,7 +550,7 @@ class AccountsRetrievalRequestHeaderValidationTest extends AUTest { } //TODO: Issue: https://github.com/wso2-enterprise/financial-open-banking/issues/7316 - @Test + @Test (enabled = false) void "OB-1191_Retrieve transaction list with invalid newest-time"() { def response = AURequestBuilder.buildBasicRequestWithCustomHeaders(userAccessToken, @@ -639,15 +627,6 @@ class AccountsRetrievalRequestHeaderValidationTest extends AUTest { SoftAssert softAssertion= new SoftAssert() softAssertion.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) - - softAssertion.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_CODE), - AUConstants.ERROR_CODE_GENERAL_EXPECTED_ERROR) - softAssertion.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DETAIL), - AUConstants.INVALID_ACCEPT_HEADER) - softAssertion.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_TITLE), - AUConstants.ERROR_TITLE_GENERAL_EXPECTED_ERROR) - softAssertion.assertNotNull(response.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) - softAssertion.assertAll() } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsRetrievalRequestValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsRetrievalRequestValidationTests.groovy similarity index 96% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsRetrievalRequestValidationTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsRetrievalRequestValidationTests.groovy index 5b91ab410..15dcdb7a7 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/AccountsRetrievalRequestValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsRetrievalRequestValidationTests.groovy @@ -16,19 +16,18 @@ * under the License. */ -package com.wso2.cds.integration.test.accounts +package org.wso2.cds.integration.test.accounts import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.http.ContentType import io.restassured.response.Response import org.testng.Assert -import org.testng.ITestContext import org.testng.annotations.BeforeClass import org.testng.annotations.Test import org.testng.asserts.SoftAssert @@ -42,11 +41,26 @@ class AccountsRetrievalRequestValidationTests extends AUTest { def clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" def payeeId + String firstEncryptedAccountId + String secondEncryptedAccountId @BeforeClass(alwaysRun = true) void "Get User Access Token"() { doConsentAuthorisation() generateUserAccessToken() + + String bulkAccountRequestUrl = "${AUConstants.BULK_ACCOUNT_PATH}" + + def response = AURequestBuilder.buildBasicRequestWithCustomHeaders(userAccessToken, + AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get(bulkAccountRequestUrl) + + SoftAssert softAssertion= new SoftAssert() + softAssertion.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + firstEncryptedAccountId = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[0]") + secondEncryptedAccountId = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[1]") } @Test @@ -56,7 +70,7 @@ class AccountsRetrievalRequestValidationTests extends AUTest { { "data": { "accountIds": [ - "${AUConstants.accountID}", "${AUConstants.accountID}" + "${firstEncryptedAccountId}", "${secondEncryptedAccountId}" ] }, "meta": {} @@ -550,10 +564,6 @@ class AccountsRetrievalRequestValidationTests extends AUTest { .get("${AUConstants.CDS_PATH}/banking/accountz") Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_404) - Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_CODE), - AUConstants.ERROR_CODE_RESOURCE_NOTFOUND ) - Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_TITLE), - AUConstants.RESOURCE_NOT_FOUND) } @Test @@ -799,10 +809,10 @@ class AccountsRetrievalRequestValidationTests extends AUTest { .get(bulkAccountRequestUrl) Assert.assertEquals(responseSecondAttempt.statusCode(), AUConstants.STATUS_CODE_401) - Assert.assertEquals(AUTestUtil.parseResponseBody(responseSecondAttempt, AUConstants.ERROR_DESCRIPTION), + Assert.assertEquals(AUTestUtil.parseResponseBody(responseSecondAttempt, AUConstants.MESSAGE), AUConstants.INVALID_CREDENTIALS) - Assert.assertEquals(AUTestUtil.parseResponseBody(responseSecondAttempt, AUConstants.ERROR), - AUConstants.INVALID_CLIENT) + Assert.assertEquals(AUTestUtil.parseResponseBody(responseSecondAttempt, AUConstants.DESCRIPTION), + "Invalid Credentials. Make sure you have provided the correct security credentials") //Token introspection request def introspectResponse = AURequestBuilder.buildIntrospectionRequest(refreshToken.toString(), diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy similarity index 71% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy index 125bed110..3953792d4 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy @@ -16,17 +16,17 @@ * under the License. */ -package com.wso2.cds.integration.test.accounts +package org.wso2.cds.integration.test.accounts import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import org.testng.Assert import org.testng.annotations.Test @@ -38,6 +38,7 @@ import java.nio.charset.Charset class DuplicateCommonAuthIdTest extends AUTest { def clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" + private def accessTokenResponse @Test void "TC0202006_Initiate two authorisation consent flows on same browser session"() { @@ -50,7 +51,7 @@ class DuplicateCommonAuthIdTest extends AUTest { authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()).toURI().toString() - automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY, false) + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) .addStep { driver, context -> AutomationMethod authWebDriver = new AutomationMethod(driver) @@ -63,24 +64,23 @@ class DuplicateCommonAuthIdTest extends AUTest { //Click Authorise Button authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) - } - .execute(false) - response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, - true, "") - requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + //Get Code From Authorisation URL + authorisationCode = AUTestUtil.getCodeFromJwtResponse(driver.getCurrentUrl()) - authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), - auConfiguration.getAppInfoClientID()).toURI().toString() + //Generate User Access Token + accessTokenResponse = getUserAccessTokenResponse(clientId) + cdrArrangementId = accessTokenResponse.getCustomParameters().get(AUConstants.CDR_ARRANGEMENT_ID) - automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY, true) - .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) - .addStep { driver, context -> - driver.sessionId = sessionId - AutomationMethod authWebDriver = new AutomationMethod(driver) + // Send New PAR Request + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) - //Select Profile and Accounts - selectProfileAndAccount(authWebDriver, AUAccountProfile.INDIVIDUAL, true) + def newAuthoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), + auConfiguration.getAppInfoClientID()).toURI().toString() + + driver.navigate().to(newAuthoriseUrl) //Click Confirm Button authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) @@ -88,7 +88,7 @@ class DuplicateCommonAuthIdTest extends AUTest { //Click Authorise Button authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) } - .execute() + .execute(false) authorisationCode = AUTestUtil.getCodeFromJwtResponse(automationResponse.currentUrl.get()) Assert.assertNotNull(authorisationCode) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/MultiTppConsentValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/MultiTppConsentValidationTest.groovy similarity index 92% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/MultiTppConsentValidationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/MultiTppConsentValidationTest.groovy index 9c08f88e3..ce1880263 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/accounts/MultiTppConsentValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/MultiTppConsentValidationTest.groovy @@ -16,23 +16,22 @@ * under the License. */ -package com.wso2.cds.integration.test.accounts +package org.wso2.cds.integration.test.accounts -import com.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUConstants import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.cds.test.framework.constant.ContextConstants -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.openbanking.test.framework.automation.NavigationAutomationStep +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.openbanking.test.framework.automation.NavigationAutomationStep import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.AfterClass import org.testng.annotations.BeforeClass import org.testng.annotations.Test -import com.wso2.cds.test.framework.request_builder.AUAuthorisationBuilder -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.request_builder.AUAuthorisationBuilder +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil /** * Class contains Multi Tpp Consent Validation Tests. diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy similarity index 98% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy index c70fa90dd..a2e72617f 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy @@ -16,13 +16,13 @@ * under the License. */ -package com.wso2.cds.integration.test.admin_api +package org.wso2.cds.integration.test.admin_api -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/AuthorisationFlowCXValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/AuthorisationFlowCXValidationTest.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/AuthorisationFlowCXValidationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/AuthorisationFlowCXValidationTest.groovy index f7b0f43a3..bd705e3c4 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/AuthorisationFlowCXValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/AuthorisationFlowCXValidationTest.groovy @@ -16,17 +16,16 @@ * under the License. */ -package com.wso2.cds.integration.test.authflow - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AUAuthorisationBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod +package org.wso2.cds.integration.test.authflow + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import org.openqa.selenium.By import org.testng.Assert import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/AuthorisationFlowUIValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/AuthorisationFlowUIValidationTest.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/AuthorisationFlowUIValidationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/AuthorisationFlowUIValidationTest.groovy index fa57662ca..91e9b6fc7 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/AuthorisationFlowUIValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/AuthorisationFlowUIValidationTest.groovy @@ -15,17 +15,16 @@ * specific language governing permissions and limitations * under the License. */ -package com.wso2.cds.integration.test.authflow - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AUAuthorisationBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod +package org.wso2.cds.integration.test.authflow + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import org.openqa.selenium.By import org.testng.Assert import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/ConsentAmendmentFlowUIValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/ConsentAmendmentFlowUIValidationTest.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/ConsentAmendmentFlowUIValidationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/ConsentAmendmentFlowUIValidationTest.groovy index 8c99cd758..90b56c918 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/ConsentAmendmentFlowUIValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/ConsentAmendmentFlowUIValidationTest.groovy @@ -16,19 +16,19 @@ * under the License. */ -package com.wso2.cds.integration.test.authflow +package org.wso2.cds.integration.test.authflow import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import com.wso2.openbanking.test.framework.automation.NavigationAutomationStep +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.NavigationAutomationStep import org.openqa.selenium.By import org.openqa.selenium.support.ui.ExpectedConditions import org.openqa.selenium.support.ui.WebDriverWait diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/UserAuthenticationFlowValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/UserAuthenticationFlowValidationTest.groovy similarity index 94% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/UserAuthenticationFlowValidationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/UserAuthenticationFlowValidationTest.groovy index 09316f9f2..953e700ce 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/authflow/UserAuthenticationFlowValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/authflow/UserAuthenticationFlowValidationTest.groovy @@ -16,23 +16,20 @@ * under the License. */ -package com.wso2.cds.integration.test.authflow - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AUAuthorisationBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import com.wso2.openbanking.test.framework.automation.NavigationAutomationStep +package org.wso2.cds.integration.test.authflow + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.NavigationAutomationStep import org.openqa.selenium.support.ui.ExpectedConditions import org.openqa.selenium.support.ui.WebDriverWait import java.util.concurrent.TimeUnit import org.openqa.selenium.By -import org.openqa.selenium.WebElement import org.testng.Assert import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/banking_products/ProductRetrievalHeaderValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/banking_products/ProductRetrievalHeaderValidationTest.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/banking_products/ProductRetrievalHeaderValidationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/banking_products/ProductRetrievalHeaderValidationTest.groovy index 7f6765936..5229d8eb7 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/banking_products/ProductRetrievalHeaderValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/banking_products/ProductRetrievalHeaderValidationTest.groovy @@ -16,13 +16,13 @@ * under the License. */ -package com.wso2.cds.integration.test.banking_products +package org.wso2.cds.integration.test.banking_products -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.BeforeClass @@ -37,12 +37,6 @@ class ProductRetrievalHeaderValidationTest extends AUTest { def clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" - @BeforeClass(alwaysRun = true) - void "Get User Access Token"() { - doConsentAuthorisation() - generateUserAccessToken() - } - @Test void "TC1101004_Retrieve banking products with unsupported x-v header"() { diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy index 0d7943553..d202962dd 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy @@ -16,12 +16,12 @@ * under the License. */ -package com.wso2.cds.integration.test.banking_products +package org.wso2.cds.integration.test.banking_products -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.BeforeClass @@ -36,12 +36,6 @@ class ProductRetrievalValidationTest extends AUTest { def clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" - @BeforeClass(alwaysRun = true) - void "Get User Access Token"() { - doConsentAuthorisation() - generateUserAccessToken() - } - @Test (priority = 1, groups = "SmokeTest") void "TC1101001_Retrieve banking products"() { @@ -160,7 +154,8 @@ class ProductRetrievalValidationTest extends AUTest { Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.LINKS_LAST)) } - @Test + //TODO: Git issue : https://github.com/wso2-enterprise/financial-open-banking/issues/5638 + @Test (enabled = false) void "TC1101021_Retrieve banking products with invalid updated-since value"() { def updatedSince = AUConstants.DATE_FORMAT @@ -200,6 +195,7 @@ class ProductRetrievalValidationTest extends AUTest { Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_TITLE), AUConstants.INVALID_FIELD) } + //Product Issue @Test void "TC1101027_Retrieve Product list with undefined query parameter"() { @@ -245,6 +241,7 @@ class ProductRetrievalValidationTest extends AUTest { Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.LINKS_LAST)) } + //Product Issue @Test void "TC1101031_Retrieve product list with invalid product-category value"() { diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy index 7a7b24d88..e5429e9e0 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy @@ -16,19 +16,19 @@ * under the License. */ -package com.wso2.cds.integration.test.cdr_arrangement - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod +package org.wso2.cds.integration.test.cdr_arrangement + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.Test @@ -167,7 +167,7 @@ class ConcurrentConsentTest extends AUTest { .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) .get("${AUConstants.BULK_ACCOUNT_PATH}") - Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_403) //validate token def introspectResponse = AURequestBuilder.buildIntrospectionRequest(userAccessToken, @@ -177,7 +177,6 @@ class ConcurrentConsentTest extends AUTest { Assert.assertTrue((introspectResponse.jsonPath().get("active")).equals(false)) } - //TODO: https://github.com/wso2-enterprise/ob-compliance-toolkit-cds/issues/424 @Test (dependsOnMethods = "TC0902001_Revoke consent using cdr management endpoint") void "CDS-147_Invoke cdr management endpoint with previously revoked cdr_arrangement_id"() { @@ -197,7 +196,6 @@ class ConcurrentConsentTest extends AUTest { .post("${AUConstants.CDR_ARRANGEMENT_ENDPOINT}") Assert.assertEquals(revocationResponse.statusCode(), AUConstants.STATUS_CODE_422) - Assert.assertNotNull(revocationResponse.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) Assert.assertEquals(AUTestUtil.parseResponseBody(revocationResponse, AUConstants.ERROR_CODE), AUConstants.ERROR_CODE_INVALID_ARRANGEMENT) @@ -400,7 +398,6 @@ class ConcurrentConsentTest extends AUTest { .post("${AUConstants.CDR_ARRANGEMENT_ENDPOINT}") Assert.assertEquals(revocationResponse.statusCode(), AUConstants.STATUS_CODE_422) - Assert.assertNotNull(revocationResponse.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) Assert.assertEquals(AUTestUtil.parseResponseBody(revocationResponse, AUConstants.ERROR_CODE), AUConstants.ERROR_CODE_INVALID_ARRANGEMENT) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy index 221894be6..858e35ed6 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy @@ -15,18 +15,17 @@ * specific language governing permissions and limitations * under the License. */ -package com.wso2.cds.integration.test.clientRegistration - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.ContextConstants -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +package org.wso2.cds.integration.test.clientRegistration + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.ContextConstants +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.http.ContentType import org.testng.Assert -import org.testng.annotations.AfterClass import org.testng.annotations.BeforeClass import org.testng.annotations.Test import org.testng.ITestContext @@ -42,11 +41,12 @@ import java.time.ZoneOffset class DynamicClientRegistrationCreateTest extends AUTest{ AUJWTGenerator generator = new AUJWTGenerator() - String clientId + String clientId, softwareId @BeforeClass void "Delete Application if exists"() { deleteApplicationIfExists(auConfiguration.getAppInfoClientID()) + softwareId = "SP1" } @Test(priority = 1,dependsOnMethods = "TC0101008_Verify Dynamic client registration test") @@ -200,10 +200,10 @@ class DynamicClientRegistrationCreateTest extends AUTest{ AUConstants.DCR_WITHOUT_SSA) } - @Test + @Test (priority = 2) void "TC0101012_Create application without ID Token Encrypted Response Algorithm"(ITestContext context) { - deleteApplicationIfExists(clientId) + deleteApplicationIfExists(auConfiguration.getAppInfoClientID()) AUConfigurationService auConfiguration = new AUConfigurationService() AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() @@ -221,10 +221,10 @@ class DynamicClientRegistrationCreateTest extends AUTest{ deleteApplicationIfExists(clientId) } - @Test + @Test (priority = 2) void "TC0101013_Create application without ID Token Encrypted Response Encryption Method"(ITestContext context) { - deleteApplicationIfExists(clientId) + deleteApplicationIfExists(auConfiguration.getAppInfoClientID()) AUConfigurationService auConfiguration = new AUConfigurationService() AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() @@ -290,10 +290,10 @@ class DynamicClientRegistrationCreateTest extends AUTest{ "Invalid issuer") } - @Test + @Test (priority = 2) void "TC0101017_Create application with a replayed JTI value in JWT request"() { - deleteApplicationIfExists(clientId) + deleteApplicationIfExists(auConfiguration.getAppInfoClientID()) jtiVal = String.valueOf(System.currentTimeMillis()) AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() def registrationResponse = AURegistrationRequestBuilder @@ -399,7 +399,7 @@ class DynamicClientRegistrationCreateTest extends AUTest{ "Malformed request JWT") } - @Test(priority = 2) + @Test (priority = 2) void "OB-1165_Create application without request_object_signing_alg"(ITestContext context) { AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() @@ -430,10 +430,10 @@ class DynamicClientRegistrationCreateTest extends AUTest{ deleteApplicationIfExists(context.getAttribute(ContextConstants.CLIENT_ID).toString()) } - @Test + @Test (priority = 2) void "OB-1166_Create application without redirect_uris"(ITestContext context) { - deleteApplicationIfExists(clientId) + deleteApplicationIfExists(auConfiguration.getAppInfoClientID()) AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() def registrationResponse = AURegistrationRequestBuilder .buildRegistrationRequest(dcr.getRegularClaimsWithoutRedirectUris()) @@ -502,6 +502,8 @@ class DynamicClientRegistrationCreateTest extends AUTest{ @Test void "CDS-1106_Create application without ApplicationType"() { + deleteApplicationIfExists(auConfiguration.getAppInfoClientID()) + AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() def registrationResponse = AURegistrationRequestBuilder .buildRegistrationRequest(dcr.getRegularClaimsWithoutApplicationType()) @@ -509,6 +511,7 @@ class DynamicClientRegistrationCreateTest extends AUTest{ .post(AUConstants.DCR_REGISTRATION_ENDPOINT) Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_201) + clientId = AUTestUtil.parseResponseBody(registrationResponse, AUConstants.CLIENT_ID) deleteApplicationIfExists(clientId) } @@ -522,12 +525,12 @@ class DynamicClientRegistrationCreateTest extends AUTest{ AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() def registrationResponse = AURegistrationRequestBuilder .buildRegistrationRequest(registrationRequestBuilder - .getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), AUTestUtil.readFileContent(filePath), + .getAURegularClaims(softwareId, AUTestUtil.readFileContent(filePath), AUConstants.LOCALHOST_REDIRECT_URL)) .when() .post(AUConstants.DCR_REGISTRATION_ENDPOINT) - clientId = AUTestUtil.parseResponseBody(registrationResponse, AUConstants.CLIENT_ID) + def appClientId = AUTestUtil.parseResponseBody(registrationResponse, AUConstants.CLIENT_ID) context.setAttribute(ContextConstants.CLIENT_ID,clientId) AUTestUtil.writeToConfigFile(clientId) @@ -538,7 +541,7 @@ class DynamicClientRegistrationCreateTest extends AUTest{ Assert.assertTrue(parseResponseBody(registrationResponse, "redirect_uris") .contains(AUConstants.LOCALHOST_REDIRECT_URL)) - deleteApplicationIfExists(clientId) + deleteApplicationIfExists(appClientId) } @Test @@ -551,7 +554,7 @@ class DynamicClientRegistrationCreateTest extends AUTest{ AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() def registrationResponse = AURegistrationRequestBuilder .buildRegistrationRequest(registrationRequestBuilder - .getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), AUTestUtil.readFileContent(filePath), + .getAURegularClaims(softwareId, AUTestUtil.readFileContent(filePath), AUConstants.LOCALHOST_REDIRECT_URL)) .when() .post(AUConstants.DCR_REGISTRATION_ENDPOINT) @@ -573,7 +576,7 @@ class DynamicClientRegistrationCreateTest extends AUTest{ AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() def registrationResponse = AURegistrationRequestBuilder .buildRegistrationRequest(registrationRequestBuilder - .getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), AUTestUtil.readFileContent(filePath), + .getAURegularClaims(softwareId, AUTestUtil.readFileContent(filePath), AUConstants.LOCALHOST_REDIRECT_URL)) .when() .post(AUConstants.DCR_REGISTRATION_ENDPOINT) @@ -636,7 +639,7 @@ class DynamicClientRegistrationCreateTest extends AUTest{ @Test (priority = 2, groups = "SmokeTest") void "CDS-476_Create application without ID_Token Response Type and verify id_token encryption not Mandatory"() { - deleteApplicationIfExists(clientId) + deleteApplicationIfExists(auConfiguration.getAppInfoClientID()) AUConfigurationService auConfiguration = new AUConfigurationService() AURegistrationRequestBuilder dcr = new AURegistrationRequestBuilder() diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy similarity index 86% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy index ba90c5cba..762f60a85 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationDeleteTest.groovy @@ -16,17 +16,16 @@ * under the License. */ -package com.wso2.cds.integration.test.clientRegistration - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.ContextConstants -import com.wso2.cds.test.framework.data_provider.ConsentDataProviders -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +package org.wso2.cds.integration.test.clientRegistration + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.ContextConstants +import org.wso2.cds.test.framework.data_provider.ConsentDataProviders +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert -import org.testng.annotations.AfterClass import org.testng.annotations.Test import org.testng.ITestContext @@ -89,7 +88,6 @@ class DynamicClientRegistrationDeleteTest extends AUTest { .request(httpMethod.toString(), AUConstants.DCR_REGISTRATION_ENDPOINT + clientId) Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_405) - Assert.assertNotNull(registrationResponse.getHeader(AUConstants.X_FAPI_INTERACTION_ID)) } @Test(dependsOnMethods = "TC0101009_Verify Get Application Access Token", priority = 2, dataProvider = "unsupportedHttpMethods", diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy similarity index 80% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy index 053b348fc..fbd488e19 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy @@ -16,19 +16,14 @@ * under the License. */ -package com.wso2.cds.integration.test.clientRegistration - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.ContextConstants -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.configuration.OBConfigParser -import com.wso2.openbanking.test.framework.constant.OBConstants -import com.wso2.openbanking.test.framework.utility.RestAsRequestBuilder +package org.wso2.cds.integration.test.clientRegistration + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.ContextConstants +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert -import org.testng.annotations.AfterClass import org.testng.annotations.Test import org.testng.ITestContext diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy similarity index 87% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy index 6d4c8a8ab..74fbe7039 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationUpdateTest.groovy @@ -15,18 +15,17 @@ * specific language governing permissions and limitations * under the License. */ -package com.wso2.cds.integration.test.clientRegistration - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.ContextConstants -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +package org.wso2.cds.integration.test.clientRegistration + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.ContextConstants +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert -import org.testng.annotations.AfterClass import org.testng.annotations.BeforeClass import org.testng.annotations.Test import org.testng.ITestContext @@ -41,6 +40,7 @@ class DynamicClientRegistrationUpdateTest extends AUTest{ private String registrationPath = AUConstants.DCR_REGISTRATION_ENDPOINT private String invalidClientId = "invalidclientid" + private String softwareId = "SP1" @BeforeClass(alwaysRun = true) void "Initialize Test Suite"(ITestContext context) { @@ -188,18 +188,28 @@ class DynamicClientRegistrationUpdateTest extends AUTest{ Path dcrArtifactsPath = Paths.get(auConfiguration.getAppDCRSSAPath()) String filePath = Paths.get(dcrArtifactsPath.getParent().toString(), "ssa_localhost.txt") - accessToken = getApplicationAccessToken(clientId) + jtiVal = String.valueOf(System.currentTimeMillis()) + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder + .getAURegularClaims(softwareId, AUTestUtil.readFileContent(filePath), + AUConstants.LOCALHOST_REDIRECT_URL)) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + def appClientId = AUTestUtil.parseResponseBody(registrationResponse, AUConstants.CLIENT_ID) + + accessToken = getApplicationAccessToken(appClientId) Assert.assertNotNull(accessToken) AUJWTGenerator aujwtGenerator =new AUJWTGenerator() - AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() - def registrationResponse = AURegistrationRequestBuilder + registrationResponse = AURegistrationRequestBuilder .buildRegistrationRequest(registrationRequestBuilder - .getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), AUTestUtil.readFileContent(filePath), + .getAURegularClaims(softwareId, AUTestUtil.readFileContent(filePath), AUConstants.LOCALHOST_REDIRECT_URL)) .header(AUConstants.AUTHORIZATION_HEADER_KEY, "${AUConstants.AUTHORIZATION_BEARER_TAG}${accessToken}") .when() - .put(registrationPath + clientId) + .put(registrationPath + appClientId) Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_200) Assert.assertEquals(parseResponseBody(registrationResponse, "software_statement"), @@ -207,7 +217,7 @@ class DynamicClientRegistrationUpdateTest extends AUTest{ Assert.assertTrue(parseResponseBody(registrationResponse, "redirect_uris") .contains(AUConstants.LOCALHOST_REDIRECT_URL)) - deleteApplicationIfExists(clientId) + deleteApplicationIfExists(appClientId) } @Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/MultiTppDcrEndpointTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/MultiTppDcrEndpointTests.groovy similarity index 88% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/MultiTppDcrEndpointTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/MultiTppDcrEndpointTests.groovy index 9f86426a9..1ce564295 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/clientRegistration/MultiTppDcrEndpointTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/MultiTppDcrEndpointTests.groovy @@ -16,16 +16,13 @@ * under the License. */ -package com.wso2.cds.integration.test.clientRegistration - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUMockCDRIntegrationUtil -import com.wso2.cds.test.framework.utility.AUTestUtil +package org.wso2.cds.integration.test.clientRegistration + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.AfterClass import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalHeaderValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalHeaderValidationTests.groovy similarity index 98% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalHeaderValidationTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalHeaderValidationTests.groovy index 97e727f07..241034f32 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalHeaderValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalHeaderValidationTests.groovy @@ -16,15 +16,14 @@ * under the License. */ -package com.wso2.cds.integration.test.common_api - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import io.restassured.http.ContentType +package org.wso2.cds.integration.test.common_api + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalTest.groovy similarity index 96% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalTest.groovy index 5247eba0d..078a44944 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/common_api/CustomerDetailsRetrievalTest.groovy @@ -16,13 +16,13 @@ * under the License. */ -package com.wso2.cds.integration.test.common_api +package org.wso2.cds.integration.test.common_api -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataAccountRetrieval.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataAccountRetrieval.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataAccountRetrieval.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataAccountRetrieval.groovy index 12f322cc8..7dbbbdfba 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataAccountRetrieval.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataAccountRetrieval.groovy @@ -16,11 +16,11 @@ * under the License. */ -package com.wso2.cds.integration.test.metadata_update +package org.wso2.cds.integration.test.metadata_update -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataConsentAmendment.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataConsentAmendment.groovy similarity index 87% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataConsentAmendment.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataConsentAmendment.groovy index 0d77d5ee9..767498a41 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataConsentAmendment.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataConsentAmendment.groovy @@ -16,20 +16,17 @@ * under the License. */ -package com.wso2.cds.integration.test.metadata_update +package org.wso2.cds.integration.test.metadata_update import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import org.openqa.selenium.By +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import org.testng.Assert -import org.testng.annotations.AfterClass import org.testng.annotations.BeforeClass import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataConsentAuthorization.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataConsentAuthorization.groovy similarity index 96% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataConsentAuthorization.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataConsentAuthorization.groovy index becbd948d..3eb148027 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataConsentAuthorization.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataConsentAuthorization.groovy @@ -16,13 +16,13 @@ * under the License. */ -package com.wso2.cds.integration.test.metadata_update +package org.wso2.cds.integration.test.metadata_update -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.NavigationAutomationStep +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.NavigationAutomationStep import org.testng.Assert import org.testng.annotations.BeforeClass import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataConsentWithdrawal.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataConsentWithdrawal.groovy similarity index 98% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataConsentWithdrawal.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataConsentWithdrawal.groovy index 3e9fe1a28..900385972 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataConsentWithdrawal.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataConsentWithdrawal.groovy @@ -16,12 +16,12 @@ * under the License. */ -package com.wso2.cds.integration.test.metadata_update +package org.wso2.cds.integration.test.metadata_update import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataUpdateBatchTaskTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataUpdateBatchTaskTests.groovy similarity index 96% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataUpdateBatchTaskTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataUpdateBatchTaskTests.groovy index 589c32912..38221c6fd 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/metadata_update/MetaDataUpdateBatchTaskTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/metadata_update/MetaDataUpdateBatchTaskTests.groovy @@ -16,17 +16,15 @@ * under the License. */ -package com.wso2.cds.integration.test.metadata_update +package org.wso2.cds.integration.test.metadata_update import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.response.Response import org.testng.Assert -import org.testng.annotations.AfterClass import org.testng.annotations.BeforeClass import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy similarity index 96% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy index d94c5c39f..9e7b5692c 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/throttling/ThrottlingPolicyTest.groovy @@ -16,13 +16,13 @@ * under the License. */ -package com.wso2.cds.integration.test.throttling +package org.wso2.cds.integration.test.throttling -import com.nimbusds.oauth2.sdk.Scope -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.BeforeClass import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy index ea7662e15..256386ed9 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy @@ -16,14 +16,14 @@ * under the License. */ -package com.wso2.cds.integration.test.tokenEndpoint +package org.wso2.cds.integration.test.tokenEndpoint import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import java.nio.charset.Charset import org.testng.Assert import org.testng.annotations.Test @@ -71,8 +71,8 @@ class AccessTokenTest extends AUTest { def errorObject = AURequestBuilder.getUserTokenErrorResponse(authorisationCode, auConfiguration.getAppInfoRedirectURL(), auConfiguration.getAppInfoClientID(), true, false) - Assert.assertEquals(errorObject.toJSONObject().get(AUConstants.ERROR_DESCRIPTION), "Valid transport " + - "certificate not found in the request") + Assert.assertEquals(errorObject.toJSONObject().get(AUConstants.ERROR_DESCRIPTION), "Transport certificate " + + "not found in the request") } @Test @@ -340,10 +340,8 @@ class AccessTokenTest extends AUTest { def response = tokenResponse.toErrorResponse() Assert.assertEquals(response.toHTTPResponse().statusCode, AUConstants.STATUS_CODE_401) - Assert.assertEquals(response.toHTTPResponse().getAt(AUConstants.ERROR_DESCRIPTION), + Assert.assertEquals(response.errorObject.description, "Request Parameter 'client_id' does not match the 'sub' claim in the client_assertion") - Assert.assertEquals(response.toHTTPResponse().getAt(AUConstants.ERROR), AUConstants.INVALID_CLIENT) - - Assert.assertNotNull(user_AccessToken) + Assert.assertEquals(response.errorObject.code, AUConstants.INVALID_CLIENT) } } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tokenEndpoint/MultiTppTokenFlowValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tokenEndpoint/MultiTppTokenFlowValidationTests.groovy similarity index 86% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tokenEndpoint/MultiTppTokenFlowValidationTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tokenEndpoint/MultiTppTokenFlowValidationTests.groovy index 529cb0e1e..a7e07e8e6 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tokenEndpoint/MultiTppTokenFlowValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tokenEndpoint/MultiTppTokenFlowValidationTests.groovy @@ -16,15 +16,13 @@ * under the License. */ -package com.wso2.cds.integration.test.tokenEndpoint - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUMockCDRIntegrationUtil -import com.wso2.cds.test.framework.utility.AUTestUtil +package org.wso2.cds.integration.test.tokenEndpoint + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.AfterClass import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy similarity index 84% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy index 04eae221b..95b63da8d 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy @@ -16,14 +16,14 @@ * under the License. */ -package com.wso2.cds.integration.test.tpponboarding +package org.wso2.cds.integration.test.tpponboarding -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.ContextConstants -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.ContextConstants +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.ITestContext import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy index 10541d1d7..efedde36f 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy @@ -16,25 +16,22 @@ * under the License. */ -package com.wso2.cds.keymanager.test.authorizationflow +package org.wso2.cds.keymanager.test.authorizationflow import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.nimbusds.oauth2.sdk.AuthorizationRequest import com.nimbusds.oauth2.sdk.ResponseMode import com.nimbusds.oauth2.sdk.ResponseType -import com.nimbusds.oauth2.sdk.id.ClientID -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import com.wso2.openbanking.test.framework.automation.NavigationAutomationStep -import io.restassured.http.ContentType +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.NavigationAutomationStep import org.openqa.selenium.By import org.testng.Assert import org.testng.annotations.Test @@ -520,10 +517,12 @@ class AuthorisationFlowTest extends AUTest { Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), errorMessage) } + //Error - Not loading Profile Selection Page @Test void "OB-1253_Initiate authorisation consent flow only with openid and profile scopes"() { scopes = [ + AUAccountScope.OPENID, AUAccountScope.PROFILE ] @@ -837,7 +836,7 @@ class AuthorisationFlowTest extends AUTest { authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()).toURI().toString() - String errorMessage = "Redirect URI is not present in the authorization request" + String errorMessage = "invalid.redirect.uri" def automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) .addStep(new NavigationAutomationStep(authoriseUrl, 10)) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy index 0c3e216f3..0b87e129b 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/ConsentAmendmentFlowTest.groovy @@ -16,21 +16,20 @@ * under the License. */ -package com.wso2.cds.keymanager.test.authorizationflow +package org.wso2.cds.keymanager.test.authorizationflow import com.nimbusds.oauth2.sdk.AccessTokenResponse import com.nimbusds.oauth2.sdk.TokenErrorResponse import com.nimbusds.oauth2.sdk.token.RefreshToken -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import com.wso2.openbanking.test.framework.automation.NavigationAutomationStep +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.Test @@ -242,7 +241,7 @@ class ConsentAmendmentFlowTest extends AUTest{ @Test(dependsOnMethods = "CDS-977_Verify Consent Amendment flow when both sharing duration and scope has been amended") void "CDS-982_Verify regenerate Access Token using Refresh Token for amended Consent"() { - RefreshToken refreshToken = new RefreshToken(secondRefreshToken) + RefreshToken refreshToken = new RefreshToken(secondRefreshToken.toString()) AccessTokenResponse userAccessToken = getUserAccessTokenFormRefreshToken(refreshToken) Assert.assertNotNull(userAccessToken.tokens.accessToken) } @@ -371,7 +370,7 @@ class ConsentAmendmentFlowTest extends AUTest{ secondUserAccessToken = accessTokenResponse2.tokens.accessToken secondRefreshToken = accessTokenResponse2.tokens.refreshToken - sleep(70000) + sleep(90000) //Verify the status of the refresh token AccessTokenResponse userAccessToken3 = AURequestBuilder.getUserTokenFromRefreshTokenErrorResponse(secondRefreshToken as RefreshToken) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/SharingDurationValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/SharingDurationValidationTest.groovy similarity index 94% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/SharingDurationValidationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/SharingDurationValidationTest.groovy index 9a7c7f5a6..466e78fe7 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/authorizationflow/SharingDurationValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/SharingDurationValidationTest.groovy @@ -16,14 +16,13 @@ * under the License. */ -package com.wso2.cds.keymanager.test.authorizationflow +package org.wso2.cds.keymanager.test.authorizationflow import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.NavigationAutomationStep +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/BnrEndToEndTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/BnrEndToEndTest.groovy similarity index 87% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/BnrEndToEndTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/BnrEndToEndTest.groovy index b3079411b..59b0bff9b 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/BnrEndToEndTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/BnrEndToEndTest.groovy @@ -16,16 +16,16 @@ * under the License. */ -package com.wso2.cds.keymanager.test.bnr +package org.wso2.cds.keymanager.test.bnr -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUBusinessUserPermission -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.data_provider.ConsentDataProviders -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUBusinessUserPermission +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.data_provider.ConsentDataProviders +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.BeforeClass import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/ConsentAmendmentFlowTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAmendmentFlowTests.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/ConsentAmendmentFlowTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAmendmentFlowTests.groovy index aa67fcc05..ce84fd10b 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/ConsentAmendmentFlowTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAmendmentFlowTests.groovy @@ -16,19 +16,19 @@ * under the License. */ -package com.wso2.cds.keymanager.test.bnr +package org.wso2.cds.keymanager.test.bnr import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUBusinessUserPermission -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUBusinessUserPermission +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import org.testng.Assert import org.testng.annotations.BeforeClass import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy similarity index 98% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy index 5a5b10b18..ea5c3de3d 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy @@ -16,16 +16,16 @@ * under the License. */ -package com.wso2.cds.keymanager.test.bnr - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUBusinessUserPermission -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod +package org.wso2.cds.keymanager.test.bnr + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUBusinessUserPermission +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import org.openqa.selenium.By import org.openqa.selenium.WebElement import org.testng.Assert diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/UserNominationManagementTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/UserNominationManagementTests.groovy similarity index 98% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/UserNominationManagementTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/UserNominationManagementTests.groovy index a5bd44460..e79a0d1cb 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/bnr/UserNominationManagementTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/UserNominationManagementTests.groovy @@ -16,14 +16,14 @@ * under the License. */ -package com.wso2.cds.keymanager.test.bnr - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUBusinessUserPermission -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPayloads -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +package org.wso2.cds.keymanager.test.bnr + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUBusinessUserPermission +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPayloads +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/doms/DisclosureOptionManagementServiceTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/doms/DisclosureOptionManagementServiceTest.groovy similarity index 96% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/doms/DisclosureOptionManagementServiceTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/doms/DisclosureOptionManagementServiceTest.groovy index d85ec40c1..6893d37f3 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/doms/DisclosureOptionManagementServiceTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/doms/DisclosureOptionManagementServiceTest.groovy @@ -16,19 +16,19 @@ * under the License. */ -package com.wso2.cds.keymanager.test.doms +package org.wso2.cds.keymanager.test.doms import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUDOMSStatus -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUIdEncryptorDecryptor -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUDOMSStatus +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUIdEncryptorDecryptor +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy similarity index 93% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy index c04c194ef..b659216eb 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy @@ -16,16 +16,14 @@ * under the License. */ -package com.wso2.cds.keymanager.test.jarm +package org.wso2.cds.keymanager.test.jarm import com.nimbusds.jwt.JWTClaimsSet import com.nimbusds.oauth2.sdk.ResponseMode import com.nimbusds.oauth2.sdk.ResponseType -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy similarity index 94% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy index 9abff5212..744460d4a 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy @@ -16,15 +16,14 @@ * under the License. */ -package com.wso2.cds.keymanager.test.jarm +package org.wso2.cds.keymanager.test.jarm import com.nimbusds.jwt.JWTClaimsSet import com.nimbusds.oauth2.sdk.ResponseMode import com.nimbusds.oauth2.sdk.ResponseType -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy similarity index 93% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy index 05d4ee845..1cff6a34b 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy @@ -16,16 +16,15 @@ * under the License. */ -package com.wso2.cds.keymanager.test.jarm +package org.wso2.cds.keymanager.test.jarm import com.nimbusds.jwt.JWTClaimsSet import com.nimbusds.oauth2.sdk.ResponseMode import com.nimbusds.oauth2.sdk.ResponseType -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy similarity index 92% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy index f7a44bcb1..719ecceb6 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy @@ -16,15 +16,14 @@ * under the License. */ -package com.wso2.cds.keymanager.test.jarm +package org.wso2.cds.keymanager.test.jarm import com.nimbusds.jwt.JWTClaimsSet import com.nimbusds.oauth2.sdk.ResponseMode import com.nimbusds.oauth2.sdk.ResponseType -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JwtSecuredAuthorizationResponseValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JwtSecuredAuthorizationResponseValidationTests.groovy similarity index 92% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JwtSecuredAuthorizationResponseValidationTests.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JwtSecuredAuthorizationResponseValidationTests.groovy index 5efa96cb6..755af08d9 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/jarm/JwtSecuredAuthorizationResponseValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JwtSecuredAuthorizationResponseValidationTests.groovy @@ -16,16 +16,16 @@ * under the License. */ -package com.wso2.cds.keymanager.test.jarm +package org.wso2.cds.keymanager.test.jarm import com.nimbusds.jose.JWSHeader import com.nimbusds.jwt.JWTClaimsSet import com.nimbusds.oauth2.sdk.ResponseMode import com.nimbusds.oauth2.sdk.ResponseType -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator import org.testng.Assert import org.testng.annotations.Test import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy index 90caaf03e..f32dbbbd4 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy @@ -16,23 +16,22 @@ * under the License. */ -package com.wso2.cds.keymanager.test.par +package org.wso2.cds.keymanager.test.par import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.nimbusds.oauth2.sdk.ResponseMode import com.nimbusds.oauth2.sdk.ResponseType -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import com.wso2.openbanking.test.framework.automation.NavigationAutomationStep +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.NavigationAutomationStep import io.restassured.RestAssured import io.restassured.response.Response import org.testng.Assert diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy similarity index 88% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy index ec5c14442..840b85007 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/par/RequestObjectValidationTest.groovy @@ -16,18 +16,13 @@ * under the License. */ -package com.wso2.cds.keymanager.test.par +package org.wso2.cds.keymanager.test.par import com.nimbusds.oauth2.sdk.ResponseMode -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import org.openqa.selenium.By +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.Test @@ -106,9 +101,8 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.removeClaimsFromRequestObject(claims, "aud") - String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), AUConstants.MISSING_AUD_VALUE) @@ -124,9 +118,8 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.removeClaimsFromRequestObject(claims, "iss") - String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), AUConstants.MISSING_ISS_VALUE) @@ -143,9 +136,7 @@ class RequestObjectValidationTest extends AUTest { String modifiedClaimSet = generator.removeClaimsFromRequestObject(claims, "exp") - String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), AUConstants.MISSING_EXP_VALUE) @@ -161,9 +152,8 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.removeClaimsFromRequestObject(claims, "nbf") - String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), AUConstants.MISSING_NBF_VALUE) @@ -179,9 +169,7 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString(), ResponseMode.JWT.toString(), Instant.now().minus(1, ChronoUnit.HOURS)) - String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() - - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -199,9 +187,7 @@ class RequestObjectValidationTest extends AUTest { auConfiguration.getAppInfoClientID(), auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString(), ResponseMode.JWT.toString(), time, time) - String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() - - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -219,9 +205,7 @@ class RequestObjectValidationTest extends AUTest { auConfiguration.getAppInfoClientID(), auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString(), ResponseMode.JWT.toString(), time) - String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() - - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -238,9 +222,7 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.removeClaimsFromRequestObject(claims, "redirect_uri") - - String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -258,8 +240,7 @@ class RequestObjectValidationTest extends AUTest { String modifiedClaimSet = generator.addClaimsFromRequestObject(claims, "redirect_uri", "https://www.google.com") - String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -275,8 +256,7 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString()) - String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI)) @@ -290,8 +270,7 @@ class RequestObjectValidationTest extends AUTest { auConfiguration.getAppInfoClientID(), auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString()) - String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -310,9 +289,8 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.addClaimsFromRequestObject(claims, "exp", expiryDate) - String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -329,9 +307,8 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getState().toString()) String modifiedClaimSet = generator.addClaimsFromRequestObject(claims, "aud", "123") - String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) Assert.assertEquals(AUTestUtil.parseResponseBody(response, AUConstants.ERROR_DESCRIPTION), @@ -347,8 +324,7 @@ class RequestObjectValidationTest extends AUTest { auAuthorisationBuilder.getResponseType().toString(), true, auAuthorisationBuilder.getState().toString()) - String signedRequest = generator.getSignedAuthRequestObject(claims).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(claims) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI)) @@ -364,9 +340,8 @@ class RequestObjectValidationTest extends AUTest { def audienceValue = AUConstants.PUSHED_AUTHORISATION_BASE_PATH + AUConstants.PAR_ENDPOINT String modifiedClaimSet = generator.addClaimsFromRequestObject(claims, "aud", audienceValue) - String signedRequest = generator.getSignedAuthRequestObject(modifiedClaimSet).serialize() - def response = auAuthorisationBuilder.doPushAuthorisationRequest(signedRequest) + def response = auAuthorisationBuilder.doPushAuthorisationRequest(modifiedClaimSet) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI)) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy similarity index 96% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy index bfbde3851..9d357d519 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy @@ -16,18 +16,18 @@ * under the License. */ -package com.wso2.cds.keymanager.test.secondaryUser +package org.wso2.cds.keymanager.test.secondaryUser import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy index 7e2ad5895..0fa42ec80 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy @@ -16,12 +16,12 @@ * under the License. */ -package com.wso2.cds.keymanager.test.secondaryUser +package org.wso2.cds.keymanager.test.secondaryUser -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import io.restassured.response.Response import org.testng.Assert import org.testng.annotations.BeforeClass diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy index ee624eaac..56ad7c853 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy @@ -16,16 +16,16 @@ * under the License. */ -package com.wso2.cds.keymanager.test.secondaryUser +package org.wso2.cds.keymanager.test.secondaryUser import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import org.testng.Assert import org.testng.annotations.BeforeClass import org.testng.annotations.Test diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy rename to integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy index 147933177..1a0225f0f 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/com/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy @@ -16,16 +16,16 @@ * under the License. */ -package com.wso2.cds.keymanager.test.secondaryUser - -import com.wso2.cds.test.framework.AUTest -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.automation.AutomationMethod +package org.wso2.cds.keymanager.test.secondaryUser + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod import io.restassured.response.Response import org.openqa.selenium.By import org.testng.Assert diff --git a/integration-test-suite/cds-toolkit-test-framework/pom.xml b/integration-test-suite/cds-toolkit-test-framework/pom.xml index 3facc72c4..f4ca56921 100644 --- a/integration-test-suite/cds-toolkit-test-framework/pom.xml +++ b/integration-test-suite/cds-toolkit-test-framework/pom.xml @@ -59,7 +59,7 @@ slf4j-simple - com.wso2 + org.wso2 open-banking-test-framework @@ -175,5 +175,9 @@ + + 1.0.0 + + diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/AUTest.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy similarity index 98% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/AUTest.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy index f7b0b447d..ffbb49a66 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/AUTest.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy @@ -16,7 +16,7 @@ * under the License. */ -package com.wso2.cds.test.framework +package org.wso2.cds.test.framework import com.google.gson.JsonArray import com.google.gson.JsonElement @@ -24,24 +24,22 @@ import com.google.gson.JsonObject import com.nimbusds.oauth2.sdk.ResponseMode import com.nimbusds.oauth2.sdk.ResponseType import com.nimbusds.oauth2.sdk.token.RefreshToken -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConfigConstants -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.constant.AUPayloads -import com.wso2.cds.test.framework.constant.ContextConstants -import com.wso2.cds.test.framework.automation.consent.AUAccountSelectionStep -import com.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConfigConstants +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.constant.AUPayloads +import org.wso2.cds.test.framework.constant.ContextConstants import com.nimbusds.oauth2.sdk.AccessTokenResponse -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.cds.test.framework.utility.DbConnection -import com.wso2.cds.test.framework.utility.SqlQuery -import com.wso2.openbanking.test.framework.OBTest -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import com.wso2.openbanking.test.framework.automation.NavigationAutomationStep -import com.wso2.openbanking.test.framework.configuration.OBConfigParser +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.cds.test.framework.utility.DbConnection +import org.wso2.cds.test.framework.utility.SqlQuery +import org.wso2.openbanking.test.framework.OBTest +import org.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.NavigationAutomationStep +import org.wso2.openbanking.test.framework.configuration.OBConfigParser import io.restassured.http.ContentType import io.restassured.response.Response import org.apache.logging.log4j.LogManager @@ -49,12 +47,14 @@ import org.apache.logging.log4j.Logger import org.testng.Assert import org.testng.ITestContext import org.testng.annotations.BeforeClass -import com.wso2.cds.test.framework.request_builder.AUAuthorisationBuilder -import com.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder -import com.wso2.cds.test.framework.request_builder.AURequestBuilder -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.request_builder.AUAuthorisationBuilder +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.asserts.SoftAssert +import org.wso2.cds.test.framework.automation.consent.AUAccountSelectionStep +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep import java.nio.charset.Charset import java.time.LocalDate @@ -671,12 +671,10 @@ class AUTest extends OBTest { if (auConfiguration.getProfileSelectionEnabled()) { if (profiles == AUAccountProfile.ORGANIZATION_A) { //Select Business Profile - authWebDriver.selectOption(AUPageObjects.ORGANIZATION_A_PROFILE_SELECTION) authWebDriver.clickButtonXpath(AUPageObjects.PROFILE_SELECTION_NEXT_BUTTON) } else { //Select Individual Profile - authWebDriver.selectOption(AUPageObjects.INDIVIDUAL_PROFILE_SELECTION) authWebDriver.clickButtonXpath(AUPageObjects.PROFILE_SELECTION_NEXT_BUTTON) } } diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUAccountSelectionStep.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/consent/AUAccountSelectionStep.groovy similarity index 77% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUAccountSelectionStep.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/consent/AUAccountSelectionStep.groovy index bfe743212..9d63f2089 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUAccountSelectionStep.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/consent/AUAccountSelectionStep.groovy @@ -16,15 +16,15 @@ * under the License. */ -package com.wso2.cds.test.framework.automation.consent +package org.wso2.cds.test.framework.automation.consent -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import com.wso2.openbanking.test.framework.automation.BrowserAutomationStep -import com.wso2.openbanking.test.framework.automation.OBBrowserAutomation -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.BrowserAutomationStep +import org.wso2.openbanking.test.framework.automation.OBBrowserAutomation +import org.wso2.cds.test.framework.configuration.AUConfigurationService import org.openqa.selenium.remote.RemoteWebDriver -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.utility.AUTestUtil /** * AU Account section automation step diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy similarity index 83% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy index 7f692b710..70909bc3a 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/consent/AUBasicAuthAutomationStep.groovy @@ -16,19 +16,17 @@ * under the License. */ -package com.wso2.cds.test.framework.automation.consent +package org.wso2.cds.test.framework.automation.consent -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import com.wso2.openbanking.test.framework.automation.BrowserAutomationStep -import com.wso2.openbanking.test.framework.automation.OBBrowserAutomation -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.BrowserAutomationStep +import org.wso2.openbanking.test.framework.automation.OBBrowserAutomation +import org.wso2.cds.test.framework.configuration.AUConfigurationService import org.apache.commons.logging.Log import org.apache.commons.logging.LogFactory -import org.openqa.selenium.By import org.openqa.selenium.remote.RemoteWebDriver -import org.openqa.selenium.support.ui.ExpectedConditions import org.openqa.selenium.support.ui.WebDriverWait /** diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUBasicWithdrawalAutomationStep.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/consent/AUBasicWithdrawalAutomationStep.groovy similarity index 84% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUBasicWithdrawalAutomationStep.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/consent/AUBasicWithdrawalAutomationStep.groovy index d6db46c4a..6be86821b 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/consent/AUBasicWithdrawalAutomationStep.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/consent/AUBasicWithdrawalAutomationStep.groovy @@ -16,13 +16,13 @@ * under the License. */ -package com.wso2.cds.test.framework.automation.consent +package org.wso2.cds.test.framework.automation.consent -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import com.wso2.openbanking.test.framework.automation.BrowserAutomationStep -import com.wso2.openbanking.test.framework.automation.OBBrowserAutomation -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.BrowserAutomationStep +import org.wso2.openbanking.test.framework.automation.OBBrowserAutomation +import org.wso2.cds.test.framework.configuration.AUConfigurationService import org.openqa.selenium.remote.RemoteWebDriver import java.util.concurrent.TimeUnit diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy similarity index 83% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy index 261a3814f..db1d0ae39 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/automation/dashboard/AUCCPortalWithdrawalAutomationStep.groovy @@ -16,13 +16,13 @@ * under the License. */ -package com.wso2.cds.test.framework.automation.dashboard +package org.wso2.cds.test.framework.automation.dashboard -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.openbanking.test.framework.automation.AutomationMethod -import com.wso2.openbanking.test.framework.automation.BrowserAutomationStep -import com.wso2.openbanking.test.framework.automation.OBBrowserAutomation -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.BrowserAutomationStep +import org.wso2.openbanking.test.framework.automation.OBBrowserAutomation +import org.wso2.cds.test.framework.configuration.AUConfigurationService import org.openqa.selenium.remote.RemoteWebDriver import java.util.concurrent.TimeUnit diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/configuration/AUConfigurationService.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/configuration/AUConfigurationService.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/configuration/AUConfigurationService.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/configuration/AUConfigurationService.groovy index 0359bcbfd..c5a1399ca 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/configuration/AUConfigurationService.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/configuration/AUConfigurationService.groovy @@ -16,11 +16,12 @@ * under the License. */ -package com.wso2.cds.test.framework.configuration +package org.wso2.cds.test.framework.configuration -import com.wso2.cds.test.framework.constant.AUConfigConstants -import com.wso2.openbanking.test.framework.configuration.OBConfigurationService -import com.wso2.openbanking.test.framework.constant.OBConfigConstants + +import org.wso2.openbanking.test.framework.configuration.OBConfigurationService +import org.wso2.openbanking.test.framework.constant.OBConfigConstants +import org.wso2.cds.test.framework.constant.AUConfigConstants /** * Class for provide configuration data to the AU layers and AU tests diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUAccountProfile.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUAccountProfile.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUAccountProfile.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUAccountProfile.groovy index eecc9763a..2b203a5b9 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUAccountProfile.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUAccountProfile.groovy @@ -16,7 +16,7 @@ * under the License. */ -package com.wso2.cds.test.framework.constant +package org.wso2.cds.test.framework.constant /** * Enum class for keeping account Profiles Eg: Business and Individual. diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUAccountScope.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUAccountScope.groovy similarity index 94% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUAccountScope.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUAccountScope.groovy index e64ecf3bd..d45543116 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUAccountScope.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUAccountScope.groovy @@ -16,7 +16,7 @@ * under the License. */ -package com.wso2.cds.test.framework.constant +package org.wso2.cds.test.framework.constant /** * Enum class for keeping account scopes @@ -33,7 +33,8 @@ enum AUAccountScope { CDR_REGISTRATION("cdr:registration"), ADMIN_METRICS_BASIC_READ("admin:metrics.basic:read"), ADMIN_METADATA_UPDATE("admin:metadata:update"), - PROFILE("profile") + PROFILE("profile"), + OPENID("openid") private String value diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUBusinessUserPermission.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUBusinessUserPermission.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUBusinessUserPermission.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUBusinessUserPermission.groovy index 60beee9d9..b1170cd8f 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUBusinessUserPermission.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUBusinessUserPermission.groovy @@ -16,7 +16,7 @@ * under the License. */ -package com.wso2.cds.test.framework.constant +package org.wso2.cds.test.framework.constant /** * Enum class for keeping Permissions of Business Users. diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConfigConstants.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUConfigConstants.groovy similarity index 99% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConfigConstants.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUConfigConstants.groovy index f7e9b5094..0372921e6 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConfigConstants.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUConfigConstants.groovy @@ -16,7 +16,7 @@ * under the License. */ -package com.wso2.cds.test.framework.constant +package org.wso2.cds.test.framework.constant /** * Class for provide AU configuration constants with OB configuration constants diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConstants.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUConstants.groovy similarity index 99% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConstants.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUConstants.groovy index e34cd973f..8f2284db3 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUConstants.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUConstants.groovy @@ -16,12 +16,12 @@ * under the License. */ -package com.wso2.cds.test.framework.constant +package org.wso2.cds.test.framework.constant import com.nimbusds.oauth2.sdk.pkce.CodeVerifier -import com.wso2.openbanking.test.framework.constant.OBConstants -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.constant.OBConstants +import org.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.utility.AUTestUtil /** * Class for provide AU and OB constants to the @@ -409,7 +409,7 @@ class AUConstants extends OBConstants { public static final String ERROR_NOT_ALLOWED_TO_ACCESS = "The access token does not allow you to access the requested resource" public static final String PARAM_PROFILE_NAME = "profileName" public static final String USER_DENIED_THE_CONSENT = "User denied the consent" - public static final String USER_SKIP_THE_CONSENT_FLOW = "User skipped the consent flow" + public static final String USER_SKIP_THE_CONSENT_FLOW = "User skip the consent flow" public static final String CANCEL_ERROR_IN_ACCOUNTS_PAGE = "User skip the consent flow" public static final String ACTIVE = "active" @@ -606,5 +606,8 @@ class AUConstants extends OBConstants { public static final String ERROR_CODE_INVALID_ARRANGEMENT = "urn:au-cds:error:cds-all:Authorisation/InvalidArrangement" public static final String INVALID_CONSENT_ARRANGEMENT = "Invalid Arrangement ID" public static TOKEN_ENDPOINT = "/oauth2/token" + + public static MESSAGE = "message" + public static DESCRIPTION = "description" } diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUDOMSStatus.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUDOMSStatus.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUDOMSStatus.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUDOMSStatus.groovy index 8d5e20c01..21112f76f 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUDOMSStatus.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUDOMSStatus.groovy @@ -16,7 +16,7 @@ * under the License. */ -package com.wso2.cds.test.framework.constant +package org.wso2.cds.test.framework.constant /** * Enum class for keeping AU Disclosure Option Management Service Statuses diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUPageObjects.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUPageObjects.groovy similarity index 99% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUPageObjects.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUPageObjects.groovy index f1cfd1672..bebb38efa 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUPageObjects.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUPageObjects.groovy @@ -16,7 +16,7 @@ * under the License. */ -package com.wso2.cds.test.framework.constant +package org.wso2.cds.test.framework.constant /** * Class for keep automation Page objects diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUPayloads.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUPayloads.groovy similarity index 99% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUPayloads.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUPayloads.groovy index f523bb1cc..15bc64b53 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/AUPayloads.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUPayloads.groovy @@ -1,4 +1,4 @@ -package com.wso2.cds.test.framework.constant +package org.wso2.cds.test.framework.constant class AUPayloads { diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/ContextConstants.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/ContextConstants.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/ContextConstants.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/ContextConstants.groovy index 34cce1629..84c9b3cba 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/constant/ContextConstants.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/ContextConstants.groovy @@ -16,7 +16,7 @@ * under the License. */ -package com.wso2.cds.test.framework.constant +package org.wso2.cds.test.framework.constant /** * Class for keep constants of tests context diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/data_provider/ConsentDataProviders.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/data_provider/ConsentDataProviders.groovy similarity index 95% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/data_provider/ConsentDataProviders.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/data_provider/ConsentDataProviders.groovy index 81c665d10..68d9c57c1 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/data_provider/ConsentDataProviders.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/data_provider/ConsentDataProviders.groovy @@ -16,11 +16,11 @@ * under the License. */ -package com.wso2.cds.test.framework.data_provider +package org.wso2.cds.test.framework.data_provider + -import com.wso2.cds.test.framework.constant.AUConstants -import org.openqa.selenium.remote.http.HttpMethod import org.testng.annotations.DataProvider +import org.wso2.cds.test.framework.constant.AUConstants /** * Data provide class for Accounts tests diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/keystore/AUKeyStore.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/keystore/AUKeyStore.groovy similarity index 90% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/keystore/AUKeyStore.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/keystore/AUKeyStore.groovy index d5ad75d16..86619489b 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/keystore/AUKeyStore.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/keystore/AUKeyStore.groovy @@ -16,11 +16,11 @@ * under the License. */ -package com.wso2.cds.test.framework.keystore +package org.wso2.cds.test.framework.keystore -import com.wso2.bfsi.test.framework.exception.TestFrameworkException -import com.wso2.openbanking.test.framework.keystore.OBKeyStore -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.bfsi.test.framework.exception.TestFrameworkException +import org.wso2.openbanking.test.framework.keystore.OBKeyStore +import org.wso2.cds.test.framework.configuration.AUConfigurationService import java.security.Key import java.security.KeyStore import java.security.cert.Certificate diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy similarity index 98% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy index e21dd879b..b30bbae8c 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AUAuthorisationBuilder.groovy @@ -16,24 +16,23 @@ * under the License. */ -package com.wso2.cds.test.framework.request_builder +package org.wso2.cds.test.framework.request_builder import com.nimbusds.oauth2.sdk.ResponseMode import com.nimbusds.oauth2.sdk.pkce.CodeChallengeMethod import com.nimbusds.oauth2.sdk.pkce.CodeVerifier -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants import com.nimbusds.oauth2.sdk.AuthorizationRequest import com.nimbusds.oauth2.sdk.ResponseType import com.nimbusds.oauth2.sdk.Scope import com.nimbusds.oauth2.sdk.id.ClientID import com.nimbusds.oauth2.sdk.id.State -import com.wso2.openbanking.test.framework.request_builder.SignedObject -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.openbanking.test.framework.request_builder.SignedObject +import org.wso2.cds.test.framework.configuration.AUConfigurationService import io.restassured.response.Response -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil -import java.nio.charset.Charset +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil /** * Class for AU Authorization handling diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy similarity index 96% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy index 8fded29b6..dcde0af64 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AUJWTGenerator.groovy @@ -16,7 +16,7 @@ * under the License. */ -package com.wso2.cds.test.framework.request_builder +package org.wso2.cds.test.framework.request_builder import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.ObjectMapper @@ -24,11 +24,10 @@ import com.fasterxml.jackson.databind.node.ObjectNode import com.nimbusds.jwt.JWTClaimsSet import com.nimbusds.oauth2.sdk.AuthorizationRequest import com.nimbusds.oauth2.sdk.ResponseMode -import com.nimbusds.oauth2.sdk.id.ClientID import com.nimbusds.oauth2.sdk.pkce.CodeChallenge import com.nimbusds.oauth2.sdk.pkce.CodeChallengeMethod import com.nimbusds.oauth2.sdk.pkce.CodeVerifier -import com.wso2.bfsi.test.framework.exception.TestFrameworkException +import org.wso2.bfsi.test.framework.exception.TestFrameworkException import com.nimbusds.jose.JOSEObjectType import com.nimbusds.jose.JWSAlgorithm import com.nimbusds.jose.JWSHeader @@ -38,24 +37,20 @@ import com.nimbusds.jose.Payload import com.nimbusds.jose.crypto.RSASSASigner import com.nimbusds.jwt.JWT import com.nimbusds.jwt.SignedJWT -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.utility.AUTestUtil -import com.wso2.openbanking.test.framework.request_builder.JSONRequestGenerator -import com.wso2.openbanking.test.framework.request_builder.PayloadGenerator -import com.wso2.cds.test.framework.configuration.AUConfigurationService -import com.wso2.cds.test.framework.keystore.AUKeyStore -import com.wso2.openbanking.test.framework.keystore.OBKeyStore -import io.restassured.response.Response +import org.wso2.openbanking.test.framework.request_builder.JSONRequestGenerator +import org.wso2.openbanking.test.framework.request_builder.PayloadGenerator +import org.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.openbanking.test.framework.keystore.OBKeyStore import org.apache.commons.lang3.StringUtils import org.bouncycastle.jce.provider.BouncyCastleProvider import org.json.JSONException import org.json.JSONObject import org.testng.Reporter +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.keystore.AUKeyStore -import java.nio.charset.StandardCharsets import java.security.Key -import java.security.MessageDigest import java.security.PrivateKey import java.security.Security import java.security.cert.Certificate diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy index d97e540f3..8b42cb6b6 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AURegistrationRequestBuilder.groovy @@ -16,20 +16,20 @@ * under the License. */ -package com.wso2.cds.test.framework.request_builder +package org.wso2.cds.test.framework.request_builder import com.nimbusds.oauth2.sdk.ResponseType -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.openbanking.test.framework.request_builder.OBRegistrationRequestBuilder -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.openbanking.test.framework.request_builder.OBRegistrationRequestBuilder +import org.wso2.cds.test.framework.configuration.AUConfigurationService import io.restassured.RestAssured import io.restassured.config.EncoderConfig import io.restassured.http.ContentType import io.restassured.specification.RequestSpecification import org.json.JSONArray -import com.wso2.cds.test.framework.utility.AUMockCDRIntegrationUtil -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.utility.AUMockCDRIntegrationUtil +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.constant.AUConstants /** * Class that provides DCR functions for tests diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy similarity index 98% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy index a21e99f26..790dbe6d4 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/request_builder/AURequestBuilder.groovy @@ -16,11 +16,9 @@ * under the License. */ -package com.wso2.cds.test.framework.request_builder +package org.wso2.cds.test.framework.request_builder import com.nimbusds.oauth2.sdk.pkce.CodeVerifier -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants import com.nimbusds.jwt.SignedJWT import com.nimbusds.oauth2.sdk.AccessTokenResponse import com.nimbusds.oauth2.sdk.AuthorizationCode @@ -37,16 +35,18 @@ import com.nimbusds.oauth2.sdk.http.HTTPRequest import com.nimbusds.oauth2.sdk.http.HTTPResponse import com.nimbusds.oauth2.sdk.id.ClientID import com.nimbusds.oauth2.sdk.token.RefreshToken -import com.wso2.openbanking.test.framework.request_builder.SignedObject -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.openbanking.test.framework.request_builder.SignedObject +import org.wso2.cds.test.framework.configuration.AUConfigurationService import io.restassured.RestAssured import io.restassured.http.ContentType import io.restassured.response.Response import io.restassured.specification.RequestSpecification import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.Logger -import com.wso2.cds.test.framework.utility.AURestAsRequestBuilder -import com.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil import java.nio.charset.Charset diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUIdEncryptorDecryptor.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUIdEncryptorDecryptor.groovy similarity index 98% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUIdEncryptorDecryptor.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUIdEncryptorDecryptor.groovy index 46488da73..79aba7ba5 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUIdEncryptorDecryptor.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUIdEncryptorDecryptor.groovy @@ -16,7 +16,7 @@ * under the License. */ -package com.wso2.cds.test.framework.utility +package org.wso2.cds.test.framework.utility import javax.crypto.Cipher import javax.crypto.spec.SecretKeySpec diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUMockCDRIntegrationUtil.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUMockCDRIntegrationUtil.groovy similarity index 97% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUMockCDRIntegrationUtil.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUMockCDRIntegrationUtil.groovy index cc7566695..bb525a7de 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUMockCDRIntegrationUtil.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUMockCDRIntegrationUtil.groovy @@ -16,16 +16,17 @@ * under the License. */ -package com.wso2.cds.test.framework.utility +package org.wso2.cds.test.framework.utility + -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.cds.test.framework.configuration.AUConfigurationService import groovy.json.JsonOutput import groovy.json.JsonSlurper import io.restassured.RestAssured import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.Logger import org.testng.Assert +import org.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.constant.AUConstants /** * The util class to invoke the Mock CDR Registration endpoints diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AURestAsRequestBuilder.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AURestAsRequestBuilder.groovy similarity index 89% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AURestAsRequestBuilder.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AURestAsRequestBuilder.groovy index 38f90ba60..0753acf69 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AURestAsRequestBuilder.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AURestAsRequestBuilder.groovy @@ -16,18 +16,19 @@ * under the License. */ -package com.wso2.cds.test.framework.utility +package org.wso2.cds.test.framework.utility -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.bfsi.test.framework.exception.TestFrameworkException -import com.wso2.openbanking.test.framework.configuration.OBConfigurationService -import com.wso2.openbanking.test.framework.utility.RestAsRequestBuilder + +import org.wso2.bfsi.test.framework.exception.TestFrameworkException +import org.wso2.openbanking.test.framework.configuration.OBConfigurationService +import org.wso2.openbanking.test.framework.utility.RestAsRequestBuilder import io.restassured.RestAssured import io.restassured.config.EncoderConfig import io.restassured.config.RestAssuredConfig import io.restassured.http.ContentType import io.restassured.specification.RequestSpecification import org.apache.http.conn.ssl.SSLSocketFactory +import org.wso2.cds.test.framework.constant.AUConstants /** * AU Class for provide Basic Rest-assured Request Objects diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUSSLSocketFactoryCreator.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUSSLSocketFactoryCreator.groovy similarity index 93% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUSSLSocketFactoryCreator.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUSSLSocketFactoryCreator.groovy index 0246ac481..e863508dd 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUSSLSocketFactoryCreator.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUSSLSocketFactoryCreator.groovy @@ -16,10 +16,10 @@ * under the License. */ -package com.wso2.cds.test.framework.utility +package org.wso2.cds.test.framework.utility -import com.wso2.bfsi.test.framework.exception.TestFrameworkException -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.bfsi.test.framework.exception.TestFrameworkException +import org.wso2.cds.test.framework.configuration.AUConfigurationService import org.apache.http.conn.ssl.SSLSocketFactory import java.security.KeyManagementException diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUTestUtil.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUTestUtil.groovy similarity index 96% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUTestUtil.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUTestUtil.groovy index e75d56dee..4ebae24c5 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/AUTestUtil.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/AUTestUtil.groovy @@ -16,33 +16,30 @@ * under the License. */ -package com.wso2.cds.test.framework.utility +package org.wso2.cds.test.framework.utility import com.google.gson.Gson import com.google.gson.JsonArray import com.google.gson.JsonElement import com.google.gson.JsonObject -import com.nimbusds.oauth2.sdk.pkce.CodeVerifier -import com.wso2.cds.test.framework.constant.AUAccountProfile -import com.wso2.cds.test.framework.constant.AUAccountScope -import com.wso2.cds.test.framework.constant.AUConstants -import com.wso2.bfsi.test.framework.exception.TestFrameworkException -import com.wso2.cds.test.framework.constant.AUPageObjects -import com.wso2.cds.test.framework.request_builder.AUAuthorisationBuilder -import com.wso2.cds.test.framework.request_builder.AUJWTGenerator -import com.wso2.openbanking.test.framework.utility.OBTestUtil -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.bfsi.test.framework.exception.TestFrameworkException +import org.wso2.cds.test.framework.request_builder.AUAuthorisationBuilder +import org.wso2.cds.test.framework.request_builder.AUJWTGenerator +import org.wso2.openbanking.test.framework.utility.OBTestUtil +import org.wso2.cds.test.framework.configuration.AUConfigurationService import org.apache.http.conn.ssl.SSLSocketFactory import org.jsoup.nodes.Document import org.jsoup.nodes.Element import org.testng.Assert import io.restassured.response.Response import org.jsoup.Jsoup +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects -import java.nio.charset.StandardCharsets import java.nio.file.Path import java.nio.file.Paths -import java.security.MessageDigest /** * Domain specific AU layer Class to contain utility classes used for Test Framework. @@ -450,7 +447,8 @@ class AUTestUtil extends OBTestUtil { * @return AccountXPath */ static String getUnavailableAccountsXPath(String accountNumber) { - return AUPageObjects.LBL_UNAVAILABLE_ACCOUNT + "div[@id='${accountNumber}']" + String lastFourDigits = accountNumber.substring(accountNumber.length() - 4) + return AUPageObjects.LBL_UNAVAILABLE_ACCOUNT + "div[contains(@id,'${lastFourDigits}')]" } /** diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/DbConnection.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/DbConnection.groovy similarity index 98% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/DbConnection.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/DbConnection.groovy index b081cdc6a..0995101a3 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/DbConnection.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/DbConnection.groovy @@ -16,9 +16,9 @@ * under the License. */ -package com.wso2.cds.test.framework.utility +package org.wso2.cds.test.framework.utility -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.configuration.AUConfigurationService import java.lang.reflect.InvocationTargetException import java.sql.Connection diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/SqlQuery.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/SqlQuery.groovy similarity index 96% rename from integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/SqlQuery.groovy rename to integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/SqlQuery.groovy index a354d9b70..e24ad53bf 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/com/wso2/cds/test/framework/utility/SqlQuery.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/utility/SqlQuery.groovy @@ -16,9 +16,9 @@ * under the License. */ -package com.wso2.cds.test.framework.utility +package org.wso2.cds.test.framework.utility -import com.wso2.cds.test.framework.configuration.AUConfigurationService +import org.wso2.cds.test.framework.configuration.AUConfigurationService /** * Class contains the SQL queries related to testing. diff --git a/integration-test-suite/pom.xml b/integration-test-suite/pom.xml index 0a02b6242..316f0d7b2 100644 --- a/integration-test-suite/pom.xml +++ b/integration-test-suite/pom.xml @@ -79,9 +79,9 @@ ${org.testng.version} - com.wso2 + org.wso2 open-banking-test-framework - ${com.wso2.openbanking.test} + ${org.wso2.openbanking.test} compile @@ -349,7 +349,7 @@ 31.0.1-jre 4.2.3 9.35 - 1.0.0 + 4.0.0-SNAPSHOT 2.8.9 1.15.4 3.18.0 diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/obsigning-oQ4KoaavpOuoE7rvQsZEOV_NO_UPLOAD.key b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/obsigning-oQ4KoaavpOuoE7rvQsZEOV_NO_UPLOAD.key deleted file mode 100644 index ccec6f046..000000000 --- a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/obsigning-oQ4KoaavpOuoE7rvQsZEOV_NO_UPLOAD.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCsAsw5mDMKXp45 -C1lDGHXE/Njh/H8kB0nPQee1zgjST/FSGnUEQ2KWXgaCfybbkBh1Eb3F+a5FFZ4W -1SnAhK9muKVdCfLUIRQO+HFUDzFHwEuRcN4qxI5TuAp9C1oJ0gUof6HZjzRe+LEg -72sTDxEr8XOEjVrTjQ0L7HDUDQItH9TQNoFjENPcRiWiPLuGaZvTgxVWbo7C70Rq -4afg+YNQmY10XblgEq1e7fhV4E3rRNbXrClUclb7DnZ8PXDP2j3PQBmnY1tMDnjD -jpr9JqRJlKyFmZwijMcGhEdl7CI5IprfvE7Oawx/zRJDTFmLDbCPUJIHIfsZLymu -ydR8lUJ/AgMBAAECggEAAxE8XxKNu8jwKAhBxpEwbcYsf+smwUJireV496RS7UfW -VSZ6S7cqkjqJrINj8qphJUVJuGFkGtXwhGu3W42CKzduYM2v8i8c0nTaYICyL5td -kvG2TyuYy3lkBn17VOLVNgxV8IaTN9ZWIkY4B0D6MhRo1kZHBlq6OX+Ki4gn2nId -UrSubo1mNg8U5HKl/yJREF3vk+Jxx6xthHIlEZIxX+4ahmOMCSC+POtaelnzKtpL -ttyf3kvfK/dA58yLkq1boirXE7ZwN9Oqj6j+DgW11zDe3qqUYEzsqbLGqR1ITeVm -G+dg3gsaLGDzsVhcbmGNwD/FhbpyZkbvM+dzqAc1kQKBgQDuOdGNxbpOA2UPxZb4 -HNQMAzplwg2WBnXhsxlL2am0AsZSR/I2jFMB7FiXGsZKMQR9YpfHkd+cTdDkdzjo -5S4L6SVGmHiEfGxmX77HHekJPEpLk3iYNKfFwlftB5YWmVrj9PqHXj/Yf3oRHBHS -iTHWE0zfEdhnapL6nd5LGUVUSwKBgQC42EFcosc9raliMghiyOBvPne4rFLhMt0D -T7vCwPA902psklY+ME+B5sVpU9V7vSTFRRsV6Xm6RjFCMyOgxFp+O7lK1QwmfQCe -JbLUO+DnOyLKMVY8ZfFaW4QKqD4TsKOkhfVz4vWPiHmKzKzGqYK+Ml8FboDlcwcM -tcvxeqJiHQKBgQCdPQqE0iLDRVhaTaf1Akov152e9rOy93atT2J9/yAVEdPHEXfc -60gKt+5NZj3FUI9PF1lpP25ho7ciZVLp3gNDl1KkQxUhFWMTO1UX5jUfhGzhb2gk -xnSKglk4uU4mgnhMiDEoUlw/0PxH+MgGt8luLHULs6Krt9tlkffch8SL+wKBgC72 -quypYuvV0qJjSeQnW3aILYzbI5eZ/7NWr8LUmHVs4K5DI+xbA+hiRKf1J9lvfgcs -/qu7jTT5noxOR/AR01gdPn+3z4V73wtPUrc/m23EhZtPm7RuxjqJ4+t9QYBpMbqc -WneeI3vbVd4hEIjNCq3eSGwt3kvtxM3C5tUsrlM1AoGAW85yN3VUj9A+5+z/ne7z -Ct17Vakt2f51fWm/r438H5gQfElCtxvH91/fu1SvxvvqZszN5K7YC/TsNsM9R0aV -EXPbM7wtcMudlTfTyuX+CdkKqEM4wnKWYCzNiQEOsXB0dn7DnNDoPz7jVsv4LElg -BygVYMKJ1dfFZwbpBorBstU= ------END PRIVATE KEY----- diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/obtransport-oQ4KoaavpOuoE7rvQsZEOV_NO_UPLOAD.key b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/obtransport-oQ4KoaavpOuoE7rvQsZEOV_NO_UPLOAD.key deleted file mode 100644 index b83e50f41..000000000 --- a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/obtransport-oQ4KoaavpOuoE7rvQsZEOV_NO_UPLOAD.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCXjGlqc5sGGduX -Axy0hFoXMGmvySV4MLqWSYnwcoWmqPJvx4cfD2aVzl8+xnH4jVZs98NXABV736zY -eAO63Nr46fbITUOm0J2zilY6DfqzcbJGI8abyzpZQlGoouZI3URea9GBPe7d4R+x -nQE0+eibPWqJspG3mKHRtbzeHg3IAK59Xzu6vuvtBMNjJWuV/k/37H7vteLVzC8e -wAEEgsxn7GJyaenwiUOLpNXeZpWFnfnDNoFn9XkObB3i9SvQfnM6LOezRYbFVAbz -wjy5q2rWp4+/LTfDuszsQLNVBHJH/s9ayytw9jQqr/RZ3we7GiyoaefL0KqEZzol -vpa9WeG7AgMBAAECggEAF6Phw9HMd8tWe6boIOlZIQSTz/CO2uywW9uVMWq5RNyr -k4U/+OKO9u/DisgrpNaYtJSCURLPHHeGqm6E7Rl2Ql2Yz05s2bDxkL1pIv2QQygJ -Y7NBUDHdDxRvJuELuYe5RQiznIy73g+368hulO7Q+qUTdpm3l7ivBsa/SLTOeIlp -NHGZtilclW0jKF8s8yZRdCjIHTJeddKdNVD1uE0qiNhMLVk9mQBb5+sdEh+3+nTP -YaWZJtc30/h8s1dKsV/NERmU34vb38jNydz3+WUQZQATsw3Qg0gCgNnKPiUroPLU -dqb1uORaEEAM48RfWt5j6blqcREn6rwPLsE+emXx7QKBgQDKz2w2goXV6CfWs02B -/Myl7KmZDIO/vlZS+f+UJWmmRnTmTsHk35eZ6V1VUtBUvRcQ8BDDDVuNP9cooA1h -nvCbulD5wEZ5OqwuJKMmiBlJ7hLr67YjD2eWI3GvTJgwVMOGBgfsfDXUg3Q+iTUN -0dg/cjRwly2fPh9HBUeISNtcjwKBgQC/S0zik7Nhg9uezN/dBQTKw9eaLzVvNTL3 -Qr4amKssGT2hhJWadbtJvozf8SWKS61Sj+u3OQ7FgHQyHIv2iHwQZTyTl+L1bXUW -LkeesTiriwtTbZfamjGsLk5AckL0Jf7H5d+80RDh0aAFiLbRvCPFHjPs9k2FQLbT -YimSwakWFQKBgD34HS+WuEBBHJMs3F0AmqOEadn7CfK3vPbDrsVcnSiSVLveir5d -V5xOwxcEI+YQlRC22dhPp47EWADwzsXqY8ihqIZ3qtD2DZBX34YxhdCiLyPpNREH -bvZgRCd1Nvdlnwy/oQIwfd4+gHFvSUe8u9+/DKjueKE0wSfZRB8va9+fAoGAR3ry -wuOgLvsfkMpLiII8lSvzH5kuZVzCq6RT9wo/RB42amlpoasGjfrXF0M73N6EaIqA -8RkwDNsAEE2ce0Xq3hGGPjyOQVliXCR0/LaKT4eIdudHzBa8IvO2p9xKaoLcHoQm -Q573qPo0ynyYm+yqjRjJHG247+cLqhdPI5ib/zUCgYB2LF4I/46XDyQw2sEJjEP/ -xTEKeo+TqNQTIGrkdiLqAvIKDYfyBxp7qtmwFkM1OOiqjWF0JpZD4haMH9HJFzA6 -mUZVVUB2UlEoknvXSKhbefPpNpCWYJcvQ24aEsE7IcxNasDgtY2dRHdg+/LdOtPY -7bjFcMY3B6PzLER1Q9hyBw== ------END PRIVATE KEY----- From 5efd93b0e6d7eb48207dbc49ac18fbce35889460 Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Tue, 26 Nov 2024 12:21:28 +0530 Subject: [PATCH 05/20] New Test Certs --- .../signing-keystore/signing.jks | Bin 2687 -> 3204 bytes .../signing-keystore/signing.key | 28 ++++++++++++++ .../signing-keystore/signing.p12 | Bin 3164 -> 0 bytes .../signing-keystore/signing.pem | 36 +++++++++--------- .../ssa_differentHostNames.txt | 1 + .../sample-client-resources/ssa_localhost.txt | 2 +- .../ssa_withoutRedirectUrl.txt | 1 + .../transport-keystore/transport.jks | Bin 2699 -> 3208 bytes .../transport-keystore/transport.key | 28 ++++++++++++++ .../transport-keystore/transport.p12 | Bin 3184 -> 0 bytes .../transport-keystore/transport.pem | 36 +++++++++--------- 11 files changed, 95 insertions(+), 37 deletions(-) create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/signing.key delete mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/signing.p12 create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_differentHostNames.txt create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_withoutRedirectUrl.txt create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/transport.key delete mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/transport.p12 diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/signing.jks b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/signing.jks index 609fd0e4847f16f8685454824a82544778401861..87b93672623c128e7f66e70e4b42a43ff6aeadf7 100644 GIT binary patch literal 3204 zcma)8WmFW5(%xc;Wqm~#Tsj2-S(lVpYH0~UK%`Mxx>b6WT9y(dTtVtx=~yZ0l5(ZH zC8VVUMFpse#!zdR7RI z{>pFoG8#u!{~s-?VhE1v&2KpGx4(wM{yjxc2Lxr~sFZ$#7_`Hm2`V_+6fONvNsktW zAc}uEuf?6ld>@+@wo_&E9e%qn_8kNgxCjDrq3NMC|GyDLO9eo)LuqXyHG%eE2v7)e zkzEkl09LfgRvho3xMQytL2!^k#MBth(5<%99kP+qr%(YF%VeI5-8+Kcm~V&*C>O(d-gP*t)1duCbiK^_rG3wuh`OC{`ai4sxXr-g|6b(zP9& zt3UkZswI;sHmrE9`saD)b-7oe&t5kmlLsePT3vDk#w~fbBoPJN z49yqPpJ^&-3TlpZo)cof?mm0>9RHl($>ZeXn=_Yfl=iRSUq!tQN5edxGHFF$(>^A< z4Cepg^&v$H?QoW@x6~U#eShu^;Uel5!32q%)|c%2>ABEiGc+1t`O2nq9Z-44JE9!5PNu#$trlSM&Yb@uSZ7{M1g=n3af61b!qw z2cWI$z9<=NnQ%v9^aog!pT5i0x;8|spL(`H1pX&*-etS=nvwTieEhrix|v&+&s}&9EDWx5%ZH`)EXa3wAN=<(1|a zM$Sq@om$I5r?cljD{cT&5ywGXJpsEQ0Q2~IO7uuqr*w^a**Fc6cpF_b@y1C?>&S|3 z;gwd4gnlbhYfUkZd@9IjTIH)eWfSnAS%X|FN}CDj;=B8;09%86G->F%{wN$tM)J2m z7CEj}rCWWCS_Z}ASD=L)HzPWaH^>kxsHg>s{c|`RoEl0}eCQp+X7+Vg;p1qbPwM@u zO-*6P$Sdt5NJvGKd;KDTjAr1VT{qf?-RE7Y*G>YfEb*WmvDvkRo}w%VsD01OPq}h; zaO+gQtwT=H1+Qq~T-UT4Fr$LMK+Hb~Fu@2Zk2pG4P9f4{g=FAy7$x>zj@!2U2~-w;nL*V_##2H-6ytEfe(Ez@mUpgcyD6eIN}l112i#iAYxBGJ3qo zoApw5sCqoaJS^la(oi+chouLh%#?V2R`%ikLL|d{FQg@SsKrC7gKhaH@Rlq!>qW1M z5_P5cfM?9~<*CHKa<%mKJ$*^|`s*IL_mw(pB~oAIfzvmm5@tXzijPc>zLey1K4nzo z-(Em^IZX&$S}?VX?n_0jw)ZmTBi2+D2T&siJpI@iMT;2eNlpyIiqFJ%KXx-^RR}!R zthLM`xs9(vr0jF>;ul$5B^%QOVKQFDHT;s=h16&_zOvFcJ_p>U@1{{9$A6`=JyrhN_qdkl?q(H^t>M7OoQ zjEblZTHudd(jr7zIFJBefah)jNcQyuX4~LZv%#Qa0wwBeMOGM&sx>6u&*9hJFPqt&9H?YBOD6{GYAJua{@xR7 zd|}WupL5qi+~dpBm(exCS#BSZN)RF#ojawZaY^@REH`LqMn02$uCqh4D4eTb0V{{%n z@m( z6c6CPUBXtJzp@J_7o}U?ckj}<_ddyeW)8NE+xOg->~%QHg?*sSYocHr6k{=+?ON)N z+@1%`&d|Td^||F7MrXcS09iZ_y^!F^$H#cJbNMNsg+QjUt#oS5MQ_cFwWxAsS9-uh zUNM1)Mpg6mDVFvNO;_4(`6ky@X;ybID-?9}cxP>XyxU4P<(C#a8j2%crBSGMYEBr} z)oqE*u4G{^87MQY5Ye|6iOrfH8fh>-W_&5XG?|>d3@3Uq2iYB_Jjbyd-lcR)6DH3h z*U2kCS;b7gGYLldrw>@(Jo|nbuzux{EpNUeca7DxLTBNEL`EH2Wwni|moh8cDPJ6O zG^gbd_3ctLa9u-u#6W`?R}Sek8d=5XV~w(jyze*^s4a)T+9-vHw)Z~377@jgO!UuO zB3O(cL#WhCiLJQLC|=?Wx1LB%W{vm^f(kO&XD7}w=ABz{a))$sk6YZ~+fT#g79w}d z=e*r>-M22hXPy^);gnrte{R(`{+71VVH?gT{7xYanOsE6%*r+{a|?S+&5>#A;94s2 zuJ)y4Rl$<0hCn(S+4q|Mwom5W4sM%0S6H(k*-3^=y>Y!`G`lt>k;v+&kbm>V6lvHs zwaNqkr1y$|ofAJ?;+!Twm2BX(rqlf3jz{fro|i}Q>Z_@`@W+Ft!$KlCvWKBFa5v#c_%g_tCQoOq25+Q#YWH0^D} zO@hDskuFPnEsbxPxqS-l7HZ)Nly1;t@knM+S>MuQek~Y^-u3;P%a9$G*(+FUWAas{ zY1&w#=T+3T(lo^69=w@E*7m4G$}D!@fkt5P5*OJ=W5z?RvjhaB5_mZ~gmH*hwTQ+G z$Ov^|Q=f*9W%O6y>A93@56x1YLTQMc4qqI<5Fn#e~SRqsf7YAKt{7iG<(IQUUzh#@nzqPb>ealxu zZj|WN40vxea;)dS^&u*tlTnWn#2&g*IqFU6kH<>T<>iR?vuT8LmgnLr0Rn$9eo|YU z)6qb`gxJPvz^M!ss*5+|^!wZsSZUX*eu;d@Xpy(wMat$$oaYYLy47m4X=K}TcNG*5 z?yK@&i`!n3uc%z5e!txxy%W+Y-e~oRw70+05@V{*d17RRaj^^9$Y@>6%}q6XZZtpo zXtGMsD{#;`+jz(4r2`=vr6UtkLO29F{xGvqsH0Oivi@1By%a<9f&S8UM*4!Pcc>DT zh7ToCCTi;vRhg`KN_xjN&-)eN^Yn+YSi-XZ?7NR)?JaqW3gEl1dJi`X5W3Z{m8ED9 zQa+dCTy1RV#_RS9(SdtkZxKXVsBNVT4HRS*IjZMs9=O)4PCC?ER+8-a$f#}uIYa*& z{cFKny4r)`X?jbiBCVgwPbru!*%?Kx_j?=+b`<%+t)zAoF|yxjC2SPWiRv*~tp{8z z722fmEIGSlXxOD|C0b?+w*z33gsbEAoID?rh-q@nOA7((JdP8NQ9sbSXi+r$&u0z- zQUM@ba|hbgJh6q5u`Ku6$a_o1DZ`*o9R}6&Jti3^bFA|hAqYBgPw&nj$$iD!Q!_n;k literal 2687 zcma)7c{r478=rS(Oc=&GmTZ$EDZEo7rJTr~Wf)twn8whAnK291XPdEok}Ww%A=D6& zkSHCBET4TSMzlzYBpoLd&Nn*C)gRw?UFW^7=a1j-z3=CKp6B}Azk6eTV;%y5K!pqV zz9d+5`hGnoC5TF)1_{Ze)Z1kR5Qqo>a^dSB3L(B50l)!Ws0;vzK;T^X`&u!ZM|LoD z5l2vguj&cj{wiwJlA*sJ<)`KQ(_Zh!dcNAtv4TC#A83bMFESttlV*CL~^i3=O+W*0TcfE zjb^(TpPl*n;>v5?GwS8t4X*ESx8g~tI|r^Fe$%vYyjuL&gkrUP{o$$(vKrF0(Xuh3 zF0Ez&|4H?#ZLFE-y~$Vg+4I-?JaxmsxEYiGs5HL$1y-=Vp%3r28s`7eqegOS8OO1D zzlQ2n#j{5a^d-!NegsbnfNh~!MJxH)<*%=7G(5(B;*E>QYQ76K-L6^wNKI!_PAlV* zw_wiy>E|28$<;aPo*!H-HLRJ1be<;?JvnAFH~y>JF9UqG#ny9$j!m*UeG@(}1Kt`F zhEk*ZVfR=24r#p@7sPJ#Rm3?BMHTGmGBH$ow#%_Nm70YAy3*>A_f$74{LDgEfJ#Bv z@)g9um_$QQ6HBRS;A4m8y#Ar25j>rE$MV6AuM+(O334wVCa=MbuR&(GGlf%{vze2R z1-==3;=T}LMeE&eR@2?(8V~fpuEPhsmsO{ChX)Uc5=x?@aSA+y&r>Cf_VAChy@>gT z)>(pf)CRGoZ8NT=k7cM1rruwBC-K5D!_oQfwbpxx(gBO1 z;PEBi=(z(1(w!~)&bc|9g;G>}axi_ci(d6jy2R%D@@-%BX6QWAiIM%BoTL)s*3agL zpSG1;Vs@8xMK=J;dfbVLsM{IPz5SHLDm{8bTJDuQi}8qoZ+Ei{!<+x3Jv#U7{@W-C zT5Nl4{A)4yV*s-aVTyK{vi9JpiKz@6eHDu#g@kORI0=DcAwL*Rq^{jdv01fd*yg6G5RM6q^4KCZ^J)&!rMz>C z@od@L>U1+)xX8~Y_N`-em$i*2VV}g7A|+dK0*rd(QQSmwaq%tkFJk@Lw;m^IOn6RenaV|1KzRW(NYn2d(4BQ&F;F3a?tD=&O8F%Dr)fo9Xk&)btEKi!$` z8T7nBM(wEQGNqhP6GK~GO%Lv>zdkOjtk{A5rcXqT-c!Drux0`GD7)EXyf=w%653F1 zSlbvnHFiF0bc7IkgHVk%NSJxPHmlQNuEIy)1&=3Na8I5o9FKe+>NQgit!d3kIA>uE zDMzlS7q9RLa2FW~X=Slz!B6b;b()V!>{q1AbjjHd=l3g}u2_-Jm|V4!CJ^4lN>`nl z+mLp9J~mqFJT>R-`eN&nvg)2QHiCw)Uvh(H=}J-$u_N36RXoP44Oni#-&|LfvauTs zgI7q;_+4Fn!}je%O?Nx3Fv?nX?lcXZi@P$jaBKN?FYy9;k0U!R-^X|xWVpAo?(hyh zPya*B{@xewT70)hk>mP?;6b4uVnMEmp3oD~MKCA;g~C0bH0pzr2r=D6o5W>F06>aB zKo=|$6hpw=;0QUW^--)mD7y*7<&bzfnR=8+4HjA~Rv+B6$-?Bceqb?946>dRgBHLh zu_!bu#+J!s3xhG{W}v#FJB4EOKDc?ls7G!#O^y_*mu{*$6Apz>x>q?{}W zVhs;~!VhcX?9A{oGdqse0M-6Dkpj&bXGbFv!|8Z7&C-Yw?#%SE#JhuBK=a3|3I_p< z3rInPyf~B#0FX*(&%xY%;wK6YB0bHO*lla0uhwFAY_aV(dsp8lI)q;&Y-PjEPyT!Y z!Hv-#&ro8^G`Fu-S)vORMs~HtR|np^?ko0rc$++GCCpU{Yu#d(NuShhOLMs=9);=}h7Df#?3 zv^zEJ(SpV4SGhhr?k|L<@-C#9D9^DDmeo9t0|VMgeHMewWKo#< zBwDBeofbkNQOHb?ll6Bn6yzjIaN^vUWDG43!#YJ_V$8`57A25EBC^OB5{)WMXR%pi zCWc5Nk?AZVmGoyQ8S|qg2{al@D8L`GH~B^xv+$FLdjGX z82Z03 zz7NEL21R;ByZ?D^2&l1{yB)3sD#Xe=F*BcRWAG!EHXyPHj?dY%)FV#cTSN^7SAfgA z_gb!(6?&R)SlM@o=+*@Q10Sb;Y!9Im2-^dISmIjgp039j8~kIOX;f=dNJ)(Sx|rPI z#<09?H*fkhWk*j*b}P~&Q%-fEvq9?)B)9TFz#)mTs3G!JW79Ja0$uFuBTb;!GST>? zsP`s{VJYt-4i7So6|a7l240nquXkydP~LyY=ZVe^3#{PYAy+=&x|lP&MUU`TUo&Iq zif02iA`=+Q_f*OQTloqNs)vqkgpHNS3tj950q)t=d(4#^#F^v`UQ{DN=iuiV@n{BNSCzsZ#pZ zu2r>HYo}EC`kn7P@B8O>?(^Kwxv%R!=lSpYJ;-Q?6_DZzG8)1FrV+*I;>h$AR1`(g zbeEuLx?jj>Ix;dEtnrTpE{X=r{E;Mq6o5aM@IMX(((>nDe}(>3P;bia&|Hp*utc{xY}C8TG@BSdBd@~w)>Hb&z)`SHm-SH zZ-LRDJiHqsKFCRf-9G&Ro#VfCsmhi)?xLWFwY+7sGj)Z&Gzpco^8pN}VtNq1d#qWg z?h;(@>E;`+f!b$us@t_2E;k)ZYegq%TyZKAlY9bteLr5)ki*A<`)D%?i|th(SlN*J zE6d<1olWt}S3pPZiY)$NeYS5o{vN#ynr{IM!-_lA!v$d+HD-(r5bCjfo|oU08N2Vc z<-B6~@k0b69CSt5Ur4jn_eU6)i;{e$SWYQrA;5svIFJ%(=4TBa>*cemPt!3RPxny~H7$Q&U??R6L_{ zlBy7ilR0wMKa#{5j)pwlqy`+Z0SD7d`oz*M*KG>eiEN0CSnWy zV_l?AQexF{<>)PxwdC{}zO)PQ+m%hZg5H<&IpLi1>s$BPvCqj>$}ssp9*cG>&N#-Z zzMrG#vfbyIb@UU^-U@X zcjW^#AlON?(~%l-6lX0Wn<}bZh-waY_<${l*o&UqHNH(GOLu>0F6pTAl7k5+@GWa| zul@_nBbrz&YW9J%sG?56p?9j}3k>-=uj`c`^ajQnT2 zU@@_L{xnpuR72>f&y4D>E+bw3Y0i3L)n#tm^;sE4N!I;#OF3D_kI9!2 z_OZHcAmasF$sE^2TsvJDL~8Y@ycg^rBig7cIE$+p;o*x+r@!6> z>9^V>R4OEjyQX}GyB!Rz89CAuFQ<>r(4C=Ujhd@``F?3D1KY11 z_nBfNKYU}H_cOtKsSg0&O+k>ZN5yHuQ;qAtlC1ZtBz^dQR%lMmb^hGdzkl4t0Sx;vIKlTDy z4=${!UJhUyu_tl-?2xeO=n?mIC<4l=>rz|39E4 z_<-Vg1ev%0FHkhFGY{}wrWRg)#kTj%42D3_pih%_4(A25^LTVuCUmf|qw>2N{pK?j z#Ejv<_h|!<36BsCQN3PpDAM0+jKK0_cyRiHP5xZ~#^!esi{978w*#1GDh(&9sr(*V z3_;=AbNvr=pwX`;8t*@9m&ckcm5w$)2@T_4*$ojFYk4;0aPS}W=ozg2^y1~A5 z6_ifL_!=~UFY$KI^@jv$_04r(sm7ufgef&@z}@V-+z(A^?0e$%S5WBfJ8SaTHTs#w;hAFOV^MwPPq2IOB<~k}7Zs5`S@rb+ z`CDK;ZTx2Ais`TBw3P(NuUPqqZobmvYgX{a$u&KFbYBXvET$#l3zV+g%2F&D0apNZ z9;ca0+FV$eU^<+35wv<$ly+}^gHV{O)B|rQE9>>aN(u_(+^atF*lnpPQo7EV?1;Q4 zSE+(Yhf=|TSp%bp@={#lB4z<>P~)s9l4%}g5QQj-;gNjWy7kgWd(Y-d>k$UC;r@~<&l;k63eeZe@P~T2Zo2;zBS1=4dH0TdwP*~}jnHdOgoz)o_VkX-7ui>j*MZ<0` zi5^IiJhZdPIBL?PW|nucF=zVJeSO=pZ($W#@VWMSJDcEm z3UP&*R_Nq=&QbrhR8EYV;IqjMW048X%u~5g0c{P&QQO_-qZt?g<|5s4^LhbF8J>h; z-uS6rP*l3h?r=AoI4}1QNc=)Y@+;2Zujzj`C7@Kokvs!7o=flu=#rqooNbb%9BvW<$QpPu`h=O zQD^L%lBRucVA0xOGxKSaorrVcPpR8}7ul+xf~bP`(6LBS)g{`b6VoRj^|XLD zSXIains~O{GxyYuukZa_9FJSJIPzsWO&$%DzKy>+I5lRLmAY#3te1-ae36!QggM+u zktlKrA4znia+8U-?M`9Lmd2bLk>C4#%*}C`L+2u6l@Jv@?h?(?eN}=B)AJ?nPy37* zoA)-xRyV9|%N|Yl6)`k_=sbJ-j@P28IU}>-8zSz?j8 z#tj1m0sQ}z96%fp2=D@U0DS*+Uw{Wv9VvyR|NCDKq@VQb5V=KuUpCjT4woxe8# diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/signing.pem b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/signing.pem index bad383611..0ebf69a67 100644 --- a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/signing.pem +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/signing-keystore/signing.pem @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE----- -MIIFLTCCBBWgAwIBAgIEWca5LjANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJH +MIIFLTCCBBWgAwIBAgIEWcbiiDANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJH QjEUMBIGA1UEChMLT3BlbkJhbmtpbmcxLjAsBgNVBAMTJU9wZW5CYW5raW5nIFBy -ZS1Qcm9kdWN0aW9uIElzc3VpbmcgQ0EwHhcNMjMwNDE3MDQ1NjM0WhcNMjQwNTE3 -MDUyNjM0WjBhMQswCQYDVQQGEwJHQjEUMBIGA1UEChMLT3BlbkJhbmtpbmcxGzAZ -BgNVBAsTEjAwMTU4MDAwMDFIUVFyWkFBWDEfMB0GA1UEAxMWb1E0S29hYXZwT3Vv -RTdydlFzWkVPVjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKwCzDmY -MwpenjkLWUMYdcT82OH8fyQHSc9B57XOCNJP8VIadQRDYpZeBoJ/JtuQGHURvcX5 -rkUVnhbVKcCEr2a4pV0J8tQhFA74cVQPMUfAS5Fw3irEjlO4Cn0LWgnSBSh/odmP -NF74sSDvaxMPESvxc4SNWtONDQvscNQNAi0f1NA2gWMQ09xGJaI8u4Zpm9ODFVZu -jsLvRGrhp+D5g1CZjXRduWASrV7t+FXgTetE1tesKVRyVvsOdnw9cM/aPc9AGadj -W0wOeMOOmv0mpEmUrIWZnCKMxwaER2XsIjkimt+8Ts5rDH/NEkNMWYsNsI9Qkgch -+xkvKa7J1HyVQn8CAwEAAaOCAfkwggH1MA4GA1UdDwEB/wQEAwIGwDAVBgNVHSUE +ZS1Qcm9kdWN0aW9uIElzc3VpbmcgQ0EwHhcNMjMxMTE1MDUxMDA4WhcNMjQxMjE1 +MDU0MDA4WjBhMQswCQYDVQQGEwJHQjEUMBIGA1UEChMLT3BlbkJhbmtpbmcxGzAZ +BgNVBAsTEjAwMTU4MDAwMDFIUVFyWkFBWDEfMB0GA1UEAxMWakZRdVE0ZVFiTkNN +U3FkQ29nMjFuRjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKi36HD0 +prx1N3pfafJc6pSMg0i0jOiQrt+WZ6GphKUhA2JrbBxWTvabX1Q7hifl5UbkBOkn +n3SCyqBplPSqksYLdPSckb2J7UVLj76O7RkELoFD+vSrQ8FWEn8lXv4UiS8ylvlr +IPa8+pVtAwOuI3/YFmqB1lcHgBI8EELDUWHXSp3OhkcKjrm76t1sQz0tsmi5aHZR +3FXb0dACQO+dGakIerqzUmAdccLtWuSJMT+b7c7IDDm/IR/MV7iol04yeBkOlWre +IKOqHU16PI3N/PSMEt96JAUKZ/n0VC0x4YHaBYDX27sf4Gypubgmkcd4IbG/8XEu +Hq3Ik84oEpP5QEUCAwEAAaOCAfkwggH1MA4GA1UdDwEB/wQEAwIGwDAVBgNVHSUE DjAMBgorBgEEAYI3CgMMMIHgBgNVHSAEgdgwgdUwgdIGCysGAQQBqHWBBgFkMIHC MCoGCCsGAQUFBwIBFh5odHRwOi8vb2IudHJ1c3Rpcy5jb20vcG9saWNpZXMwgZMG CCsGAQUFBwICMIGGDIGDVXNlIG9mIHRoaXMgQ2VydGlmaWNhdGUgY29uc3RpdHV0 @@ -20,11 +20,11 @@ bnQwbQYIKwYBBQUHAQEEYTBfMCYGCCsGAQUFBzABhhpodHRwOi8vb2IudHJ1c3Rp cy5jb20vb2NzcDA1BggrBgEFBQcwAoYpaHR0cDovL29iLnRydXN0aXMuY29tL29i X3BwX2lzc3VpbmdjYS5jcnQwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDovL29iLnRy dXN0aXMuY29tL29iX3BwX2lzc3VpbmdjYS5jcmwwHwYDVR0jBBgwFoAUUHORxiFy -03f0/gASBoFceXluP1AwHQYDVR0OBBYEFFbNRf2on1lD/kZMxwUqtGQB0O7jMA0G -CSqGSIb3DQEBCwUAA4IBAQBFNMFwWVRKcv7TSoHlDsG6bKN/TP0JEzy5cZkhqqpc -upV+4w+Yhw3IqJvV08SFRKSwPshEMbTIoAtcxVGz9FAtV3TixTl9BXRdXImLRBsX -FWfFSzeNYL3gyhdwfItoyRWVMEfHC4KsOGQ7DNl90mUaOkB4vGZTTLV8PQKhkRVP -h33pPRdxi+d3PNFzOhed8hAB4anb/ckio2np7JunCOrU2kYEW2yc7DTJc+grCD/T -+eJzf3AXeWb+fIVyc+luabxJFKsfblcoSXdIRj3fKjGMOuvPvd5SzS4tU1uzl2OO -zPcowKfDtBAeJZ4Gmdj+RnbmH8QsHTdOJ8gxMXL9rKfF +03f0/gASBoFceXluP1AwHQYDVR0OBBYEFKjCef/JxD+ND9eSb7hQlmEhSxUqMA0G +CSqGSIb3DQEBCwUAA4IBAQCnKH9FdLmJMruX2qfbrpT0qaV8bP7xa9UDRYSMsAWC +2kqCxs8CJmARt5+xsxBW6P65+mkLS2vXgQl7J8RTMiQVnHJvvNaldYnV6odsYOqv +v+vGib8Qe0gKWSjih+Gd1Ct4UQFtn6P3ph+6OBB0OieZb7DYXqPJrX5UlG7K2fQ4 +0MdFgBdeQZ3iNkXi43UIrQ5cF4cjYavmEFRmYeHya8AKfNCiWly15mNazW/X6SWf +7pz+yk/l+gBv0wm3QT7ANXGf8izgoh6T5fmixPXSbdn8RUIV0kXp2TRRZ+CYUWBP +Jc3PvRXiiEEo2eHLXfEHG2jzrt1iKnjk6hzuC1hUzK0t -----END CERTIFICATE----- \ No newline at end of file diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_differentHostNames.txt b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_differentHostNames.txt new file mode 100644 index 000000000..22fe215c1 --- /dev/null +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_differentHostNames.txt @@ -0,0 +1 @@ +eyJhbGciOiJQUzI1NiIsImtpZCI6IjdlSjhTX1pndmxZeEZBRlNnaFY5eE1KUk92ayJ9.eyJpc3MiOiJjZHItcmVnaXN0ZXIiLCJpYXQiOjE2NjU5Nzg5NjMsImV4cCI6MjE0NzQ4MzY0NiwianRpIjoiM2JjMjA1YTFlYmM5NDNmYmI2MjRiMTRmY2IyNDExOTYiLCJvcmdfaWQiOiJUUFAxIiwib3JnX25hbWUiOiJNb2NrIENvbXBhbnkgSW5jLiIsImxlZ2FsX2VudGl0eV9pZCI6IlRQUDEiLCJsZWdhbF9lbnRpdHlfbmFtZSI6Ik1vY2sgQ29tcGFueSBQdHkgTHRkLiIsImNsaWVudF9kZXNjcmlwdGlvbiI6IkEgbW9jayBzb2Z0d2FyZSBwcm9kdWN0IGZvciB0ZXN0aW5nIFNTQSIsImNsaWVudF91cmkiOiJodHRwczovL3d3dy5tb2NrY29tcGFueS5jb20uYXUiLCJyZWRpcmVjdF91cmlzIjpbImh0dHBzOi8vbG9jYWxob3N0Ojk0NDMvZGV2cG9ydGFsIiwiaHR0cHM6Ly9vYmFtOjk0NDMiXSwibG9nb191cmkiOiJodHRwczovL3d3dy5tb2NrY29tcGFueS5jb20uYXUvbG9nb3MvbG9nbzEucG5nIiwidG9zX3VyaSI6Imh0dHBzOi8vd3d3Lm1vY2tjb21wYW55LmNvbS5hdS90b3MuaHRtbCIsInBvbGljeV91cmkiOiJodHRwczovL3d3dy5tb2NrY29tcGFueS5jb20uYXUvcG9saWN5Lmh0bWwiLCJqd2tzX3VyaSI6Imh0dHBzOi8va2V5c3RvcmUub3BlbmJhbmtpbmd0ZXN0Lm9yZy51ay8wMDE1ODAwMDAxSFFRclpBQVgvakZRdVE0ZVFiTkNNU3FkQ29nMjFuRi5qd2tzIiwicmV2b2NhdGlvbl91cmkiOiJodHRwczovL2dpc3QuZ2l0aHVidXNlcmNvbnRlbnQuY29tL2ltZXNoOTQvMzE3MmUyZTQ1NzU3Y2RhMDhlYzI3MjdmOTBiNzJjZWQvcmF3L2ZmMGQzZWFiZTRjZGRjZTQ3ZWVjMDIyOGY1OTIxNzUyMjNkZDkyYjIvd3NvMi1hdS1kY3ItZGVtby5qd2tzIiwicmVjaXBpZW50X2Jhc2VfdXJpIjoiaHR0cHM6Ly93d3cubW9ja2NvbXBhbnkuY29tLmF1Iiwic29mdHdhcmVfaWQiOiJTUDEiLCJzb2Z0d2FyZV9yb2xlcyI6ImRhdGEtcmVjaXBpZW50LXNvZnR3YXJlLXByb2R1Y3QiLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGJhbms6YWNjb3VudHMuYmFzaWM6cmVhZCBiYW5rOmFjY291bnRzLmRldGFpbDpyZWFkIGJhbms6dHJhbnNhY3Rpb25zOnJlYWQgYmFuazpwYXllZXM6cmVhZCBiYW5rOnJlZ3VsYXJfcGF5bWVudHM6cmVhZCBjb21tb246Y3VzdG9tZXIuYmFzaWM6cmVhZCBjb21tb246Y3VzdG9tZXIuZGV0YWlsOnJlYWQgY2RyOnJlZ2lzdHJhdGlvbiJ9.R3VzlpqZ4cAYE9Q99to8BoPc9-JgJAjvUWEX1KdX8FDDqsMFPDv1nHMaS4Vn_lWURRnNoVD3R5tuuj38stpAFcCce35yYWHHWXL7-L5hda9yoMLD-Mc_rZl4_AMEFs3ACduoM8m4p0PUSh8NvcDiWJPNxwFTCxmp-D1pw75sX4SP6-lIQ3gKOFm4laxjcNGBubEG1ypIa73OpJpNuuGa5a-wUfqNO5Yf0sS3k_d69mGq-ROUz_A5hb-RethxNBn3dolV-Iz8xyOmdCEdrGZPn0w9Ii53g7vX61AGW_JS-o0MmrHAb5PFF1CTtc66wN83e_NkCC8tMRFC7-uEKrROSg \ No newline at end of file diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_localhost.txt b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_localhost.txt index 23ed9bd52..88fa1ee1a 100644 --- a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_localhost.txt +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_localhost.txt @@ -1 +1 @@ -eyJhbGciOiJQUzI1NiIsImtpZCI6ImgzWkNGMFZyemdYZ25IQ3FiSGJLWHp6ZmpUZyIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjZHItcmVnaXN0ZXIiLCJpYXQiOjE2MzAyOTY2MzksImV4cCI6MjE0NzQ4MzY0NiwianRpIjoiM2JjMjA1YTFlYmM5NDNmYmI2MjRiMTRmY2IyNDExOTgiLCJvcmdfaWQiOiIzQjBCMEE3Qi0zRTdCLTRBMkMtOTQ5Ny1FMzU3QTcxRDA3QzgiLCJvcmdfbmFtZSI6Ik1vY2sgQ29tcGFueSBJbmMuIiwiY2xpZW50X25hbWUiOiJNb2NrIFNvZnR3YXJlIiwiY2xpZW50X2Rlc2NyaXB0aW9uIjoiQSBtb2NrIHNvZnR3YXJlIHByb2R1Y3QgZm9yIHRlc3RpbmcgU1NBIiwiY2xpZW50X3VyaSI6Imh0dHBzOi8vd3d3Lm1vY2tjb21wYW55LmNvbS5hdSIsInJlZGlyZWN0X3VyaXMiOlsiaHR0cHM6Ly9sb2NhbGhvc3Q6OTQ0My9jYXJib24iLCJodHRwczovL2xvY2FsaG9zdDo5NDQzL2FkbWluIl0sImxvZ29fdXJpIjoiaHR0cHM6Ly93d3cubW9ja2NvbXBhbnkuY29tLmF1L2xvZ29zL2xvZ28xLnBuZyIsInRvc191cmkiOiJodHRwczovL3d3dy5tb2NrY29tcGFueS5jb20uYXUvdG9zLmh0bWwiLCJwb2xpY3lfdXJpIjoiaHR0cHM6Ly93d3cubW9ja2NvbXBhbnkuY29tLmF1L3BvbGljeS5odG1sIiwiandrc191cmkiOiJodHRwczovL2tleXN0b3JlLm9wZW5iYW5raW5ndGVzdC5vcmcudWsvMDAxNTgwMDAwMUhRUXJaQUFYL29RNEtvYWF2cE91b0U3cnZRc1pFT1YuandrcyIsInJldm9jYXRpb25fdXJpIjoiaHR0cHM6Ly9naXN0LmdpdGh1YnVzZXJjb250ZW50LmNvbS9pbWVzaDk0LzMxNzJlMmU0NTc1N2NkYTA4ZWMyNzI3ZjkwYjcyY2VkL3Jhdy9mZjBkM2VhYmU0Y2RkY2U0N2VlYzAyMjhmNTkyMTc1MjIzZGQ5MmIyL3dzbzItYXUtZGNyLWRlbW8uandrcyIsInJlY2lwaWVudF9iYXNlX3VyaSI6Imh0dHBzOi8vd3d3Lm1vY2tjb21wYW55LmNvbS5hdSIsInNvZnR3YXJlX2lkIjoib1E0S29hYXZwT3VvRTdydlFzWkVPViIsInNvZnR3YXJlX3JvbGVzIjoiZGF0YS1yZWNpcGllbnQtc29mdHdhcmUtcHJvZHVjdCIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgYmFuazphY2NvdW50cy5iYXNpYzpyZWFkIGJhbms6YWNjb3VudHMuZGV0YWlsOnJlYWQgYmFuazp0cmFuc2FjdGlvbnM6cmVhZCBiYW5rOnBheWVlczpyZWFkIGJhbms6cmVndWxhcl9wYXltZW50czpyZWFkIGNvbW1vbjpjdXN0b21lci5iYXNpYzpyZWFkIGNvbW1vbjpjdXN0b21lci5kZXRhaWw6cmVhZCBjZHI6cmVnaXN0cmF0aW9uIn0.kUc7UyHziz7eElQ5bLSwr7p6oPZDpZas8pQeVOyul7racakp3F5djJ__P17OcrwFebbwTYt7LVY_0FGkHQa7DA9-U1CbCaz6XwmHprKr8sqWQwNw7MmuOG3h1xeNN0SL5TIhWckZcuZE3engRYCk_2Ss-USZqSf4ZEHFX6aF-1pcAb1Ua3e9uU1YEYUZTJEN5GIR6H8opg6KPXuBcv6pffdYNq6r3mS7ze-xRSH0RFFW0uq_VBBcCX82HvTwLSqrWzoyXiEI--n3ZN8TVJ0AuOgwOXXpUBTtIb6tnFv3_yGqT7cmn3bd9ytmAUsLgCnjEhs3KpXowEM2PaceADjuKA \ No newline at end of file +eyJhbGciOiJQUzI1NiIsImtpZCI6IjdlSjhTX1pndmxZeEZBRlNnaFY5eE1KUk92ayJ9.eyJpc3MiOiJjZHItcmVnaXN0ZXIiLCJpYXQiOjE2NjU5Nzg5NjMsImV4cCI6MjE0NzQ4MzY0NiwianRpIjoiM2JjMjA1YTFlYmM5NDNmYmI2MjRiMTRmY2IyNDExOTYiLCJvcmdfaWQiOiJUUFAxIiwib3JnX25hbWUiOiJNb2NrIENvbXBhbnkgSW5jLiIsImxlZ2FsX2VudGl0eV9pZCI6IlRQUDEiLCJsZWdhbF9lbnRpdHlfbmFtZSI6Ik1vY2sgQ29tcGFueSBQdHkgTHRkLiIsImNsaWVudF9kZXNjcmlwdGlvbiI6IkEgbW9jayBzb2Z0d2FyZSBwcm9kdWN0IGZvciB0ZXN0aW5nIFNTQSIsImNsaWVudF91cmkiOiJodHRwczovL3d3dy5tb2NrY29tcGFueS5jb20uYXUiLCJyZWRpcmVjdF91cmlzIjpbImh0dHBzOi8vbG9jYWxob3N0Ojk0NDMvY2FyYm9uIiwiaHR0cHM6Ly9sb2NhbGhvc3Q6OTQ0My9hZG1pbiJdLCJsb2dvX3VyaSI6Imh0dHBzOi8vd3d3Lm1vY2tjb21wYW55LmNvbS5hdS9sb2dvcy9sb2dvMS5wbmciLCJ0b3NfdXJpIjoiaHR0cHM6Ly93d3cubW9ja2NvbXBhbnkuY29tLmF1L3Rvcy5odG1sIiwicG9saWN5X3VyaSI6Imh0dHBzOi8vd3d3Lm1vY2tjb21wYW55LmNvbS5hdS9wb2xpY3kuaHRtbCIsImp3a3NfdXJpIjoiaHR0cHM6Ly9rZXlzdG9yZS5vcGVuYmFua2luZ3Rlc3Qub3JnLnVrLzAwMTU4MDAwMDFIUVFyWkFBWC9qRlF1UTRlUWJOQ01TcWRDb2cyMW5GLmp3a3MiLCJyZXZvY2F0aW9uX3VyaSI6Imh0dHBzOi8vZ2lzdC5naXRodWJ1c2VyY29udGVudC5jb20vaW1lc2g5NC8zMTcyZTJlNDU3NTdjZGEwOGVjMjcyN2Y5MGI3MmNlZC9yYXcvZmYwZDNlYWJlNGNkZGNlNDdlZWMwMjI4ZjU5MjE3NTIyM2RkOTJiMi93c28yLWF1LWRjci1kZW1vLmp3a3MiLCJyZWNpcGllbnRfYmFzZV91cmkiOiJodHRwczovL3d3dy5tb2NrY29tcGFueS5jb20uYXUiLCJzb2Z0d2FyZV9pZCI6IlNQMSIsInNvZnR3YXJlX3JvbGVzIjoiZGF0YS1yZWNpcGllbnQtc29mdHdhcmUtcHJvZHVjdCIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgYmFuazphY2NvdW50cy5iYXNpYzpyZWFkIGJhbms6YWNjb3VudHMuZGV0YWlsOnJlYWQgYmFuazp0cmFuc2FjdGlvbnM6cmVhZCBiYW5rOnBheWVlczpyZWFkIGJhbms6cmVndWxhcl9wYXltZW50czpyZWFkIGNvbW1vbjpjdXN0b21lci5iYXNpYzpyZWFkIGNvbW1vbjpjdXN0b21lci5kZXRhaWw6cmVhZCBjZHI6cmVnaXN0cmF0aW9uIn0.AXkzX0L8eDdJpwH-R3ZC6nGmY7KiC0pSTI7HCkwPVRLBw5g8cqULIjK37vQbMkyRTYSkFNU7XVsgZDRlQHIl_W66mo0G3anoTpzsjqWHRTOtQs0a36LYKdQZ-w1guNrNQ_rVHw8wNkQfSmcKM8CknEPOEIQg4o-wQz4LGGddE6ZJhKxcxFGgPZHY-RA8NK1zlMOmdQUFH-_3weZfbQbQU1JCjs8y9sQ05BWTzdozun7jFPOqhVTZ-xXRO77AVQIJxhuubidgofwITaIIetk-eEaLbYziNn8vGio_iafV2UwBJdBhk0wmPcANSJETt63WdRcgded1BZ92-JVoJG75zw \ No newline at end of file diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_withoutRedirectUrl.txt b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_withoutRedirectUrl.txt new file mode 100644 index 000000000..7cf81f7f2 --- /dev/null +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/ssa_withoutRedirectUrl.txt @@ -0,0 +1 @@ +eyJhbGciOiJQUzI1NiIsImtpZCI6IjdlSjhTX1pndmxZeEZBRlNnaFY5eE1KUk92ayJ9.eyJpc3MiOiJjZHItcmVnaXN0ZXIiLCJpYXQiOjE2NjU5Nzg5NjMsImV4cCI6MjE0NzQ4MzY0NiwianRpIjoiM2JjMjA1YTFlYmM5NDNmYmI2MjRiMTRmY2IyNDExOTYiLCJvcmdfaWQiOiJUUFAxIiwib3JnX25hbWUiOiJNb2NrIENvbXBhbnkgSW5jLiIsImxlZ2FsX2VudGl0eV9pZCI6IlRQUDEiLCJsZWdhbF9lbnRpdHlfbmFtZSI6Ik1vY2sgQ29tcGFueSBQdHkgTHRkLiIsImNsaWVudF9kZXNjcmlwdGlvbiI6IkEgbW9jayBzb2Z0d2FyZSBwcm9kdWN0IGZvciB0ZXN0aW5nIFNTQSIsImNsaWVudF91cmkiOiJodHRwczovL3d3dy5tb2NrY29tcGFueS5jb20uYXUiLCJsb2dvX3VyaSI6Imh0dHBzOi8vd3d3Lm1vY2tjb21wYW55LmNvbS5hdS9sb2dvcy9sb2dvMS5wbmciLCJ0b3NfdXJpIjoiaHR0cHM6Ly93d3cubW9ja2NvbXBhbnkuY29tLmF1L3Rvcy5odG1sIiwicG9saWN5X3VyaSI6Imh0dHBzOi8vd3d3Lm1vY2tjb21wYW55LmNvbS5hdS9wb2xpY3kuaHRtbCIsImp3a3NfdXJpIjoiaHR0cHM6Ly9rZXlzdG9yZS5vcGVuYmFua2luZ3Rlc3Qub3JnLnVrLzAwMTU4MDAwMDFIUVFyWkFBWC9qRlF1UTRlUWJOQ01TcWRDb2cyMW5GLmp3a3MiLCJyZXZvY2F0aW9uX3VyaSI6Imh0dHBzOi8vZ2lzdC5naXRodWJ1c2VyY29udGVudC5jb20vaW1lc2g5NC8zMTcyZTJlNDU3NTdjZGEwOGVjMjcyN2Y5MGI3MmNlZC9yYXcvZmYwZDNlYWJlNGNkZGNlNDdlZWMwMjI4ZjU5MjE3NTIyM2RkOTJiMi93c28yLWF1LWRjci1kZW1vLmp3a3MiLCJyZWNpcGllbnRfYmFzZV91cmkiOiJodHRwczovL3d3dy5tb2NrY29tcGFueS5jb20uYXUiLCJzb2Z0d2FyZV9pZCI6IlNQMSIsInNvZnR3YXJlX3JvbGVzIjoiZGF0YS1yZWNpcGllbnQtc29mdHdhcmUtcHJvZHVjdCIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgYmFuazphY2NvdW50cy5iYXNpYzpyZWFkIGJhbms6YWNjb3VudHMuZGV0YWlsOnJlYWQgYmFuazp0cmFuc2FjdGlvbnM6cmVhZCBiYW5rOnBheWVlczpyZWFkIGJhbms6cmVndWxhcl9wYXltZW50czpyZWFkIGNvbW1vbjpjdXN0b21lci5iYXNpYzpyZWFkIGNvbW1vbjpjdXN0b21lci5kZXRhaWw6cmVhZCBjZHI6cmVnaXN0cmF0aW9uIn0.ZdsXPQjxvnACo0_iTGck6lxPp2HatRs2is19jtgDedwTBLRwV1QWPaFm8P24_aNjFYcMKAhleCjJR1VOtkuouRxrpmUBrKXnCTRrSDEwbjTkyi4vDyKTbHqL1ldmDA3L64o9k-6HXIRbOkcZHNyAYU8C85iLddfvDJmPnJs1Uh54I_PTz2MsgEpWUk9-c3OEjJ6M9KuUtSgWVgM81AKpsV4oswc6rRQAaGoSsS_Ft9O7Mh8PJCbF9lzfKhFWQmt-cps8b6i3Oz4lxyWa8__kisb74wro6iWwPXmrK3KkvujG8jlzJW_-vgl4ywGMyRpmWXeyTKLig5Gv-MNC1_6Wwg \ No newline at end of file diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/transport.jks b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/transport.jks index 0d1dc34464e4a6fb9ec5d6933ba58e7429582bcd..9c70d7fb9063c17db5ac7f9dce1a3bc2275a3ba6 100644 GIT binary patch literal 3208 zcma)8c{CIb*EVB@$i5`93=&y~m_cJ?Nr()iWGvZb8O9ny(^$$<*|(^%%Wkr-A&RjT zAz8+fJ!_1JUf=oN)9<{0z3;i_o_p_epL_p&?u8PV!hrxpa&2M zOhO<6(}h!*2TB09{znU30V04)PT|5+&!s#2?JSCu>f-s_NblfBE@` zd#77jed1=7imH8J4@{axjivi4Wc;Z4om7BzZN#^wI_%aeck)2`%cm(YP(m_y7kr1> zb;iR{reDFwRJT;zRR$_$peVCi4xnn{AZK+i)XFexf!V+>ZR~VISp5geT#==!D z4(=YlkXl`D(X}3TpdFxj3rxp>W*f;kpB7ObLIl-v>%4TqjlDB6_>{}cpdBGyxL=&_;s5^KMVXt%X>q6xTs!oWB&3aYn&QJLy+s>(4>I=Qti`p zhmx}wi?hzBzaIIPIRe+xz168$uKMN@yH0F{X-UD)fjYKW1NU1Oa%u(IQxaK_k2d?n z+nVS0Y|)l-(>QUHdSlAsEcqCpZD1W{CWkiC+q(61Fn+-4^~FYtjI_GcyL*e^j2mg_ zreA-0`+U%zDgZkS!{qaR;LgJ*E0_`&;1huw?&O)sw6Ws`?<+Vyo;GC$19nC?i zMuDaG;Ij)j=C;Iuij=wGMzVM6hmz5l&A=O-WZcDTWBwUS`o?A=Z#Q>0O4FJndp0X( zTsPXI+c^Z@LxnGd@5-V2L_$#F{YSoTGmU};)wj}?#DK=B8rJ2u<;fni!*Dxcqz@TW zd07H<#&P$1XsSI#6*`DQuRfTD)K3IZ2SuGNJcPnlx^uC2@^hn&T-q|fRRi;(o&r)K z^!x|5$7}b8=ZF#Igu-SfJ`x(%8*vU3J1%JuM4q5158MB2-TbP$98fF6i?kiOd}w6=r0&bb{NXYAGwKW|=Izhf@+B8ox9>n(UFI=2)KJ zj56|MU&G3%xMaia_J>G*uouzb;x^2}oaO9-xXwr6s6X=y1R3`VshJ@~Z@!bj6gydF zI>6x9_qkWaT=0G;CM5iC;kowj>zOpla4#S$4_ll5Cq6$8})uqug~+=^ebwq?uSSkHuu79V zi(tlDrrE{f|3$VvT#{CVel9cVRHHhIpZ46s6Tt7ZkGpm!DQVj={X(vV#<`MPUMXe{ z!fB5x_#KoYk!qDl-e69#*t;$UHKsmwHc=tN*c1`D306kYqGf#`WTkH=J~)r!OYt60 z-X$p{dOezKJhqmXm z?hS{jZ~J%lTP%wfBUjjsmsrMFZx7yK`+Wv%Cp?$Ioxu|>#h85U@uBUBbP6U_ws#FM zB&)#QMG>*17Lv-!ngT8FJ0|t@HB{{@GSYcpu_P+DNu@pGiy-{TFMi(P)AYg?EDGMD zjP$5jC+<_peOiV@{pc~b@{c0hc0%;))cK|-3RX9U&l|tvgO}}%5z167DH$sX{d`+g zZm9hEO5aMC@%*n%eh8R?p$B03KnrS@O{<`LBQPkDIcrGGkD^-T=P3W_lJ&-0C$}v` zJpi9nFB^hUD;sELCEh2R;din~MI9Z(>3Ikkjgeb(SDgN>h(o#t+zCr&;^F?DSjw`_ zB{Q3>7QLy2p3*kgb_p4qU$l!UR9cz1B@2-d%9Vy*j75mBQJ@%%ZgSgA?IwS+`gnW;Gs+*)fvjIr}}9 z{ASHMmUy6wJ5te@rQYdWp$X?KweU_K!_Ko_ z5froZ@u>F8mW{7QSQL+4H=)^jF57k0o1>SvGM8}M<#T%WgS#vNp6|;hFyr^b3*Hu! z8*`pq{6?N6;+n|k$GfG!FYE2}%sklm`tlgDQ%qgc@2p40-rg(yZIO&cGfgqfko)qL z_^OV#2gI?N`s&09T^`dhsxM=YW|EH9kI2H2n+9^NBM0~_|)_JYe-4s z!E=lj;4>lO;UZNx6k-yxtri4QftpMN-XnVcvTl({?lp8p@oe}ztpWc=#mCC@A~&*y zjGfJOykgDVKk8O=)x9urZW)i5o}ubIU>y&Nsnzt>T*1Ib$=-v!l;mAd^h(F)z+cf% z1e-c*x{HLWERTzNYhH(^t9V;cdX%|j%od;PersuB94hJjKL37q^<$uk|)oTUv*)o-vXE5L2o0E*x`t=GFSMy8B6MeMXSf$f$fLzU93obxsp6jod#Y^m9gwF1OuYR+Z&> zMxUil|D}S^sfL9157!`85!JZ|)NMtZtuH*cud|si*!;q& z1lB?ayvYw9P(mt_wB!pob1?|@T|2|Lk*$wQ0Bki zIS>G*0YM^jVmky_XT2Z{Gdd71CeExAB|QOWca4^wldXy!Z#fWGGUm(=2V%UIDCpVU Q+Gd2odQDu^|DBM30X~-AkN^Mx literal 2699 zcma)7c{r478=rSJMaVX`Ft(#Jws#UbME2qogUH%6rje0m#>`M;n;|8qj>sB9)+mJR zgtBMJk`7^H$;r}3wm#{M&T{p~_g&X{uj{$4_jkX)`?;Uzy?*!a-dWsPgg_ur?gG9o z0Va*6qt2ugC=42v&g6!#-zvoyLLdkT$cAr&0!Us}Bmf66P$2+7K;Ufn`*M}K&sXj% zwl7KkpyrYvQI22!>^^+#oy@rJBASYI_D@>WqlSERN+QMWwV$ z23Xbq7>(r!nSE*sU4BK&#^q%59Z2a`l=Un; z!3#4rjT<^h3y3Z9@w{2|LQdea!|LmF8BJoFxGmv72M*-|HwX)=)<^`ZL8r>ty1TS! zWM?Ma&v2lqsr^RRgu7jDz`cI+N<(FO;OWa_n|!e)PK}PgeF=cdxV7?2P@2 zM_5>Wy$e*TNKWzjv3W#nnM9VW$Tf$C>yq$lIR5frc5_kR7mwIP^X>#K73tp~rGw6a zpT5Ft$~dQvmWrwC$aP5-=z60im3+koMI6Fil9_QC&BzZYw-w_cPCG9=9_Xd2Sc&4h z$Ij40(HfYYgUf@fzhYjR+X;_^FB?!Ff84ZAMOD5KGIE4=^}iIX zz_YY{fyKisY9WO3b~l^PL??5`lJhly^rt|;y|v+hr%w;6Yu+5&kqqjdPt6<>JaA&F zZ}{54Epgu-A-|^h>j{OaTBW(kLzgk)>g0*D@q;&Yq-%$BUQdl;R9;`TUiz3ZJL%9; zVP-C1oz0#WOnbe$KcrIE7mIlKlZot)Z&Qrn^wRM~c7o+h9!FjU!k9?*# zH8gru-h6)fm~O!ip;?8E?Qc@o@OpNyW?<1c?HZm%SeO_EhM(}(84}WOd8QhMFerjQ z2fs$c$lIt6z(&F<&y@Se%}+$-3;t*DcjTPeQ)ZSkSXNk#STX$yvh z$U_{i!11b=eaH*PXUG_rENm#Jn*XR?LR=F2B-}o>Tl&a@+it&uYfnm|4}LgjlI%U9 zeeQId=B8#~b0gU7s-?hSPf8ZHwqI`{w|8f(Mjq!I`zCC zkx8af(3T8_AD4_aH3ntH`44G=q|JQ0d&d-!K6f#6TG@uQmS(*122F6K6lARAEl{;J$L z0AmA!+yMdbLfHTSN&JQE&A5k@98H8BD35Rv2g$`9%2&Xe1k0$8^lQ2KE7Z2@a)O@m zJ$S=b-_2W&J{v7(AYxZ1ibk%$YQ}!soL_H0Wt!WUR(8`-kN$esC+Sg z$7W+8WVvE$s9RI^831Q@Us&*}Y5b%+iT2t){Vd$yN zm6=DrIE`FwK3ZMqJ)HMzqq=TOP4|LPnFE}De5co?OO>{M7*qVod4i`_N-du}*VXqh z;)0%XLqfeXrxpqWAix7Q6b`bX5bnr?ImieCz*jgN2IUC@(YsiA7o$K?Eob8L__HTb`|GrbWroinK03x({V2W`+tXHO}?zzv5Q!Mtya$?CS zB}dj_CptnxtpjU18;F!u^~h?R4Ni^Cqja9jugaP8NvX=YlcGEo%5uzj*WcV}yMA!4 zla`^7UN&YVa1l8^+BEG&kb`Op9?Clfusd_E=+0=X_ zbP}T%ZT_|Yml%n4VOOJA(M0R<((Bt1A+z|x>-*G7dQ=Q?X1W!}-!E*UQUV@z95?s9 zS(izq$l%r+V9<`=D6>BT0z+X?;(sM03JIodpKER%7rr0^ z0?`6cj8NMDP6N?F04Q!Koo%!((2)iVlmH{NxUYnn*58iQ`!UtBQ=I7^PK1mY>z;gJ zrJl=kvVHvHw@oN-A)k`{sck8 zPqIY(%mYgyz`BX^5g>aRI*-coa1!)n#X0W7i55bs6wy@TR8T1R#9tcNZq z_t5b#vmPfyx9^emm>+F>D$o&n2+=WH@`_Oi_L*)wnK zX3v3Ttfr?!#uf*)Uu$7+{IZyF2Kt=!Q*&;6lIGv6j z1~51(BLf$`)y&fmw4?-+JdBnP3!63w;W?1Qrsm7HPIBExc7lv4FFSiSt*<4nDZ-%p z`=)p7M2r4u6wp$gfJK-;wUZR@OmcGJ5m@Zvg`BGb*n5rShgt#f`hF}wry^trG6cU$ zJZ9n#5I7QD-W116m&kRwMNS8|{*ZW4Js~sIBGv+p; z39IDNqnq~XLqkIZ^lf@9`tG9b6CDm|-{Ok}(W0GG9wys` zp1mJG$Tv(eif{z2E(#7IlDi>Qv4?7nZPrmUrF+AEqfaR51bULYQG+jNRHbraSMxd2 zO+UKmz^^=8FUx^|xNiFyE&TfBtfR}$KNaJBZxRaOu8QxlgwntcV+=m;wLgo(G^HvK z91Xu-8|;A3^|`FzryQhm-*97sP_hKC4^idT(mjY*gGD`>3p3(U{8)|UeoxewGIW-)Y!hQ_01GDnu1G?WwPo-weDqy;L`Hg^QovuOKQ+^lejJIZ?ws{Y46XpCyxD=1M)M$XtdrC`+@>ulHa}AW`&c=8-wvOO@FtMT1YR2NJHk9_UvuWODKs%YB$ z`1`DL`gYf{^+fK%$lgjB&{30Oi&HCzxgq9y7j%yFRCB%UCPx9j%x?YIcYqqG#csSL zB15v#P-!eNSm9>{wj&++bz*{fQJ%UHq#?=Og;!VuX-^RPWshXEq;e)9AAh}9c{X)P zEZ#uk%NS>D&%RQ*@-;!0`j=t3eWA?aESj=rK8VD)1s-%(s`o*8gM0Irnc{;(m+FuP zr}g7wk=nEl3GpdJNv+?)qn=NP?yT;sx_j5C{m7f=vxFy^yIt@8yu*||I47V_{^2`0 zVr2KbalrU?P0ap-6K51U%wKMxW->IBN18beVRg2{?o*yNu5y5~ORsGXPc>(De;%1J zd%!W7zcc@B+avQR{%27?57Wh#F|??O`=fWQ;kk9DA7*_zuTo()ba+fru2c}UD3wvS z`SZiA57&G)3?yN#)JMWna#eTb$tes?CHc$m0n%!4t^1?lFO?5!Qk%=5TpGuQG5TAe z^XXd+VYbE+w>X8@*N-$PrJK_~76(tf_0?WL8l z2So>w4Et!ghesb>WeQ%K3AkrMkfT6jN_?2?n+@M0DnSj~j1+cbk2ItlGf=Vm^ATce zOq42Za@~P3|C0ZTo;hDO;=%SEEN%@VUdwt^BuWi>yh z_`UkRK}R;RuXVGMvoG#&X3WeKJ#_xWQzmM#r3A;*zq%x)1NbeMJ1UO9-q+qI9)ZXe z)?ZM+zEA%AlI?T3>3D6qmzt_=;7m20gnbL6T^JXrGWpWQ*bM>r&scZKGG^)JqOyc= z_oK#V#IGuo_X;d${Sip%Q7OjDy*3RF3N{wEWH^{IzVq;*gPO1XYL?I$8$L^DOjkCu z57tLUzY$NCg}y!BrEEM^Mue}FBwuh)F*=Ewjho?AT#HH?SEQE1OD^G-*v+#&^;(xI z4EEzFm)_^-#NXjRGqw@?&{eq9T)N9pA$()VDPg7P;fM0|=A+oU_-xHJWdSWDL<#jA z-E3;^)+T$HYFDR6AdbV{QjLAmD0Ixq4`?=HCZNmW3fKzH z+t~#IOD!SsLb3^b%-j|FoU(;UWWuT$X>WaN@`Jd+LCl5LxFZFQb`?U~n_OPTNDrnL zT)&bsSK>a+H?%ITBfPz|i*x+!r7_RNl|_8Zqv1t|eOH_u0)C#Y9HL`t^L&ouW@s;4 z7E{~JlaAa2<$j))_!j)l!6`|jfu=@jkD?yc!ul@zn4*W2>-MkOkTK-6RmvA3Qo8uM zlh5-dp_w&_t?S=!GQAyetQoWTjB)F_{61cXWj`?^fefeh&x*Nfl&mVbv%+=|=xLGz z#$2)f@utNkFR)T2F%3lCm>}cU+D&ans>W{tSq94>V8BEc~${3>r|14O#voh>pw(O7Np?zYW=aDuVVr(7B zD||nDxltGXHnGX@@E`%c0PoWy54d<*`2g$yo`8F&+UvCTMO{V7pkROg>L4Hl0Ol)v w9Wry@;Hq}*@O(&g`ylB;T>HiG0C3}IX$Sz%OUnbMrE^%s;qAfHfA{i#02s%@y#N3J diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/transport.pem b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/transport.pem index 9486712a3..294bf61d0 100644 --- a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/transport.pem +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources/transport-keystore/transport.pem @@ -1,16 +1,16 @@ -----BEGIN CERTIFICATE----- -MIIFODCCBCCgAwIBAgIEWca5LzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJH +MIIFODCCBCCgAwIBAgIEWcbiiTANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJH QjEUMBIGA1UEChMLT3BlbkJhbmtpbmcxLjAsBgNVBAMTJU9wZW5CYW5raW5nIFBy -ZS1Qcm9kdWN0aW9uIElzc3VpbmcgQ0EwHhcNMjMwNDE3MDQ1ODE2WhcNMjQwNTE3 -MDUyODE2WjBhMQswCQYDVQQGEwJHQjEUMBIGA1UEChMLT3BlbkJhbmtpbmcxGzAZ -BgNVBAsTEjAwMTU4MDAwMDFIUVFyWkFBWDEfMB0GA1UEAxMWb1E0S29hYXZwT3Vv -RTdydlFzWkVPVjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJeMaWpz -mwYZ25cDHLSEWhcwaa/JJXgwupZJifByhaao8m/Hhx8PZpXOXz7GcfiNVmz3w1cA -FXvfrNh4A7rc2vjp9shNQ6bQnbOKVjoN+rNxskYjxpvLOllCUaii5kjdRF5r0YE9 -7t3hH7GdATT56Js9aomykbeYodG1vN4eDcgArn1fO7q+6+0Ew2Mla5X+T/fsfu+1 -4tXMLx7AAQSCzGfsYnJp6fCJQ4uk1d5mlYWd+cM2gWf1eQ5sHeL1K9B+czos57NF -hsVUBvPCPLmratanj78tN8O6zOxAs1UEckf+z1rLK3D2NCqv9FnfB7saLKhp58vQ -qoRnOiW+lr1Z4bsCAwEAAaOCAgQwggIAMA4GA1UdDwEB/wQEAwIHgDAgBgNVHSUB +ZS1Qcm9kdWN0aW9uIElzc3VpbmcgQ0EwHhcNMjMxMTE1MDUxMDMxWhcNMjQxMjE1 +MDU0MDMxWjBhMQswCQYDVQQGEwJHQjEUMBIGA1UEChMLT3BlbkJhbmtpbmcxGzAZ +BgNVBAsTEjAwMTU4MDAwMDFIUVFyWkFBWDEfMB0GA1UEAxMWakZRdVE0ZVFiTkNN +U3FkQ29nMjFuRjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJslGjTm +0tWwnnKgC7WNqUSYNxblURkJyoD5UuSmzpsM5nlUBAxYxBgztTo062LJELzUTzA/ +9kgLIMMgj+wG1OS475QCgeyoDmwf0SPuFRBl0G0AjxAvJzzs2aijzxiYRbKUa4gm +O1KPU3Xlz89mi8lwjTZlxtGk3ABwBG4f5na5TY7uZMlgWPXDnTg7Cc1H4mrMbEFk +UaXmb6ZhhGtp0JL04+4Lp16QWrgiHrlop+P8bd+pwmmOmLuglTIEh+v993j+7v8B +XYqdmYQ3noiOhK9ynFPD1A7urrm71Pgkuq+Wk5HCvMiBK7zZ4Sn9FDovykDKZTFY +MloVDXLhmfDQrmcCAwEAAaOCAgQwggIAMA4GA1UdDwEB/wQEAwIHgDAgBgNVHSUB Af8EFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwgeAGA1UdIASB2DCB1TCB0gYLKwYB BAGodYEGAWQwgcIwKgYIKwYBBQUHAgEWHmh0dHA6Ly9vYi50cnVzdGlzLmNvbS9w b2xpY2llczCBkwYIKwYBBQUHAgIwgYYMgYNVc2Ugb2YgdGhpcyBDZXJ0aWZpY2F0 @@ -20,11 +20,11 @@ aWNlIFN0YXRlbWVudDBtBggrBgEFBQcBAQRhMF8wJgYIKwYBBQUHMAGGGmh0dHA6 Ly9vYi50cnVzdGlzLmNvbS9vY3NwMDUGCCsGAQUFBzAChilodHRwOi8vb2IudHJ1 c3Rpcy5jb20vb2JfcHBfaXNzdWluZ2NhLmNydDA6BgNVHR8EMzAxMC+gLaArhilo dHRwOi8vb2IudHJ1c3Rpcy5jb20vb2JfcHBfaXNzdWluZ2NhLmNybDAfBgNVHSME -GDAWgBRQc5HGIXLTd/T+ABIGgVx5eW4/UDAdBgNVHQ4EFgQUSoZfmnXGAPddPqfH -WVOvkxD89MgwDQYJKoZIhvcNAQELBQADggEBABHzHOJzn4DPHay8xGzlWJIxxe+X -sNtupR5V/ouEGCzJMUPmegYeK2Kiv+Z9nJKnbspgqLil52yauKWRmiXif4FWoOPR -wspR9ijnynCgIp6z3EAOawbe28HkaGEfAi8PMqdNAYLKpXg35TUnbP+p2Q55Grq9 -EpSR2APQfJ4TjgLgKjqLRf/RjJAY9hJbQJIUl07esYf8hH7mX6uHDCywzic+UEQ3 -tUfo7PgWmnmtyUdFcW1qAl4P80a5fb8Wq0gNu6gN5tK2bg5TfSo3Gp2It8NVu/dY -7q3ur7CAYTXrThjg4GXUQgVqYgV3pHbr1LTAiRtac7RBhMNPCklZA78RpTM= +GDAWgBRQc5HGIXLTd/T+ABIGgVx5eW4/UDAdBgNVHQ4EFgQU7T6cMtCSQTT5JWW3 +O6vifRUSdpkwDQYJKoZIhvcNAQELBQADggEBAE9jrd/AE65vy3SEWdmFKPS4su7u +EHy+KH18PETV6jMF2UFIJAOx7jl+5a3O66NkcpxFPeyvSuH+6tAAr2ZjpoQwtW9t +Z9k2KSOdNOiJeQgjavwQC6t/BHI3yXWOIQm445BUN1cV9pagcRJjRyL3SPdHVoRf +IbF7VI/+ULHwWdZYPXxtwUoda1mQFf6a+2lO4ziUHb3U8iD90FBURzID7WJ1ODSe +B5zE/hG9Sxd9wlSXvl1oNmc/ha5oG/7rJpRqrx5Dcq3LEoX9iZZ3knHLkCm/abIQ +7Nff8GQytuGhnGZxmGFYKDXdKElcl9dAlZ3bIK2I+I6jD2z2XvSfrhFyRjU= -----END CERTIFICATE----- \ No newline at end of file From 2fe0a51737db67c4767d09df98f2854fb8db423e Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Tue, 26 Nov 2024 13:11:56 +0530 Subject: [PATCH 06/20] New Test Certs - Set 2 --- .../AU/sample-client-resources-2/README.md | 30 ++++++++++++++++++ .../signing-keystore/signing.jks | Bin 0 -> 3204 bytes .../signing-keystore/signing.key | 28 ++++++++++++++++ .../signing-keystore/signing.pem | 30 ++++++++++++++++++ .../AU/sample-client-resources-2/ssa.txt | 1 + .../transport-keystore/transport.jks | Bin 0 -> 3208 bytes .../transport-keystore/transport.key | 28 ++++++++++++++++ .../transport-keystore/transport.pem | 30 ++++++++++++++++++ 8 files changed, 147 insertions(+) create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/README.md create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.jks create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.key create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.pem create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/ssa.txt create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.jks create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.key create mode 100644 integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.pem diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/README.md b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/README.md new file mode 100644 index 000000000..686067101 --- /dev/null +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/README.md @@ -0,0 +1,30 @@ +#Using Sample Resources + +Following configs can be used in test-config.xml to use sample SSA and keystores for DCR tests. + + + Path.To.Directory/ssa.txt + + jFQuQ4eQbNCMSqdCog21nF + + https://www.google.com/redirects/redirect1 + + +SoftwareId of App Config 2 - SP1 + +Use signing.jks in 'signing-keystore' directory as the Application Keystore, and transport.jks in 'transport-keystore' +directory as the Transport Keystore. + +Sample Keystore information: + +- Signing Kid = 7eJ8S_ZgvlYxFAFSghV9xMJROvk + +- Signing keystore alias = tpp7-signing + +- Signing keystore password = wso2carbon + +- Transport Kid - 7x6UrhU-Yj1Aa9Ird03JJCcDurs + +- Transport keystore alias = tpp7-transport + +- Transport keystore password = wso2carbon \ No newline at end of file diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.jks b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.jks new file mode 100644 index 0000000000000000000000000000000000000000..87b93672623c128e7f66e70e4b42a43ff6aeadf7 GIT binary patch literal 3204 zcma)8WmFW5(%xc;Wqm~#Tsj2-S(lVpYH0~UK%`Mxx>b6WT9y(dTtVtx=~yZ0l5(ZH zC8VVUMFpse#!zdR7RI z{>pFoG8#u!{~s-?VhE1v&2KpGx4(wM{yjxc2Lxr~sFZ$#7_`Hm2`V_+6fONvNsktW zAc}uEuf?6ld>@+@wo_&E9e%qn_8kNgxCjDrq3NMC|GyDLO9eo)LuqXyHG%eE2v7)e zkzEkl09LfgRvho3xMQytL2!^k#MBth(5<%99kP+qr%(YF%VeI5-8+Kcm~V&*C>O(d-gP*t)1duCbiK^_rG3wuh`OC{`ai4sxXr-g|6b(zP9& zt3UkZswI;sHmrE9`saD)b-7oe&t5kmlLsePT3vDk#w~fbBoPJN z49yqPpJ^&-3TlpZo)cof?mm0>9RHl($>ZeXn=_Yfl=iRSUq!tQN5edxGHFF$(>^A< z4Cepg^&v$H?QoW@x6~U#eShu^;Uel5!32q%)|c%2>ABEiGc+1t`O2nq9Z-44JE9!5PNu#$trlSM&Yb@uSZ7{M1g=n3af61b!qw z2cWI$z9<=NnQ%v9^aog!pT5i0x;8|spL(`H1pX&*-etS=nvwTieEhrix|v&+&s}&9EDWx5%ZH`)EXa3wAN=<(1|a zM$Sq@om$I5r?cljD{cT&5ywGXJpsEQ0Q2~IO7uuqr*w^a**Fc6cpF_b@y1C?>&S|3 z;gwd4gnlbhYfUkZd@9IjTIH)eWfSnAS%X|FN}CDj;=B8;09%86G->F%{wN$tM)J2m z7CEj}rCWWCS_Z}ASD=L)HzPWaH^>kxsHg>s{c|`RoEl0}eCQp+X7+Vg;p1qbPwM@u zO-*6P$Sdt5NJvGKd;KDTjAr1VT{qf?-RE7Y*G>YfEb*WmvDvkRo}w%VsD01OPq}h; zaO+gQtwT=H1+Qq~T-UT4Fr$LMK+Hb~Fu@2Zk2pG4P9f4{g=FAy7$x>zj@!2U2~-w;nL*V_##2H-6ytEfe(Ez@mUpgcyD6eIN}l112i#iAYxBGJ3qo zoApw5sCqoaJS^la(oi+chouLh%#?V2R`%ikLL|d{FQg@SsKrC7gKhaH@Rlq!>qW1M z5_P5cfM?9~<*CHKa<%mKJ$*^|`s*IL_mw(pB~oAIfzvmm5@tXzijPc>zLey1K4nzo z-(Em^IZX&$S}?VX?n_0jw)ZmTBi2+D2T&siJpI@iMT;2eNlpyIiqFJ%KXx-^RR}!R zthLM`xs9(vr0jF>;ul$5B^%QOVKQFDHT;s=h16&_zOvFcJ_p>U@1{{9$A6`=JyrhN_qdkl?q(H^t>M7OoQ zjEblZTHudd(jr7zIFJBefah)jNcQyuX4~LZv%#Qa0wwBeMOGM&sx>6u&*9hJFPqt&9H?YBOD6{GYAJua{@xR7 zd|}WupL5qi+~dpBm(exCS#BSZN)RF#ojawZaY^@REH`LqMn02$uCqh4D4eTb0V{{%n z@m( z6c6CPUBXtJzp@J_7o}U?ckj}<_ddyeW)8NE+xOg->~%QHg?*sSYocHr6k{=+?ON)N z+@1%`&d|Td^||F7MrXcS09iZ_y^!F^$H#cJbNMNsg+QjUt#oS5MQ_cFwWxAsS9-uh zUNM1)Mpg6mDVFvNO;_4(`6ky@X;ybID-?9}cxP>XyxU4P<(C#a8j2%crBSGMYEBr} z)oqE*u4G{^87MQY5Ye|6iOrfH8fh>-W_&5XG?|>d3@3Uq2iYB_Jjbyd-lcR)6DH3h z*U2kCS;b7gGYLldrw>@(Jo|nbuzux{EpNUeca7DxLTBNEL`EH2Wwni|moh8cDPJ6O zG^gbd_3ctLa9u-u#6W`?R}Sek8d=5XV~w(jyze*^s4a)T+9-vHw)Z~377@jgO!UuO zB3O(cL#WhCiLJQLC|=?Wx1LB%W{vm^f(kO&XD7}w=ABz{a))$sk6YZ~+fT#g79w}d z=e*r>-M22hXPy^);gnrte{R(`{+71VVH?gT{7xYanOsE6%*r+{a|?S+&5>#A;94s2 zuJ)y4Rl$<0hCn(S+4q|Mwom5W4sM%0S6H(k*-3^=y>Y!`G`lt>k;v+&kbm>V6lvHs zwaNqkr1y$|ofAJ?;+!Twm2BX(rqlf3jz{fro|i}Q>Z_@`@W+Ft!$KlCvWKBFa5v#c_%g_tCQoOq25+Q#YWH0^D} zO@hDskuFPnEsbxPxqS-l7HZ)Nly1;t@knM+S>MuQek~Y^-u3;P%a9$G*(+FUWAas{ zY1&w#=T+3T(lo^69=w@E*7m4G$}D!@fkt5P5*OJ=W5z?RvjhaB5_mZ~gmH*hwTQ+G z$Ov^|Q=f*9W%O6y>A93@56x1YLTQMc4qqI<5Fn#e~SRqsf7YAKt{7iG<(IQUUzh#@nzqPb>ealxu zZj|WN40vxea;)dS^&u*tlTnWn#2&g*IqFU6kH<>T<>iR?vuT8LmgnLr0Rn$9eo|YU z)6qb`gxJPvz^M!ss*5+|^!wZsSZUX*eu;d@Xpy(wMat$$oaYYLy47m4X=K}TcNG*5 z?yK@&i`!n3uc%z5e!txxy%W+Y-e~oRw70+05@V{*d17RRaj^^9$Y@>6%}q6XZZtpo zXtGMsD{#;`+jz(4r2`=vr6UtkLO29F{xGvqsH0Oivi@1By%a<9f&S8UM*4!Pcc>DT zh7ToCCTi;vRhg`KN_xjN&-)eN^Yn+YSi-XZ?7NR)?JaqW3gEl1dJi`X5W3Z{m8ED9 zQa+dCTy1RV#_RS9(SdtkZxKXVsBNVT4HRS*IjZMs9=O)4PCC?ER+8-a$f#}uIYa*& z{cFKny4r)`X?jbiBCVgwPbru!*%?Kx_j?=+b`<%+t)zAoF|yxjC2SPWiRv*~tp{8z z722fmEIGSlXxOD|C0b?+w*z33gsbEAoID?rh-q@nOA7((JdP8NQ9sbSXi+r$&u0z- zQUM@ba|hbgJh6q5u`Ku6$a_o1DZ`*o9R}6&Jti3^bFA|hAqYBgPw&nj$$iD!Q!_n;k literal 0 HcmV?d00001 diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.key b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.key new file mode 100644 index 000000000..1c497f458 --- /dev/null +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCot+hw9Ka8dTd6 +X2nyXOqUjINItIzokK7flmehqYSlIQNia2wcVk72m19UO4Yn5eVG5ATpJ590gsqg +aZT0qpLGC3T0nJG9ie1FS4++ju0ZBC6BQ/r0q0PBVhJ/JV7+FIkvMpb5ayD2vPqV +bQMDriN/2BZqgdZXB4ASPBBCw1Fh10qdzoZHCo65u+rdbEM9LbJouWh2UdxV29HQ +AkDvnRmpCHq6s1JgHXHC7VrkiTE/m+3OyAw5vyEfzFe4qJdOMngZDpVq3iCjqh1N +ejyNzfz0jBLfeiQFCmf59FQtMeGB2gWA19u7H+Bsqbm4JpHHeCGxv/FxLh6tyJPO +KBKT+UBFAgMBAAECggEAAw2g9TpYMhzk7h//6NTpodqRHaW2zxafM4ijQ3ev4NUi +HIvZHwIo16mkJgAVw28ToR7LP/Tpm9AqHpEKkwrrMQ5QBYU31fhDBPgDF+26OLOs +q8YxKnBW/46xMv/YIjz45pPBy622oQB2gHHCljR2i/+7GB5VZKnMFYhkuvCR7nVR +bHaOdISM9fyzJBkUY5pVkCqvAdSQGoLKubAAuHN/wzVevowmCwOluED3+kliOhma +9UccRWlprTsWbMenIZKY8lJmiA0bOGrkyCVz23780bVB/gFpeCNsYjUrLwazAfbI +wKpsdgxOrVsaluaFWZ7TQtgSXvZWCtHfpvbz5yQOAQKBgQDMceH3gLpV5/uZdulI +84aVrXREkWN0AVCM1PHhtAocom/+Dvu+L1qNDtT2iPzH95gKhRwk4NA+ag4Ycns9 +HZkTQbwMOuybC7BvrLI0vnQfTkyiAjUownRJSgZfo7vYt7Ap88jgBhsGd4XmvEbO +SYwyCuXCeZvYLPhDT3MkrKgbhQKBgQDTQ6wJJYCva/FJ46huRL93tnfT6xFjyAwU +9UttYYRDrCANTyPPFTL6T1welRpUq8ZbitgI6FOrUCC/80X6hNcD8O8PWXcTS4oK +OEIzo5EOSB6yNeWwPaUd50i+iDD0W0K94dmj+DLjGJY8wA8yaLr2oWJW5GyAGhYm +AdBe/VfNwQKBgQC1jCeiVrChWpjFBaBRhNetkNMflI/hUs2J0gtdZzhXhzO2Qu3w +TDK38kTRDIKUvFxKczuzz+N8mUcdFIQ1mFP3krb/kU/MuwuZj5zMU5fguPI6J4W3 +RT5oWpDgWxCTeUK5bl+h+CoFixvf8q9Zvlv9kEnJcZ4f0IdBlorkNWIu1QKBgQCh +PZ344SGlQWpILbQobNoBYUd1e4yrLkxiVpD565qKF73iyosXCyP8PUOep8gP5Yaf +6YlWyxLIxoAoYGEBgg+lF2ctvOeP13CEukl0phsY3lxnQZGLgJEcEKDJoqJSbbCz +wcNdTRpxjxtjRGaU37AKekPW88IHx2EuIuZJCWzRQQKBgFE8vbLbSYxFIE1uhast +2/9WFblB2Mrxsr2HFMW7xwOPmeh7H2+zZ2ZS7rVls1jC6e25SgnPyF/FItPrNCmW +7EFzv73oRhMxGS6LImFQtTLqNAUl0Msmpheaxgcb6bM6Gns1co8bEykoaFRdhmHR +kcoyjehtpocckAWTrtW7gPcl +-----END PRIVATE KEY----- diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.pem b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.pem new file mode 100644 index 000000000..0ebf69a67 --- /dev/null +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/signing-keystore/signing.pem @@ -0,0 +1,30 @@ +-----BEGIN CERTIFICATE----- +MIIFLTCCBBWgAwIBAgIEWcbiiDANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJH +QjEUMBIGA1UEChMLT3BlbkJhbmtpbmcxLjAsBgNVBAMTJU9wZW5CYW5raW5nIFBy +ZS1Qcm9kdWN0aW9uIElzc3VpbmcgQ0EwHhcNMjMxMTE1MDUxMDA4WhcNMjQxMjE1 +MDU0MDA4WjBhMQswCQYDVQQGEwJHQjEUMBIGA1UEChMLT3BlbkJhbmtpbmcxGzAZ +BgNVBAsTEjAwMTU4MDAwMDFIUVFyWkFBWDEfMB0GA1UEAxMWakZRdVE0ZVFiTkNN +U3FkQ29nMjFuRjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKi36HD0 +prx1N3pfafJc6pSMg0i0jOiQrt+WZ6GphKUhA2JrbBxWTvabX1Q7hifl5UbkBOkn +n3SCyqBplPSqksYLdPSckb2J7UVLj76O7RkELoFD+vSrQ8FWEn8lXv4UiS8ylvlr +IPa8+pVtAwOuI3/YFmqB1lcHgBI8EELDUWHXSp3OhkcKjrm76t1sQz0tsmi5aHZR +3FXb0dACQO+dGakIerqzUmAdccLtWuSJMT+b7c7IDDm/IR/MV7iol04yeBkOlWre +IKOqHU16PI3N/PSMEt96JAUKZ/n0VC0x4YHaBYDX27sf4Gypubgmkcd4IbG/8XEu +Hq3Ik84oEpP5QEUCAwEAAaOCAfkwggH1MA4GA1UdDwEB/wQEAwIGwDAVBgNVHSUE +DjAMBgorBgEEAYI3CgMMMIHgBgNVHSAEgdgwgdUwgdIGCysGAQQBqHWBBgFkMIHC +MCoGCCsGAQUFBwIBFh5odHRwOi8vb2IudHJ1c3Rpcy5jb20vcG9saWNpZXMwgZMG +CCsGAQUFBwICMIGGDIGDVXNlIG9mIHRoaXMgQ2VydGlmaWNhdGUgY29uc3RpdHV0 +ZXMgYWNjZXB0YW5jZSBvZiB0aGUgT3BlbkJhbmtpbmcgUm9vdCBDQSBDZXJ0aWZp +Y2F0aW9uIFBvbGljaWVzIGFuZCBDZXJ0aWZpY2F0ZSBQcmFjdGljZSBTdGF0ZW1l +bnQwbQYIKwYBBQUHAQEEYTBfMCYGCCsGAQUFBzABhhpodHRwOi8vb2IudHJ1c3Rp +cy5jb20vb2NzcDA1BggrBgEFBQcwAoYpaHR0cDovL29iLnRydXN0aXMuY29tL29i +X3BwX2lzc3VpbmdjYS5jcnQwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDovL29iLnRy +dXN0aXMuY29tL29iX3BwX2lzc3VpbmdjYS5jcmwwHwYDVR0jBBgwFoAUUHORxiFy +03f0/gASBoFceXluP1AwHQYDVR0OBBYEFKjCef/JxD+ND9eSb7hQlmEhSxUqMA0G +CSqGSIb3DQEBCwUAA4IBAQCnKH9FdLmJMruX2qfbrpT0qaV8bP7xa9UDRYSMsAWC +2kqCxs8CJmARt5+xsxBW6P65+mkLS2vXgQl7J8RTMiQVnHJvvNaldYnV6odsYOqv +v+vGib8Qe0gKWSjih+Gd1Ct4UQFtn6P3ph+6OBB0OieZb7DYXqPJrX5UlG7K2fQ4 +0MdFgBdeQZ3iNkXi43UIrQ5cF4cjYavmEFRmYeHya8AKfNCiWly15mNazW/X6SWf +7pz+yk/l+gBv0wm3QT7ANXGf8izgoh6T5fmixPXSbdn8RUIV0kXp2TRRZ+CYUWBP +Jc3PvRXiiEEo2eHLXfEHG2jzrt1iKnjk6hzuC1hUzK0t +-----END CERTIFICATE----- \ No newline at end of file diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/ssa.txt b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/ssa.txt new file mode 100644 index 000000000..2e3fa60f4 --- /dev/null +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/ssa.txt @@ -0,0 +1 @@ +eyJhbGciOiJQUzI1NiIsImtpZCI6IjdlSjhTX1pndmxZeEZBRlNnaFY5eE1KUk92ayJ9.eyJpc3MiOiJjZHItcmVnaXN0ZXIiLCJpYXQiOjE2NjU5Nzg5NjMsImV4cCI6MjE0NzQ4MzY0NiwianRpIjoiM2JjMjA1YTFlYmM5NDNmYmI2MjRiMTRmY2IyNDExOTYiLCJvcmdfaWQiOiJUUFAyIiwib3JnX25hbWUiOiJNb2NrIENvbXBhbnkgSW5jLiIsImxlZ2FsX2VudGl0eV9pZCI6IlRQUDIiLCJsZWdhbF9lbnRpdHlfbmFtZSI6Ik1vY2sgQ29tcGFueSBQdHkgTHRkLiIsImNsaWVudF9kZXNjcmlwdGlvbiI6IkEgbW9jayBzb2Z0d2FyZSBwcm9kdWN0IGZvciB0ZXN0aW5nIFNTQSIsImNsaWVudF91cmkiOiJodHRwczovL3d3dy5tb2NrY29tcGFueS5jb20uYXUiLCJyZWRpcmVjdF91cmlzIjpbImh0dHBzOi8vd3d3Lmdvb2dsZS5jb20vcmVkaXJlY3RzL3JlZGlyZWN0MSIsImh0dHBzOi8vd3d3Lmdvb2dsZS5jb20vcmVkaXJlY3RzL3JlZGlyZWN0MiIsImh0dHBzOi8vd3d3Lmdvb2dsZS5jb20vcmVkaXJlY3RzL3JlZGlyZWN0MyJdLCJsb2dvX3VyaSI6Imh0dHBzOi8vd3d3Lm1vY2tjb21wYW55LmNvbS5hdS9sb2dvcy9sb2dvMS5wbmciLCJ0b3NfdXJpIjoiaHR0cHM6Ly93d3cubW9ja2NvbXBhbnkuY29tLmF1L3Rvcy5odG1sIiwicG9saWN5X3VyaSI6Imh0dHBzOi8vd3d3Lm1vY2tjb21wYW55LmNvbS5hdS9wb2xpY3kuaHRtbCIsImp3a3NfdXJpIjoiaHR0cHM6Ly9rZXlzdG9yZS5vcGVuYmFua2luZ3Rlc3Qub3JnLnVrLzAwMTU4MDAwMDFIUVFyWkFBWC9qRlF1UTRlUWJOQ01TcWRDb2cyMW5GLmp3a3MiLCJyZXZvY2F0aW9uX3VyaSI6Imh0dHBzOi8vZ2lzdC5naXRodWJ1c2VyY29udGVudC5jb20vaW1lc2g5NC8zMTcyZTJlNDU3NTdjZGEwOGVjMjcyN2Y5MGI3MmNlZC9yYXcvZmYwZDNlYWJlNGNkZGNlNDdlZWMwMjI4ZjU5MjE3NTIyM2RkOTJiMi93c28yLWF1LWRjci1kZW1vLmp3a3MiLCJyZWNpcGllbnRfYmFzZV91cmkiOiJodHRwczovL3d3dy5tb2NrY29tcGFueS5jb20uYXUiLCJzb2Z0d2FyZV9pZCI6IlNQMiIsInNvZnR3YXJlX3JvbGVzIjoiZGF0YS1yZWNpcGllbnQtc29mdHdhcmUtcHJvZHVjdCIsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgYmFuazphY2NvdW50cy5iYXNpYzpyZWFkIGJhbms6YWNjb3VudHMuZGV0YWlsOnJlYWQgYmFuazp0cmFuc2FjdGlvbnM6cmVhZCBiYW5rOnBheWVlczpyZWFkIGJhbms6cmVndWxhcl9wYXltZW50czpyZWFkIGNvbW1vbjpjdXN0b21lci5iYXNpYzpyZWFkIGNvbW1vbjpjdXN0b21lci5kZXRhaWw6cmVhZCBjZHI6cmVnaXN0cmF0aW9uIn0.Log1HrX7lozIqQS_SWlAbVgGuloBwsF2YsTs67nWP1EZSZEFLgPF7TMW_WMBb4Ne3zo9Va6d_6HYdMkPQEcvbVW9FjBW_NB367Y-K9eoVASMkuZd1XVtgnaqDVCVJL_jGiprkNQ_Bc8eZLQvJ34uJOm9gTjrMZB9eF1v61_Zb6rmZeLXDOSp948WTDABtwghJNFHdor24t_xYT1V9KZDeASqByxNzb_mcNV8JRF07XEdbgKnTkofA7wHHoJxcxi6qG0x8310JPjJkiCQcmh7N2RXw4awOAPMZMFX_CCRY_bqCq2asgkbiGyUyyXQuuXkGNuCYEE5g31tvL_dfJSYLQ \ No newline at end of file diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.jks b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.jks new file mode 100644 index 0000000000000000000000000000000000000000..9c70d7fb9063c17db5ac7f9dce1a3bc2275a3ba6 GIT binary patch literal 3208 zcma)8c{CIb*EVB@$i5`93=&y~m_cJ?Nr()iWGvZb8O9ny(^$$<*|(^%%Wkr-A&RjT zAz8+fJ!_1JUf=oN)9<{0z3;i_o_p_epL_p&?u8PV!hrxpa&2M zOhO<6(}h!*2TB09{znU30V04)PT|5+&!s#2?JSCu>f-s_NblfBE@` zd#77jed1=7imH8J4@{axjivi4Wc;Z4om7BzZN#^wI_%aeck)2`%cm(YP(m_y7kr1> zb;iR{reDFwRJT;zRR$_$peVCi4xnn{AZK+i)XFexf!V+>ZR~VISp5geT#==!D z4(=YlkXl`D(X}3TpdFxj3rxp>W*f;kpB7ObLIl-v>%4TqjlDB6_>{}cpdBGyxL=&_;s5^KMVXt%X>q6xTs!oWB&3aYn&QJLy+s>(4>I=Qti`p zhmx}wi?hzBzaIIPIRe+xz168$uKMN@yH0F{X-UD)fjYKW1NU1Oa%u(IQxaK_k2d?n z+nVS0Y|)l-(>QUHdSlAsEcqCpZD1W{CWkiC+q(61Fn+-4^~FYtjI_GcyL*e^j2mg_ zreA-0`+U%zDgZkS!{qaR;LgJ*E0_`&;1huw?&O)sw6Ws`?<+Vyo;GC$19nC?i zMuDaG;Ij)j=C;Iuij=wGMzVM6hmz5l&A=O-WZcDTWBwUS`o?A=Z#Q>0O4FJndp0X( zTsPXI+c^Z@LxnGd@5-V2L_$#F{YSoTGmU};)wj}?#DK=B8rJ2u<;fni!*Dxcqz@TW zd07H<#&P$1XsSI#6*`DQuRfTD)K3IZ2SuGNJcPnlx^uC2@^hn&T-q|fRRi;(o&r)K z^!x|5$7}b8=ZF#Igu-SfJ`x(%8*vU3J1%JuM4q5158MB2-TbP$98fF6i?kiOd}w6=r0&bb{NXYAGwKW|=Izhf@+B8ox9>n(UFI=2)KJ zj56|MU&G3%xMaia_J>G*uouzb;x^2}oaO9-xXwr6s6X=y1R3`VshJ@~Z@!bj6gydF zI>6x9_qkWaT=0G;CM5iC;kowj>zOpla4#S$4_ll5Cq6$8})uqug~+=^ebwq?uSSkHuu79V zi(tlDrrE{f|3$VvT#{CVel9cVRHHhIpZ46s6Tt7ZkGpm!DQVj={X(vV#<`MPUMXe{ z!fB5x_#KoYk!qDl-e69#*t;$UHKsmwHc=tN*c1`D306kYqGf#`WTkH=J~)r!OYt60 z-X$p{dOezKJhqmXm z?hS{jZ~J%lTP%wfBUjjsmsrMFZx7yK`+Wv%Cp?$Ioxu|>#h85U@uBUBbP6U_ws#FM zB&)#QMG>*17Lv-!ngT8FJ0|t@HB{{@GSYcpu_P+DNu@pGiy-{TFMi(P)AYg?EDGMD zjP$5jC+<_peOiV@{pc~b@{c0hc0%;))cK|-3RX9U&l|tvgO}}%5z167DH$sX{d`+g zZm9hEO5aMC@%*n%eh8R?p$B03KnrS@O{<`LBQPkDIcrGGkD^-T=P3W_lJ&-0C$}v` zJpi9nFB^hUD;sELCEh2R;din~MI9Z(>3Ikkjgeb(SDgN>h(o#t+zCr&;^F?DSjw`_ zB{Q3>7QLy2p3*kgb_p4qU$l!UR9cz1B@2-d%9Vy*j75mBQJ@%%ZgSgA?IwS+`gnW;Gs+*)fvjIr}}9 z{ASHMmUy6wJ5te@rQYdWp$X?KweU_K!_Ko_ z5froZ@u>F8mW{7QSQL+4H=)^jF57k0o1>SvGM8}M<#T%WgS#vNp6|;hFyr^b3*Hu! z8*`pq{6?N6;+n|k$GfG!FYE2}%sklm`tlgDQ%qgc@2p40-rg(yZIO&cGfgqfko)qL z_^OV#2gI?N`s&09T^`dhsxM=YW|EH9kI2H2n+9^NBM0~_|)_JYe-4s z!E=lj;4>lO;UZNx6k-yxtri4QftpMN-XnVcvTl({?lp8p@oe}ztpWc=#mCC@A~&*y zjGfJOykgDVKk8O=)x9urZW)i5o}ubIU>y&Nsnzt>T*1Ib$=-v!l;mAd^h(F)z+cf% z1e-c*x{HLWERTzNYhH(^t9V;cdX%|j%od;PersuB94hJjKL37q^<$uk|)oTUv*)o-vXE5L2o0E*x`t=GFSMy8B6MeMXSf$f$fLzU93obxsp6jod#Y^m9gwF1OuYR+Z&> zMxUil|D}S^sfL9157!`85!JZ|)NMtZtuH*cud|si*!;q& z1lB?ayvYw9P(mt_wB!pob1?|@T|2|Lk*$wQ0Bki zIS>G*0YM^jVmky_XT2Z{Gdd71CeExAB|QOWca4^wldXy!Z#fWGGUm(=2V%UIDCpVU Q+Gd2odQDu^|DBM30X~-AkN^Mx literal 0 HcmV?d00001 diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.key b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.key new file mode 100644 index 000000000..1a6efe673 --- /dev/null +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCbJRo05tLVsJ5y +oAu1jalEmDcW5VEZCcqA+VLkps6bDOZ5VAQMWMQYM7U6NOtiyRC81E8wP/ZICyDD +II/sBtTkuO+UAoHsqA5sH9Ej7hUQZdBtAI8QLyc87Nmoo88YmEWylGuIJjtSj1N1 +5c/PZovJcI02ZcbRpNwAcARuH+Z2uU2O7mTJYFj1w504OwnNR+JqzGxBZFGl5m+m +YYRradCS9OPuC6dekFq4Ih65aKfj/G3fqcJpjpi7oJUyBIfr/fd4/u7/AV2KnZmE +N56IjoSvcpxTw9QO7q65u9T4JLqvlpORwrzIgSu82eEp/RQ6L8pAymUxWDJaFQ1y +4Znw0K5nAgMBAAECggEAIlg4UPW4Pq32pZFghjRyAEliCKODLHPKbHrFKvDyU8ir +TLiYnNMZtfHccKI+aYPxPJwTW68NKi2sdwXCVpG8l1WJU86qTGV3q9/vQHD4IMUp +Orgg84g8u3QDSx3YPq2W4E2S8HTmNQSdiT/ynQsqbtGHsT8eoFJKkZ46nNZbAnTy +dW0ZEDNvNJ/F7KMxrnf4ibrQKx22rQtF5Go3G/Nm2WQZbcJ+0fkccXtunL3c4uuG +xH/xdlOUlay4WOcmKw93HJOs7D2YEdZ2uTATgas74dK+RyXzyvVQoEpOSIJ2jQYb +wEfcR85p5hvU9xR085Cp8+LAo2bKiQWGw0VUkIaTAQKBgQC3J/z2m6Wq5nvnIKE4 +vWg12jwvHhyP2zIZjKPncA0lKmUC7vBJ60KIm4O0fDVfSksgsLhxgZxchDfRjZN2 +olVqrqYTYi/OL4gSroSMK1VNyGj/n+4LTPIQxwiepGkbdj0vv+eKXG0CNZEOACyq +jhA97GaeY3aUTsE/EzSVaa6mYQKBgQDY2Sb1P8oTxFcfrNyLyr663N+uLPzEfu+S +vFvvvG3ppcZjijmQVOJsW5R2F/7QCG2VdWft6Q6g2Ae/zWNSCvP2qYxJFhqtXPHx +j33pU0sveQZdEy/dfiNfqqepd4EyZWFsLUQ2c4NMYvmT8PiArn6YUZ/nKcnwNGek +t2hGItn5xwKBgC4j9sgxgdTB56jcQYFHxf77EXpVPaDH+aESGyBszAL24SeSBhq5 +F7POaamIOPHeh3qeynhdzIRKEr3JysJyNs5/XPs5Gw34T3FVYbLmH8FOoZT0N0XF +hp3PZk6A4LG4YcWrtKrYieWqlPZP+PCmhVT0Pw3bxL2r8WbwcajKTONBAoGAWia9 +SYyBiIJB7ktBTWS2sp0M6S6Oz2ouU4S3fA2MbGyc89kNYXHIyF+ycv4602YNmOs8 +j+4qRLhLUHQk7IDdOBj415G2+YgAlfqf0Bbu1Qetm5hUd/Lu5eDe31dtgPQg8oZH +K5QOa/1h4R13Upg4zT5yCfqXl6NRy2rskOwATxUCgYBbnpKY0sPyY1BxaxPChXuN +hlIeRMwhurk+VylkvNOF3GvwJ9Z7Uzuf62PzXRu0anWtlGY9KFP494SX1YL7CQO9 +Mws8Zo881MJr+oYzgwhv9CQhmNTtK7awjDizOlyuz7r4PJYIaKuqFxwiRBqNxJdA +loFhm8Tc2RjLkAHcKjGgBQ== +-----END PRIVATE KEY----- diff --git a/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.pem b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.pem new file mode 100644 index 000000000..294bf61d0 --- /dev/null +++ b/integration-test-suite/test-artifacts/DynamicClientRegistration/AU/sample-client-resources-2/transport-keystore/transport.pem @@ -0,0 +1,30 @@ +-----BEGIN CERTIFICATE----- +MIIFODCCBCCgAwIBAgIEWcbiiTANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJH +QjEUMBIGA1UEChMLT3BlbkJhbmtpbmcxLjAsBgNVBAMTJU9wZW5CYW5raW5nIFBy +ZS1Qcm9kdWN0aW9uIElzc3VpbmcgQ0EwHhcNMjMxMTE1MDUxMDMxWhcNMjQxMjE1 +MDU0MDMxWjBhMQswCQYDVQQGEwJHQjEUMBIGA1UEChMLT3BlbkJhbmtpbmcxGzAZ +BgNVBAsTEjAwMTU4MDAwMDFIUVFyWkFBWDEfMB0GA1UEAxMWakZRdVE0ZVFiTkNN +U3FkQ29nMjFuRjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJslGjTm +0tWwnnKgC7WNqUSYNxblURkJyoD5UuSmzpsM5nlUBAxYxBgztTo062LJELzUTzA/ +9kgLIMMgj+wG1OS475QCgeyoDmwf0SPuFRBl0G0AjxAvJzzs2aijzxiYRbKUa4gm +O1KPU3Xlz89mi8lwjTZlxtGk3ABwBG4f5na5TY7uZMlgWPXDnTg7Cc1H4mrMbEFk +UaXmb6ZhhGtp0JL04+4Lp16QWrgiHrlop+P8bd+pwmmOmLuglTIEh+v993j+7v8B +XYqdmYQ3noiOhK9ynFPD1A7urrm71Pgkuq+Wk5HCvMiBK7zZ4Sn9FDovykDKZTFY +MloVDXLhmfDQrmcCAwEAAaOCAgQwggIAMA4GA1UdDwEB/wQEAwIHgDAgBgNVHSUB +Af8EFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwgeAGA1UdIASB2DCB1TCB0gYLKwYB +BAGodYEGAWQwgcIwKgYIKwYBBQUHAgEWHmh0dHA6Ly9vYi50cnVzdGlzLmNvbS9w +b2xpY2llczCBkwYIKwYBBQUHAgIwgYYMgYNVc2Ugb2YgdGhpcyBDZXJ0aWZpY2F0 +ZSBjb25zdGl0dXRlcyBhY2NlcHRhbmNlIG9mIHRoZSBPcGVuQmFua2luZyBSb290 +IENBIENlcnRpZmljYXRpb24gUG9saWNpZXMgYW5kIENlcnRpZmljYXRlIFByYWN0 +aWNlIFN0YXRlbWVudDBtBggrBgEFBQcBAQRhMF8wJgYIKwYBBQUHMAGGGmh0dHA6 +Ly9vYi50cnVzdGlzLmNvbS9vY3NwMDUGCCsGAQUFBzAChilodHRwOi8vb2IudHJ1 +c3Rpcy5jb20vb2JfcHBfaXNzdWluZ2NhLmNydDA6BgNVHR8EMzAxMC+gLaArhilo +dHRwOi8vb2IudHJ1c3Rpcy5jb20vb2JfcHBfaXNzdWluZ2NhLmNybDAfBgNVHSME +GDAWgBRQc5HGIXLTd/T+ABIGgVx5eW4/UDAdBgNVHQ4EFgQU7T6cMtCSQTT5JWW3 +O6vifRUSdpkwDQYJKoZIhvcNAQELBQADggEBAE9jrd/AE65vy3SEWdmFKPS4su7u +EHy+KH18PETV6jMF2UFIJAOx7jl+5a3O66NkcpxFPeyvSuH+6tAAr2ZjpoQwtW9t +Z9k2KSOdNOiJeQgjavwQC6t/BHI3yXWOIQm445BUN1cV9pagcRJjRyL3SPdHVoRf +IbF7VI/+ULHwWdZYPXxtwUoda1mQFf6a+2lO4ziUHb3U8iD90FBURzID7WJ1ODSe +B5zE/hG9Sxd9wlSXvl1oNmc/ha5oG/7rJpRqrx5Dcq3LEoX9iZZ3knHLkCm/abIQ +7Nff8GQytuGhnGZxmGFYKDXdKElcl9dAlZ3bIK2I+I6jD2z2XvSfrhFyRjU= +-----END CERTIFICATE----- \ No newline at end of file From c7c2b565ecc88a0b8050d93469c0879713e344b8 Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Tue, 26 Nov 2024 20:25:02 +0530 Subject: [PATCH 07/20] Test Cases for Metrics V5 --- .../cds-toolkit-integration-test/pom.xml | 5 + .../admin_api/AdminApiValidationTests.groovy | 283 +++-- .../AbandonFailedTokenExchangeMetrics.groovy | 377 ++++++ .../AbandonPreAccountSelectionMetrics.groovy | 824 +++++++++++++ .../AbandonPreAuthenticationMetrics.groovy | 304 +++++ .../AbandonPreAuthorisationMetrics.groovy | 279 +++++ .../AbandonPreIdentificationMetrics.groovy | 540 +++++++++ .../AbandonRejectedMetrics.groovy | 132 +++ .../ActiveAndNewAuthorisationMetrics.groovy | 324 +++++ .../AmendedAuthorisationMetrics.groovy | 403 +++++++ .../RevokedAuthorisationMetrics.groovy | 280 +++++ ...stomerRecipientCountValidationTests.groovy | 213 ++++ .../error/ErrorMetrics_Authenticated.groovy | 1048 +++++++++++++++++ .../error/ErrorMetrics_Unauthenticated.groovy | 206 ++++ .../HighPriorityMetricsValidation.groovy | 728 ++++++++++++ .../LargePayloadMetricsValidation.groovy | 283 +++++ .../LowPriorityMetricsValidation.groovy | 508 ++++++++ .../SessionCountMetricsValidation.groovy | 86 ++ .../UnattendedMetricsValidation.groovy | 600 ++++++++++ .../UnauthenticatedMetricsValidation.groovy | 134 +++ .../AuthorisationFlowTest.groovy | 2 +- .../bnr/ConsentAuthFlowValidationTests.groovy | 4 +- ...ryUserInstructionsAuthorisationTest.groovy | 4 +- .../cds-toolkit-test-framework/pom.xml | 5 + .../org/wso2/cds/test/framework/AUTest.groovy | 3 - .../framework/constant/AUConstants.groovy | 2 +- integration-test-suite/pom.xml | 5 + 27 files changed, 7503 insertions(+), 79 deletions(-) create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonFailedTokenExchangeMetrics.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAccountSelectionMetrics.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthenticationMetrics.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthorisationMetrics.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreIdentificationMetrics.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonRejectedMetrics.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/ActiveAndNewAuthorisationMetrics.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AmendedAuthorisationMetrics.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/RevokedAuthorisationMetrics.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/customerAndRecipientCount/CustomerRecipientCountValidationTests.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Unauthenticated.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/HighPriorityMetricsValidation.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LargePayloadMetricsValidation.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LowPriorityMetricsValidation.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/SessionCountMetricsValidation.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnattendedMetricsValidation.groovy create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnauthenticatedMetricsValidation.groovy diff --git a/integration-test-suite/cds-toolkit-integration-test/pom.xml b/integration-test-suite/cds-toolkit-integration-test/pom.xml index 28741c97e..d9d5d7cd8 100644 --- a/integration-test-suite/cds-toolkit-integration-test/pom.xml +++ b/integration-test-suite/cds-toolkit-integration-test/pom.xml @@ -89,6 +89,11 @@ testng test + + mysql + mysql-connector-java + 5.1.49 + diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy index a2e72617f..f970faab8 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/AdminApiValidationTests.groovy @@ -20,19 +20,21 @@ package org.wso2.cds.integration.test.admin_api import org.wso2.cds.test.framework.AUTest import org.wso2.cds.test.framework.constant.AUConstants -import org.wso2.cds.test.framework.request_builder.AUJWTGenerator import org.wso2.cds.test.framework.request_builder.AURequestBuilder import org.wso2.cds.test.framework.utility.AUTestUtil import org.testng.Assert import org.testng.annotations.Test +import java.time.LocalDateTime +import java.time.ZoneOffset +import java.time.format.DateTimeFormatter +import java.time.format.DateTimeParseException + /** * Admin API Validation Tests. */ class AdminApiValidationTests extends AUTest { - AUJWTGenerator generator = new AUJWTGenerator() - @Test void "TC1001001_Retrieve critical update to the metadata for Accredited Data Recipients"() { @@ -132,33 +134,60 @@ class AdminApiValidationTests extends AUTest { .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ADMIN)) .get("${AUConstants.CDS_ADMIN_PATH}${AUConstants.ADMIN_METRICS}") + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(response.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) Assert.assertEquals(response.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.requestTime")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.aggregate.currentMonth")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.unauthenticated.currentMonth")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.authenticated.currentMonth")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.aggregate.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.highPriority.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.largePayload.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.lowPriority.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.unattended.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.unauthenticated.currentDay")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.highPriority.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.largePayload.currentDay")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.lowPriority.currentDay")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unattended.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.largePayload.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unauthenticated.currentDay")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.highPriority.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.largePayload.currentDay")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.lowPriority.currentDay")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unattended.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.largePayload.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.sessionCount.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.peakTps.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.aggregate.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.authenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.aggregate.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.authenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.authenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.unauthenticated.currentDay")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.customerCount")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.recipientCount")) - - if (AUConstants.API_VERSION.equalsIgnoreCase("1.2.0")) { - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.currentDay")) - } else { - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.authenticated.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.unauthenticated.currentDay")) - } + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.activeAuthorisationCount.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.activeAuthorisationCount.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.currentDay.onceOff.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.currentDay.onceOff.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.currentDay.ongoing.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.currentDay.ongoing.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.revokedAuthorisationCount.currentDay.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.revokedAuthorisationCount.currentDay.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.amendedAuthorisationCount.currentDay.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.amendedAuthorisationCount.currentDay.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.expiredAuthorisationCount.currentDay.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.expiredAuthorisationCount.currentDay.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonedConsentFlowCount.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preIdentification.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAuthentication.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAccountSelection.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAuthorisation.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.rejected.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.failedTokenExchange.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "links.self")) } @Test @@ -173,33 +202,60 @@ class AdminApiValidationTests extends AUTest { .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ADMIN)) .get("${AUConstants.CDS_ADMIN_PATH}${AUConstants.ADMIN_METRICS}") + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(response.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) Assert.assertEquals(response.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.requestTime")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unauthenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.aggregate.previousMonths")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.unauthenticated.previousMonths")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.authenticated.previousMonths")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.aggregate.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.highPriority.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.largePayload.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.lowPriority.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.unattended.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.unauthenticated.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.highPriority.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.largePayload.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.lowPriority.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unattended.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.largePayload.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unauthenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unauthenticated.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.highPriority.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.largePayload.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.lowPriority.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unattended.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.largePayload.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.sessionCount.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.peakTps.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unauthenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.aggregate.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.unauthenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.authenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.aggregate.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.unauthenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.authenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.authenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.unauthenticated.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.customerCount")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.recipientCount")) - - if (AUConstants.API_VERSION.equalsIgnoreCase("1.2.0")) { - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.previousDays")) - } else { - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.authenticated.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.unauthenticated.previousDays")) - } + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.activeAuthorisationCount.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.activeAuthorisationCount.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.previousDays.onceOff.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.previousDays.onceOff.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.previousDays.ongoing.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.previousDays.ongoing.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.revokedAuthorisationCount.previousDays.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.revokedAuthorisationCount.previousDays.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.amendedAuthorisationCount.previousDays.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.amendedAuthorisationCount.previousDays.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.expiredAuthorisationCount.previousDays.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.expiredAuthorisationCount.previousDays.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonedConsentFlowCount.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preIdentification.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAuthentication.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAccountSelection.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAuthorisation.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.rejected.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.failedTokenExchange.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "links.self")) } @Test (groups = "SmokeTest") @@ -217,54 +273,141 @@ class AdminApiValidationTests extends AUTest { Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) Assert.assertEquals(response.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.requestTime")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.aggregate.currentMonth")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.aggregate.previousMonths")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.unauthenticated.currentMonth")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.unauthenticated.previousMonths")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.authenticated.currentMonth")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.availability.authenticated.previousMonths")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.aggregate.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.aggregate.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.highPriority.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.highPriority.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.largePayload.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.largePayload.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.lowPriority.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.lowPriority.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.unattended.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.unattended.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.unauthenticated.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.highPriority.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.highPriority.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.largePayload.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.largePayload.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.lowPriority.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.lowPriority.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unattended.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.largePayload.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unattended.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unauthenticated.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.highPriority.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.highPriority.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.largePayload.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.largePayload.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.lowPriority.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.lowPriority.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unattended.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.largePayload.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.sessionCount.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.peakTps.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unattended.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unauthenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.aggregate.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.aggregate.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.unauthenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.authenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.authenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.aggregate.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.aggregate.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.unauthenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.authenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.authenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.authenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.authenticated.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.unauthenticated.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.unauthenticated.previousDays")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.customerCount")) Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.recipientCount")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.activeAuthorisationCount.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.activeAuthorisationCount.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.currentDay.onceOff.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.currentDay.onceOff.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.currentDay.ongoing.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.currentDay.ongoing.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.previousDays.onceOff.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.previousDays.onceOff.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.previousDays.ongoing.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.newAuthorisationCount.previousDays.ongoing.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.revokedAuthorisationCount.currentDay.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.revokedAuthorisationCount.currentDay.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.revokedAuthorisationCount.previousDays.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.revokedAuthorisationCount.previousDays.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.amendedAuthorisationCount.currentDay.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.amendedAuthorisationCount.currentDay.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.amendedAuthorisationCount.previousDays.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.amendedAuthorisationCount.previousDays.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.expiredAuthorisationCount.currentDay.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.expiredAuthorisationCount.currentDay.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.expiredAuthorisationCount.previousDays.individual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.expiredAuthorisationCount.previousDays.nonIndividual")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonedConsentFlowCount.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonedConsentFlowCount.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preIdentification.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preIdentification.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAuthentication.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAuthentication.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAccountSelection.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAccountSelection.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAuthorisation.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.preAuthorisation.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.rejected.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.rejected.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.failedTokenExchange.currentDay")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.authorisations.abandonmentsByStage.failedTokenExchange.previousDays")) + Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "links.self")) + } + + @Test + void "Verify requestTime is display the current date and time of the server"() { + + LocalDateTime currentTime, utcTime = null + String assertionString = generator.getClientAssertionJwt(AUConstants.ADMIN_API_ISSUER, AUConstants.ADMIN_API_AUDIENCE) + + def response = AURequestBuilder.buildBasicRequest(assertionString, AUConstants.X_V_HEADER_METRICS) + .header(AUConstants.CONTENT_TYPE, "application/json") + .header(AUConstants.X_MIN_HEADER, AUConstants.X_V_MIN_HEADER_METRICS) + .queryParam(AUConstants.PERIOD, AUConstants.ALL) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ADMIN)) + .get("${AUConstants.CDS_ADMIN_PATH}${AUConstants.ADMIN_METRICS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(response.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + def requestTime = AUTestUtil.parseResponseBody(response, "data.requestTime") + + utcTime = LocalDateTime.now(ZoneOffset.UTC) - if (AUConstants.API_VERSION.equalsIgnoreCase("1.2.0")) { - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.currentDay")) + if(AUTestUtil.getHostname().equalsIgnoreCase(AUConstants.LOCALHOST)) { + // Get the response UTC time + currentTime = utcTime } else { - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.authenticated.currentDay")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.authenticated.previousDays")) + // Convert UTC time to GMT time and current date time format + currentTime = utcTime.atOffset(ZoneOffset.UTC).atZoneSameInstant(ZoneOffset.ofHours(0)).toLocalDateTime() } - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.performance.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unauthenticated.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.highPriority.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.lowPriority.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.unattended.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.invocations.largePayload.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unauthenticated.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.highPriority.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.lowPriority.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.unattended.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageResponse.largePayload.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.sessionCount.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.averageTps.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.peakTps.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.errors.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.customerCount")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.recipientCount")) + String formattedCurrentTime = currentTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm")) - if (AUConstants.API_VERSION.equalsIgnoreCase("1.2.0")) { - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.previousDays")) - } else { - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.authenticated.previousDays")) - Assert.assertNotNull(AUTestUtil.parseResponseBody(response, "data.rejections.unauthenticated.previousDays")) + //Assert request time gives the current date time + Assert.assertNotNull(requestTime) + Assert.assertTrue(requestTime.contains(formattedCurrentTime), "Response Time in not in Expected Format") + + //Assert whether the request time in expected format + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX") + try { + formatter.parse(requestTime) + Assert.assertTrue(true, "Request Time is in the correct format.") + } catch (DateTimeParseException e) { + Assert.fail("Request Time is not in the correct format.") } } } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonFailedTokenExchangeMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonFailedTokenExchangeMetrics.groovy new file mode 100644 index 000000000..3cbe449b9 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonFailedTokenExchangeMetrics.groovy @@ -0,0 +1,377 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.authorisation + +import com.nimbusds.oauth2.sdk.AccessTokenResponse +import com.nimbusds.oauth2.sdk.TokenErrorResponse +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +/** + * Test Cases for Failed Token Exchange Metrics in Abandon Flow. + */ +class AbandonFailedTokenExchangeMetrics extends AUTest { + + private AccessTokenResponse userAccessToken, secondUserAccessToken + private String cdrArrangementId = "" + private String requestUri + private String secondAuthorisationCode = null + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Verify Metrics response after abandon the flow without generating token"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Wait until authorisation code expires + sleep(AUConstants.AUTH_CODE_EXPIRATION_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active and New Authorisation count increased by 1 + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = (abandonedCurrentDay + 1) + } else { + abandonedCurrentDay = (abandonedCurrentDay + 1) + abandonedFailedTokenExchangeCurrentDay = (abandonedFailedTokenExchangeCurrentDay + 1) + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify Metrics response when Auth code expired before the Token Exchange"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Wait until authorisation code expires + sleep(AUConstants.AUTH_CODE_EXPIRATION_TIME) + + //Send User Access Token Request + TokenErrorResponse errorResponse = AURequestBuilder.getUserTokenErrorResponse(authorisationCode, + auConfiguration.getAppInfoRedirectURL(), auConfiguration.getAppInfoClientID(), true, true, + auConfiguration.getCommonSigningAlgorithm(), AUConstants.CODE_VERIFIER) + + Assert.assertEquals(errorResponse.toJSONObject().get(AUConstants.ERROR_DESCRIPTION), + AUConstants.CODE_EXPIRE_ERROR_MSG) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active and New Authorisation count increased by 1 + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedFailedTokenExchangeCurrentDay = abandonedFailedTokenExchangeCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify Metrics response when token request failure due to an error"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Send User Access Token request with incorrect redirect url + TokenErrorResponse errorResponse = AURequestBuilder.getUserTokenErrorResponse(authorisationCode, + "https://abc.com", auConfiguration.getAppInfoClientID(), true, true, + auConfiguration.getCommonSigningAlgorithm(), AUConstants.CODE_VERIFIER) + + //Wait till abandonment time + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Authorisation Count should increase as it completed the authorisation flow + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedFailedTokenExchangeCurrentDay = abandonedFailedTokenExchangeCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 2 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify metrics response when there is an error in token call in consent amendment"() { + + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(userAccessToken.tokens.refreshToken) + Assert.assertNotNull(userAccessToken.tokens.accessToken) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + secondAuthorisationCode = doConsentAmendmentAuthorisation(scopes, cdrArrangementId, + AUConstants.DEFAULT_SHARING_DURATION) + Assert.assertNotNull(secondAuthorisationCode) + + TokenErrorResponse errorResponse = AURequestBuilder.getUserTokenErrorResponse(secondAuthorisationCode, + "https://abc.com", auConfiguration.getAppInfoClientID(), true, true, + auConfiguration.getCommonSigningAlgorithm(), auAuthorisationBuilder.getCodeVerifier()) + Assert.assertEquals(errorResponse.toJSONObject().get(AUConstants.ERROR_DESCRIPTION), + AUConstants.CALLBACK_MISMATCH) + + //Wait until authorisation code expires + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Authorisation Count should increase as it completed the authorisation flow + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + amendedCurrentDayIndividual = amendedCurrentDayIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedFailedTokenExchangeCurrentDay = abandonedFailedTokenExchangeCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify metrics response when abandon without generating token in amendment flow"() { + + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(userAccessToken.tokens.refreshToken) + Assert.assertNotNull(userAccessToken.tokens.accessToken) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + secondAuthorisationCode = doConsentAmendmentAuthorisation(scopes, cdrArrangementId, + AUConstants.DEFAULT_SHARING_DURATION) + Assert.assertNotNull(secondAuthorisationCode) + + //Wait until abandon time + sleep(AUConstants.AUTH_CODE_EXPIRATION_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Authorisation Count, new Authorisation count and amendment count should increase as it completed the authorisation flow + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + amendedCurrentDayIndividual = amendedCurrentDayIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedFailedTokenExchangeCurrentDay = abandonedFailedTokenExchangeCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Auth code expired before the Token Exchange in amendment flow"() { + + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(userAccessToken.tokens.refreshToken) + Assert.assertNotNull(userAccessToken.tokens.accessToken) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + secondAuthorisationCode = doConsentAmendmentAuthorisation(scopes, cdrArrangementId, + AUConstants.DEFAULT_SHARING_DURATION) + Assert.assertNotNull(secondAuthorisationCode) + + //Wait until authorisation code expires + sleep(AUConstants.AUTH_CODE_EXPIRATION_TIME) + + TokenErrorResponse errorResponse = AURequestBuilder.getUserTokenErrorResponse(secondAuthorisationCode, + auConfiguration.getAppInfoRedirectURL(), auConfiguration.getAppInfoClientID(), true, true, + auConfiguration.getCommonSigningAlgorithm(), auAuthorisationBuilder.getCodeVerifier()) + Assert.assertEquals(errorResponse.toJSONObject().get(AUConstants.ERROR_DESCRIPTION), + AUConstants.CODE_EXPIRE_ERROR_MSG) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Authorisation Count, new Authorisation count and amendment count should increase as it completed the authorisation flow + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + amendedCurrentDayIndividual = amendedCurrentDayIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedFailedTokenExchangeCurrentDay = abandonedFailedTokenExchangeCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAccountSelectionMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAccountSelectionMetrics.groovy new file mode 100644 index 000000000..7f67fd57d --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAccountSelectionMetrics.groovy @@ -0,0 +1,824 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.authorisation + +import com.nimbusds.oauth2.sdk.AccessTokenResponse +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.openqa.selenium.By +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +/** + * Test cases to retrieve Authorisation Metrics for Abandon PreAccountSelection Metrics. + */ +class AbandonPreAccountSelectionMetrics extends AUTest { + + private AccessTokenResponse userAccessToken + private String cdrArrangementId = "" + private String requestUri + def shareableElements + String accountID, userId + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Close Browser Session in Profile Selection Page"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + authWebDriver.selectOption(AUPageObjects.INDIVIDUAL_PROFILE_SELECTION) + } + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Cancel Auth flow in Profile Selection Page"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Click on cancel button in login page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + authWebDriver.selectOption(AUPageObjects.INDIVIDUAL_PROFILE_SELECTION) + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CANCEL_XPATH) + driver.findElement(By.xpath(AUPageObjects.CONFIRM_CONSENT_DENY_XPATH)).click() + } + } + .execute() + + def authUrl = automationResponse.currentUrl.get() + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) + String stateParam = authUrl.split("state=")[1] + Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Cancel in Individual Accounts Selection"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Click on cancel button in Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + authWebDriver.selectOption(AUPageObjects.INDIVIDUAL_PROFILE_SELECTION) + authWebDriver.clickButtonXpath(AUPageObjects.PROFILE_SELECTION_NEXT_BUTTON) + + //Verify user navigates to Accounts selection page + authWebDriver.isElementDisplayed(AUTestUtil.getSingleAccountXPath()) + + //Click on Cancel + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CANCEL_XPATH) + driver.findElement(By.xpath(AUPageObjects.CONFIRM_CONSENT_DENY_XPATH)).click() + } + } + .execute() + + def authUrl = automationResponse.currentUrl.get() + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) + String stateParam = authUrl.split("state=")[1] + Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Cancel in Business Accounts Selection"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Click on cancel button in Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + authWebDriver.selectOption(AUPageObjects.ORGANIZATION_A_PROFILE_SELECTION) + authWebDriver.clickButtonXpath(AUPageObjects.PROFILE_SELECTION_NEXT_BUTTON) + + //Verify user navigates to Accounts selection page + authWebDriver.isElementDisplayed(AUTestUtil.getBusinessAccount1CheckBox()) + + //Click on Cancel + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CANCEL_XPATH) + driver.findElement(By.xpath(AUPageObjects.CONFIRM_CONSENT_DENY_XPATH)).click() + } + } + .execute() + + def authUrl = automationResponse.currentUrl.get() + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) + String stateParam = authUrl.split("state=")[1] + Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Close Browser Session in Account Selection Page"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close the browser session on Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + authWebDriver.selectOption(AUPageObjects.ORGANIZATION_A_PROFILE_SELECTION) + authWebDriver.clickButtonXpath(AUPageObjects.PROFILE_SELECTION_NEXT_BUTTON) + + //Verify user navigates to Accounts selection page + authWebDriver.isElementDisplayed(AUTestUtil.getBusinessAccount1CheckBox()) + } + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Cancel in Individual Accounts Selection in amendment flow"() { + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close the browser session on Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + //Verify user navigates to Accounts selection page + authWebDriver.isElementDisplayed(AUTestUtil.getSingleAccountXPath()) + + //Click on Cancel + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CANCEL_XPATH) + driver.findElement(By.xpath(AUPageObjects.CONFIRM_CONSENT_DENY_XPATH)).click() + } + } + .execute() + + def authUrl = automationResponse.currentUrl.get() + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) + String stateParam = authUrl.split("state=")[1] + Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation and New Authorisation count should be increased by 1 + activeAuthIndividual = activeAuthIndividual +1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual +1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Cancel in Business Accounts Selection in amendment flow"() { + + //Send Authorisation Request for 1st time + doConsentAuthorisation(clientId, AUAccountProfile.ORGANIZATION_A) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close the browser session on Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + + //Verify user navigates to Accounts selection page + authWebDriver.isElementDisplayed(AUTestUtil.getBusinessAccount1CheckBox()) + + //Click on Cancel + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CANCEL_XPATH) + driver.findElement(By.xpath(AUPageObjects.CONFIRM_CONSENT_DENY_XPATH)).click() + } + } + .execute() + + def authUrl = automationResponse.currentUrl.get() + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) + String stateParam = authUrl.split("state=")[1] + Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation and New Authorisation count should be increased by 1 + activeAuthNonIndividual = activeAuthNonIndividual +1 + newAuthCurrentDayOngoingNonIndividual = newAuthCurrentDayOngoingNonIndividual +1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Close Browser Session in Account Selection Page in amendment flow"() { + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close the browser session on Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + //Verify user navigates to Accounts selection page + authWebDriver.isElementDisplayed(AUTestUtil.getSingleAccountXPath()) + } + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation and New Authorisation count should be increased by 1 + activeAuthIndividual = activeAuthIndividual +1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual +1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify abandonment of consent after going back from Account Selection Page by clicking on browser back button"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Click on cancel button in Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + authWebDriver.selectOption(AUPageObjects.INDIVIDUAL_PROFILE_SELECTION) + authWebDriver.clickButtonXpath(AUPageObjects.PROFILE_SELECTION_NEXT_BUTTON) + + //Verify user navigates to Accounts selection page + authWebDriver.isElementDisplayed(AUTestUtil.getSingleAccountXPath()) + + // Navigate back and close the browser + driver.navigate().back() + } + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify abandonment of consent after going back from Profile Selection Page by clicking on browser back button"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Click on cancel button in Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + authWebDriver.selectOption(AUPageObjects.INDIVIDUAL_PROFILE_SELECTION) + + // Navigate back and close the browser + driver.navigate().back() + } + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify successful consent flow which does not have account scope"() { + + scopes = [ + AUAccountScope.BANK_PAYEES_READ, + AUAccountScope.BANK_CUSTOMER_BASIC_READ, + AUAccountScope.BANK_CUSTOMER_DETAIL_READ + ] + + // Send Authorisation request and generate user access token + doConsentAuthorisationWithoutAccountSelection() + generateUserAccessToken() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation and New Ongoing Individual count increased by 1 + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify abandonment of consent flow in Consent Details Page for consent without account scope"() { + + scopes = [ + AUAccountScope.BANK_PAYEES_READ, + AUAccountScope.BANK_CUSTOMER_BASIC_READ, + AUAccountScope.BANK_CUSTOMER_DETAIL_READ + ] + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Click on cancel button in Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + authWebDriver.selectOption(AUPageObjects.INDIVIDUAL_PROFILE_SELECTION) + authWebDriver.clickButtonXpath(AUPageObjects.PROFILE_SELECTION_NEXT_BUTTON) + } + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAccountSelectionCurrentDay = abandonedPreAccountSelectionCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify successful secondary user consent flow"() { + + auConfiguration.setPsuNumber(1) + def clientId = auConfiguration.getAppInfoClientID() + + //Get Sharable Account List and Secondary User with Authorize Permission + shareableElements = AUTestUtil.getSecondaryUserDetails(getSharableBankAccounts()) + + accountID = shareableElements[AUConstants.PARAM_ACCOUNT_ID] + userId = auConfiguration.getUserPSUName() + + def updateResponse = updateSecondaryUserInstructionPermission(accountID, userId, AUConstants.ACTIVE) + Assert.assertEquals(updateResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Secondary Consent Authorisation + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + doSecondaryAccountSelection(scopes, requestUri.toURI()) + Assert.assertNotNull(authorisationCode) + + //Get User Access Token + generateUserAccessToken() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + //Active Authorisation and New Ongoing Individual count increased by 1 + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify abandonment in profile selection page when authorising multiple consents on same browser session"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + //Navigate through Authorise Flow + authorisationCode = authoriseConsentWithoutClosingBrowser(scopes, requestUri.toURI()) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Authorisation - Second Consent + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, ""), "request_uri") + Assert.assertNotNull(requestUri) + + //Navigate through Authorise Flow + //Retrieve the second authorization code + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close the browser session on Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + if (auConfiguration.getProfileSelectionEnabled()) { + authWebDriver.selectOption(AUPageObjects.INDIVIDUAL_PROFILE_SELECTION) + authWebDriver.clickButtonXpath(AUPageObjects.PROFILE_SELECTION_NEXT_BUTTON) + } + } + .execute(true) + + //Wait Time Abandon Time Pass + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Active Individual Authorisation, New Ongoing Individual and Abandonment count increased by 1 + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + highPriorityCurrentDay = highPriorityCurrentDay + 3 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthenticationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthenticationMetrics.groovy new file mode 100644 index 000000000..e4b057cd1 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthenticationMetrics.groovy @@ -0,0 +1,304 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.authorisation + +import com.nimbusds.oauth2.sdk.AccessTokenResponse +import org.openqa.selenium.By +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.NavigationAutomationStep +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +import java.util.concurrent.TimeUnit + +/** + * Test cases to retrieve Authorisation Metrics for Abandon PreAuthentication Metrics. + */ +class AbandonPreAuthenticationMetrics extends AUTest { + + private AccessTokenResponse userAccessToken + private String cdrArrangementId = "" + private String requestUri + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Close browser session in OTP page"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //User Login + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Click on SignIn Button + authWebDriver.clickButtonXpath(AUPageObjects.AU_AUTH_SIGNIN_XPATH) + + //Identifier First Authentication + Assert.assertTrue(authWebDriver.isElementDisplayed(AUConstants.LBL_OTP_TIMEOUT)) + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAuthenticationCurrentDay = abandonedPreAuthenticationCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authenticate consent flow with incorrect OTP but proceed again with correct OTP"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //User Login + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Click on SignIn Button + authWebDriver.clickButtonXpath(AUPageObjects.AU_AUTH_SIGNIN_XPATH) + + //Identifier First Authentication + authWebDriver.executeSMSOTP(AUPageObjects.AU_LBL_SMSOTP_AUTHENTICATOR, AUPageObjects.AU_TXT_OTP_CODE_ID, + "123") + authWebDriver.clickButtonXpath(AUPageObjects.AU_BTN_AUTHENTICATE) + + driver.findElement(By.xpath(AUPageObjects.AU_LBL_SMSOTP_AUTHENTICATOR)).click() + authWebDriver.executeSMSOTP(AUPageObjects.AU_LBL_SMSOTP_AUTHENTICATOR, AUPageObjects.AU_TXT_OTP_CODE_ID, + AUConstants.OTP_CODE) + authWebDriver.clickButtonXpath(AUPageObjects.AU_BTN_AUTHENTICATE) + + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Select Profile and Accounts + selectProfileAndAccount(authWebDriver, AUAccountProfile.ORGANIZATION_A) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + + //Click Authorise Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + } + .execute() + + authorisationCode = AUTestUtil.getCodeFromJwtResponse(automationResponse.currentUrl.get()) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(userAccessToken.tokens.accessToken) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Authorisation Count should increase as it completed the authorisation flow + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Close browser session in OTP page during amendment flow"() { + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //User Login + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Click on SignIn Button + authWebDriver.clickButtonXpath(AUPageObjects.AU_AUTH_SIGNIN_XPATH) + + //Identifier First Authentication + Assert.assertTrue(authWebDriver.isElementDisplayed(AUConstants.LBL_OTP_TIMEOUT)) + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Authorisation Count should increase as it completed the authorisation flow + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAuthenticationCurrentDay = abandonedPreAuthenticationCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify abandonment of consent flow after going back to login page by clicking on browser back button"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //User Login + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Click on SignIn Button + authWebDriver.clickButtonXpath(AUPageObjects.AU_AUTH_SIGNIN_XPATH) + + //Identifier First Authentication + Assert.assertTrue(authWebDriver.isElementDisplayed(AUConstants.LBL_OTP_TIMEOUT)) + + //Navigate Back + driver.navigate().back() + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAuthenticationCurrentDay = abandonedPreAuthenticationCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthorisationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthorisationMetrics.groovy new file mode 100644 index 000000000..3028dff73 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthorisationMetrics.groovy @@ -0,0 +1,279 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.authorisation + +import com.nimbusds.oauth2.sdk.AccessTokenResponse +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +/** + * Test cases to retrieve Authorisation Metrics for Abandon PreAuthorisation Metrics. + */ +class AbandonPreAuthorisationMetrics extends AUTest { + + private AccessTokenResponse userAccessToken + private String cdrArrangementId = "" + private String requestUri + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Close Browser Session in Consent Detail Page"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + selectProfileAndAccount(authWebDriver, AUAccountProfile.INDIVIDUAL) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAuthorisationCurrentDay = abandonedPreAuthorisationCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify consent abandon by going back from consent details page"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + selectProfileAndAccount(authWebDriver, AUAccountProfile.INDIVIDUAL) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + + //Navigate Back + driver.navigate().back() + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAuthorisationCurrentDay = abandonedPreAuthorisationCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Close Browser Session in Consent Detail Page in amendment flow"() { + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Authorisation Count should increase as it completed the authorisation flow + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAuthorisationCurrentDay = abandonedPreAuthorisationCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify consent abandon by going back from consent details page in amendment flow"() { + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + + //Navigate Back + driver.navigate().back() + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Authorisation Count should increase as it completed the authorisation flow + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAuthorisationCurrentDay = abandonedPreAuthorisationCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreIdentificationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreIdentificationMetrics.groovy new file mode 100644 index 000000000..c19d85027 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreIdentificationMetrics.groovy @@ -0,0 +1,540 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.authorisation + +import com.nimbusds.oauth2.sdk.AccessTokenResponse +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.automation.consent.AUBasicAuthAutomationStep +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.constant.AUPageObjects +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.wso2.openbanking.test.framework.automation.AutomationMethod +import org.wso2.openbanking.test.framework.automation.NavigationAutomationStep +import org.openqa.selenium.By +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +import java.util.concurrent.TimeUnit + +/** + * Test cases to retrieve Authorisation Metrics for Abandon PreIdentification Metrics. + */ +class AbandonPreIdentificationMetrics extends AUTest { + + private AccessTokenResponse userAccessToken + private String cdrArrangementId = "" + private String requestUri + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Cancel consent flow from Login Page"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //User Login + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Click on Cancel Button + authWebDriver.clickButtonXpath(AUPageObjects.BTN_CANCEL) + + //Click on Cancel Confirmation Button + authWebDriver.clickButtonXpath(AUPageObjects.CONFIRM_CONSENT_DENY_XPATH) + } + .execute() + + def authUrl = automationResponse.currentUrl.get() + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + String stateParam = authUrl.split("state=")[1] + Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreIdentificationCurrentDay = abandonedPreIdentificationCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Close browser in login page"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //User Login + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreIdentificationCurrentDay = abandonedPreIdentificationCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authenticate consent flow with incorrect username but proceed again with correct username"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Enter incorrect user name + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, "am@wso2.com") + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Click on SignIn Button + authWebDriver.clickButtonXpath(AUPageObjects.AU_AUTH_SIGNIN_XPATH) + + //Enter Correct User Name + driver.findElement(By.id(AUPageObjects.AU_USERNAME_FIELD_ID)).click() + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Click on SignIn Button + authWebDriver.clickButtonXpath(AUPageObjects.AU_AUTH_SIGNIN_XPATH) + + //Identifier First Authentication + authWebDriver.executeSMSOTP(AUPageObjects.AU_LBL_SMSOTP_AUTHENTICATOR, AUPageObjects.AU_TXT_OTP_CODE_ID, + AUConstants.OTP_CODE) + authWebDriver.clickButtonXpath(AUPageObjects.AU_BTN_AUTHENTICATE) + + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Select Profile and Accounts + selectProfileAndAccount(authWebDriver, AUAccountProfile.INDIVIDUAL) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + + //Click Authorise Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + } + .execute() + + authorisationCode = AUTestUtil.getCodeFromJwtResponse(automationResponse.currentUrl.get()) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(userAccessToken.tokens.accessToken) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify count not increased after abandoning the flow with incorrect OTP"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //User Login + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Click on SignIn Button + authWebDriver.clickButtonXpath(AUPageObjects.AU_AUTH_SIGNIN_XPATH) + + //Identifier First Authentication + authWebDriver.executeSMSOTP(AUPageObjects.AU_LBL_SMSOTP_AUTHENTICATOR, AUPageObjects.AU_TXT_OTP_CODE_ID, + "123") + authWebDriver.clickButtonXpath(AUPageObjects.AU_BTN_AUTHENTICATE) + + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreAuthenticationCurrentDay = abandonedPreAuthenticationCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Cancelling consent authorization from Login page during amendment"() { + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //User Login + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Click on Cancel + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CANCEL_XPATH) + driver.findElement(By.xpath(AUPageObjects.CONFIRM_CONSENT_DENY_XPATH)).click() + } + .execute() + + def authUrl = automationResponse.currentUrl.get() + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + String stateParam = authUrl.split("state=")[1] + Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Authorisation Count should increase as it completed the authorisation flow + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreIdentificationCurrentDay = abandonedPreIdentificationCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 3 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Closing the browser in Login page during amendment"() { + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve and assert the request URI from Push Authorization request + requestUri = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId), "request_uri") + Assert.assertNotNull(requestUri) + + //Retrieve the second authorization code + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //User Login + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Authorisation Count should increase as it completed the authorisation flow + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreIdentificationCurrentDay = abandonedPreIdentificationCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 3 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify abandonment of consent flow after going back by clicking on browser back button"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close Browser Session in Profile selection page + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new NavigationAutomationStep(authoriseUrl, 10)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //User Login + authWebDriver.executeTextField(AUPageObjects.AU_USERNAME_FIELD_ID, auConfiguration.getUserPSUName()) + driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS) + + //Navigate Back + driver.navigate().back() + + } + .execute() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedPreIdentificationCurrentDay = abandonedPreIdentificationCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + unattendedCurrentDay = unattendedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Verify the currentDay count when authorising multiple consents on same browser session"() { + + //Consent Authorisation Flow + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + //Navigate through Authorise Flow + authorisationCode = authoriseConsentWithoutClosingBrowser(scopes, requestUri.toURI()) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Consent Authorisation - Second Consent + def requestUri2 = AUTestUtil.parseResponseBody(auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, ""), "request_uri") + Assert.assertNotNull(requestUri2) + + //Navigate through Authorise Flow + //Retrieve the second authorization code + authoriseUrl = auAuthorisationBuilder.getAuthorizationRequest(requestUri2.toURI(), auConfiguration.getAppInfoClientID()) + .toURI().toString() + + //Close the browser session on Accounts selection page. + automationResponse = getBrowserAutomation(AUConstants.DEFAULT_DELAY) + .addStep(new AUBasicAuthAutomationStep(authoriseUrl)) + .addStep { driver, context -> + AutomationMethod authWebDriver = new AutomationMethod(driver) + + //Select Profile and Accounts + selectProfileAndAccount(authWebDriver, AUAccountProfile.INDIVIDUAL, false) + + //Click Confirm Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + + //Click Authorise Button + authWebDriver.clickButtonXpath(AUPageObjects.CONSENT_CONFIRM_XPATH) + } + .execute(true) + + authorisationCode = AUTestUtil.getCodeFromJwtResponse(automationResponse.currentUrl.get()) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + + //Wait Time Abandon Time Pass + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Active NonIndividual Authorisation and New Ongoing NonIndividual count increased by 2 + activeAuthIndividual = activeAuthIndividual + 2 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 2 + unattendedCurrentDay = unattendedCurrentDay + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 4 + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonRejectedMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonRejectedMetrics.groovy new file mode 100644 index 000000000..2511b4ee9 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonRejectedMetrics.groovy @@ -0,0 +1,132 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.authorisation + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +/** + * Test Cases for Abandon Rejected Metrics. + */ +class AbandonRejectedMetrics extends AUTest { + + private String cdrArrangementId = "" + private String requestUri + private def accessTokenResponse + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Deny the Consent Flow"() { + + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + + String responseUrl = doConsentAuthorisationViaRequestUriDenyFlow(scopes, requestUri.toURI(), + auConfiguration.getAppInfoClientID(), AUAccountProfile.INDIVIDUAL) + + authFlowError = AUTestUtil.getErrorDescriptionFromUrl(responseUrl) + Assert.assertEquals(authFlowError, AUConstants.USER_DENIED_THE_CONSENT) + + //Verify Metrics Response + sleep(AUConstants.ABANDON_WAIT_TIME) + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedRejectedCurrentDay = abandonedRejectedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Deny the Consent Flow in amendment flow"() { + + // Send Authorisation request + doConsentAuthorisation() + + // Retrieve the user access token by auth code + accessTokenResponse = getUserAccessTokenResponse(clientId) + cdrArrangementId = accessTokenResponse.getCustomParameters().get(AUConstants.CDR_ARRANGEMENT_ID) + Assert.assertNotNull(cdrArrangementId) + + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.PROFILE) + + //Retrieve and assert the request URI from Push Authorization request + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + + String responseUrl = doConsentAmendmentDenyFlow(scopes, cdrArrangementId, AUConstants.SHORT_SHARING_DURATION, + auConfiguration.getAppInfoClientID()) + + authFlowError = AUTestUtil.getErrorDescriptionFromUrl(responseUrl) + Assert.assertEquals(authFlowError, AUConstants.USER_DENIED_THE_CONSENT) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Individual Authorisation and New Ongoing Individual count increased by 1 + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Abandon count increased by 1 + if (AUConstants.X_V_HEADER_METRICS == 4) { + abandonedCurrentDay = abandonedCurrentDay + 1 + } else { + abandonedCurrentDay = abandonedCurrentDay + 1 + abandonedRejectedCurrentDay = abandonedRejectedCurrentDay + 1 + } + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/ActiveAndNewAuthorisationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/ActiveAndNewAuthorisationMetrics.groovy new file mode 100644 index 000000000..4518684c3 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/ActiveAndNewAuthorisationMetrics.groovy @@ -0,0 +1,324 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.authorisation + + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +/** + * Test cases to retrieve Authorisation Metrics for New and Active Authorizations. + */ +class ActiveAndNewAuthorisationMetrics extends AUTest { + + private String requestUri + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Authorise New ongoing consent for Individual Profile"(){ + + doConsentAuthorisation(auConfiguration.getAppInfoClientID(), AUAccountProfile.INDIVIDUAL) + generateUserAccessToken() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation and New Ongoing Individual count increased by 1 + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authorise New ongoing consent for Business Profile"(){ + + auConfiguration.setPsuNumber(2) + doConsentAuthorisation(auConfiguration.getAppInfoClientID(), AUAccountProfile.ORGANIZATION_A) + generateUserAccessToken() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active NonIndividual Authorisation and New Ongoing NonIndividual count increased by 1 + activeAuthNonIndividual = activeAuthNonIndividual + 1 + newAuthCurrentDayOngoingNonIndividual = newAuthCurrentDayOngoingNonIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authorise New once off consent for Individual Profile"(){ + + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SHORT_SHARING_DURATION, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + generateUserAccessToken(auConfiguration.getAppInfoClientID()) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New OnceOff Individual count increased by 1 + newAuthCurrentDayOnceOffIndividual = newAuthCurrentDayOnceOffIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authorise New once off consent for Business Profile"(){ + + auConfiguration.setPsuNumber(2) + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SHORT_SHARING_DURATION, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.ORGANIZATION_A) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + generateUserAccessToken(auConfiguration.getAppInfoClientID()) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New OnceOff NonIndividual count increased by 1 + newAuthCurrentDayOnceOffNonIndividual = newAuthCurrentDayOnceOffNonIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authorise New once off consent for Individual Profile with 0 sharing duration"(){ + + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SINGLE_ACCESS_CONSENT, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + generateUserAccessToken(auConfiguration.getAppInfoClientID()) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New OnceOff Individual count increased by 1 + newAuthCurrentDayOnceOffIndividual = newAuthCurrentDayOnceOffIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authorise New once off consent for Individual Profile with 24hr sharing duration"(){ + + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SHARING_DURATION_24H, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + generateUserAccessToken(auConfiguration.getAppInfoClientID()) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New OnceOff Individual count increased by 1 + newAuthCurrentDayOnceOffIndividual = newAuthCurrentDayOnceOffIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authorise New ongoing consent for Individual Profile - joint account"(){ + + automationResponse = doJointAccountConsentAuthorisation(auConfiguration.getAppInfoClientID(), true) + authorisationCode = AUTestUtil.getCodeFromJwtResponse(automationResponse.currentUrl.get()) + + //Generate User Access Token + generateUserAccessToken(auConfiguration.getAppInfoClientID()) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New Ongoing Individual count increased by 1 + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authorise New onceoff consent for Individual Profile - joint account"(){ + + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SHORT_SHARING_DURATION, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + automationResponse = doAuthorisationFlowForJointAccounts(scopes, requestUri.toURI(),null) + authorisationCode = AUTestUtil.getCodeFromJwtResponse(automationResponse.currentUrl.get()) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + generateUserAccessToken(auConfiguration.getAppInfoClientID()) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New OnceOff Individual count increased by 1 + newAuthCurrentDayOnceOffIndividual = newAuthCurrentDayOnceOffIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authorise New ongoing consent for Individual Profile - secondary account"(){ + + auConfiguration.setPsuNumber(1) + + //Send Push Authorisation Request + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + + //Select Secondary Account during authorisation + doSecondaryAccountSelection(scopes, requestUri.toURI()) + Assert.assertNotNull(authorisationCode) + + //Get User Access Token + generateUserAccessToken() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation and New Ongoing Individual count increased by 1 + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Authorise New once off consent for Individual Profile - secondary account"(){ + + auConfiguration.setPsuNumber(1) + + //Send Push Authorisation Request + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SHORT_SHARING_DURATION, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + + //Select Secondary Account during authorisation + doSecondaryAccountSelection(scopes, requestUri.toURI()) + Assert.assertNotNull(authorisationCode) + + //Get User Access Token + generateUserAccessToken() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New OnceOff Individual count increased by 1 + newAuthCurrentDayOnceOffIndividual = newAuthCurrentDayOnceOffIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AmendedAuthorisationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AmendedAuthorisationMetrics.groovy new file mode 100644 index 000000000..ee9ebdb4c --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AmendedAuthorisationMetrics.groovy @@ -0,0 +1,403 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.authorisation + +import com.nimbusds.oauth2.sdk.AccessTokenResponse +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +import java.nio.charset.Charset + +/** + * Test cases to retrieve Authorisation Metrics for amendedAuthorization. + */ +class AmendedAuthorisationMetrics extends AUTest { + + private String cdrArrangementId = "" + private AccessTokenResponse userAccessToken, secondUserAccessToken + private String requestUri + public String secondAuthorisationCode, thirdAuthorisationCode = null + def clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Consent Amendment for Ongoing Single account consent"(){ + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve the second authorization code + authorisationCode = doConsentAmendmentAuthorisation(scopes, cdrArrangementId, + AUConstants.DEFAULT_SHARING_DURATION, auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessTokenRes = getUserAccessTokenResponse() + cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation, New Ongoing Individual and Amendment count increased by 1 + + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + amendedCurrentDayIndividual = amendedCurrentDayIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test (priority = 1) + void "Consent Amendment for Ongoing Business account consent"(){ + + auConfiguration.setPsuNumber(2) + //Send Authorisation Request for 1st time + doConsentAuthorisation(auConfiguration.getAppInfoClientID(), AUAccountProfile.ORGANIZATION_B) + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + auConfiguration.setPsuNumber(2) + //Retrieve the second authorization code + authorisationCode = doBusinessConsentAmendmentAuthorisation(scopes, cdrArrangementId, + AUConstants.ONE_YEAR_DURATION, auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessTokenRes = getUserAccessTokenResponse() + cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation, New Ongoing Individual and Amendment count increased by 1 + + activeAuthNonIndividual = activeAuthNonIndividual + 1 + newAuthCurrentDayOngoingNonIndividual = newAuthCurrentDayOngoingNonIndividual + 1 + amendedCurrentDayNonIndividual = amendedCurrentDayNonIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test (priority = 2) + void "Consent Amendment for Joint account consent"(){ + + automationResponse = doJointAccountConsentAuthorisation(auConfiguration.getAppInfoClientID(), true) + authorisationCode = AUTestUtil.getCodeFromJwtResponse(automationResponse.currentUrl.get()) + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve the second authorization code + authorisationCode = doConsentAmendmentAuthorisation(scopes, cdrArrangementId, + AUConstants.DEFAULT_SHARING_DURATION, auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessTokenRes = getUserAccessTokenResponse() + cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation, New Ongoing Individual and Amendment count increased by 1 + + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + amendedCurrentDayIndividual = amendedCurrentDayIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test (priority = 3) + void "Consent Amendment for Secondary account consent"(){ + + auConfiguration.setPsuNumber(1) + //Send Push Authorisation Request + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + + //Select Secondary Account during authorisation + doSecondaryAccountSelection(scopes, requestUri.toURI()) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve the second authorization code + authorisationCode = doConsentAmendmentAuthorisation(scopes, cdrArrangementId, + AUConstants.DEFAULT_SHARING_DURATION, auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessTokenRes = getUserAccessTokenResponse() + cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation, New Ongoing Individual and Amendment count increased by 1 + + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + amendedCurrentDayIndividual = amendedCurrentDayIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test (priority = 4) + void "Consent Amendment with sharing duration less than 1 hr"(){ + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve the second authorization code + authorisationCode = doConsentAmendmentAuthorisation(scopes, cdrArrangementId, + AUConstants.SHORT_SHARING_DURATION, auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessTokenRes = getUserAccessTokenResponse() + cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Active Authorisation, New Ongoing Individual count increased by 1 and Amendment count not changed. + + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test (priority = 5) + void "Amend onceoff consent to an ongoing consent"(){ + + //Send Authorisation Request for 1st time + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SHORT_SHARING_DURATION, + true, "", clientId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), clientId, AUAccountProfile.INDIVIDUAL) + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve the second authorization code + authorisationCode = doConsentAmendmentAuthorisation(scopes, cdrArrangementId, + AUConstants.DEFAULT_SHARING_DURATION, auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessTokenRes = getUserAccessTokenResponse() + cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New OnceOff Individual count increased and Amendment count increased by 1. + + newAuthCurrentDayOnceOffIndividual = newAuthCurrentDayOnceOffIndividual + 1 + amendedCurrentDayIndividual = amendedCurrentDayIndividual + 1 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test (priority = 6) + void "Amendment of Consent More than once create multiple records"(){ + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //Consent Amendment - 1st time + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + scopes.add(AUAccountScope.BANK_PAYEES_READ) + + //Retrieve the second authorization code + secondAuthorisationCode = doConsentAmendmentAuthorisation(scopes, cdrArrangementId, + AUConstants.DEFAULT_SHARING_DURATION, auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(secondAuthorisationCode) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(secondAuthorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + String cdrArrangementId2 = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId2) + Assert.assertEquals(cdrArrangementId2, cdrArrangementId) + + //Consent Amendment - 2nd Time + //remove an existing scope and add a new scope to amend the consent + scopes.remove(AUAccountScope.BANK_TRANSACTION_READ) + + //Retrieve the third authorization code + thirdAuthorisationCode = doConsentAmendmentAuthorisation(scopes, cdrArrangementId2, + AUConstants.DEFAULT_SHARING_DURATION, auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(thirdAuthorisationCode) + + //Retrieve the third user access token and assert the CDR arrangement ID is the same. + userAccessToken = AURequestBuilder.getUserToken(thirdAuthorisationCode, AUConstants.CODE_VERIFIER, + auConfiguration.getAppInfoClientID()) + def cdrArrangementId3 = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId3) + Assert.assertEquals(cdrArrangementId3, cdrArrangementId) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New OnceOff Individual count increased and Amendment count increased by 1. + newAuthCurrentDayOnceOffIndividual = newAuthCurrentDayOnceOffIndividual + 1 + amendedCurrentDayIndividual = amendedCurrentDayIndividual + 2 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/RevokedAuthorisationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/RevokedAuthorisationMetrics.groovy new file mode 100644 index 000000000..64fc198d8 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/RevokedAuthorisationMetrics.groovy @@ -0,0 +1,280 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.authorisation + +import com.nimbusds.oauth2.sdk.AccessTokenResponse +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +/** + * Test cases to retrieve Authorisation Metrics for revokedAuthorization. + */ +class RevokedAuthorisationMetrics extends AUTest { + + private String cdrArrangementId = "" + private AccessTokenResponse userAccessToken + private String requestUri + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Consent revocation via CDR Arrangement Endpoint for Individual Consent"(){ + + //Send Authorisation Request for 1st time + doConsentAuthorisation() + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //retrieve consumer data successfully + doAccountRetrieval(accessToken) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //revoke sharing arrangement + def revokeResponse = doRevokeCdrArrangement(auConfiguration.getAppInfoClientID(), cdrArrangementId) + Assert.assertEquals(revokeResponse.statusCode(), AUConstants.STATUS_CODE_204) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New Ongoing Individual and revoked count increased by 1. Active authorisations count should not increased. + + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + revokedCurrentDayIndividual = revokedCurrentDayIndividual + 1 + activeAuthIndividual = activeAuthIndividual + 1 + highPriorityCurrentDay = highPriorityCurrentDay + 3 + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Consent revocation via CDR Arrangement Endpoint for Business Consent"(){ + + auConfiguration.setPsuNumber(2) + + //Send Authorisation Request for 1st time + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.ORGANIZATION_A) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //retrieve consumer data successfully + doAccountRetrieval(accessToken) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //revoke sharing arrangement + def revokeResponse = doRevokeCdrArrangement(auConfiguration.getAppInfoClientID(), cdrArrangementId) + Assert.assertEquals(revokeResponse.statusCode(), AUConstants.STATUS_CODE_204) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New Ongoing NonIndividual and revoked count increased by 1. Active authorisations count should not increased. + + newAuthCurrentDayOngoingNonIndividual = newAuthCurrentDayOngoingNonIndividual + 1 + revokedCurrentDayNonIndividual = revokedCurrentDayNonIndividual + 1 + activeAuthNonIndividual = activeAuthNonIndividual + 1 + + highPriorityCurrentDay = highPriorityCurrentDay + 3 + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Consent revocation via CDR Arrangement Endpoint for Individual Once off Consent"(){ + + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SINGLE_ACCESS_CONSENT, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //retrieve consumer data successfully + doAccountRetrieval(accessToken) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //revoke sharing arrangement + def revokeResponse = doRevokeCdrArrangement(auConfiguration.getAppInfoClientID(), cdrArrangementId) + Assert.assertEquals(revokeResponse.statusCode(), AUConstants.STATUS_CODE_204) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New Onceoff Individual count increased by 1. Active authorisations count and the revoked count should not + // increased. + newAuthCurrentDayOnceOffIndividual = newAuthCurrentDayOnceOffIndividual + 1 + + highPriorityCurrentDay = highPriorityCurrentDay + 3 + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Consent revocation via CDR Arrangement Endpoint for Business Once off Consent"(){ + + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SINGLE_ACCESS_CONSENT, + true, "") + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.ORGANIZATION_A) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + AccessTokenResponse userAccessTokenRes = getUserAccessTokenResponse() + String cdrArrangementId = userAccessTokenRes.getCustomParameters().get("cdr_arrangement_id") + accessToken = userAccessTokenRes.tokens.accessToken + Assert.assertNotNull(cdrArrangementId) + + //retrieve consumer data successfully + doAccountRetrieval(accessToken) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //revoke sharing arrangement + def revokeResponse = doRevokeCdrArrangement(auConfiguration.getAppInfoClientID(), cdrArrangementId) + Assert.assertEquals(revokeResponse.statusCode(), AUConstants.STATUS_CODE_204) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New Once off Individual count increased by 1. Active authorisations count and the revoked count should not + // increased. + + newAuthCurrentDayOnceOffNonIndividual = newAuthCurrentDayOnceOffNonIndividual + 1 + + highPriorityCurrentDay = highPriorityCurrentDay + 3 + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } + + @Test + void "Consent revocation after deleting the TPP"(){ + + auConfiguration.setTppNumber(1) + + //Register Application + def registrationResponse = tppRegistration() + clientId = AUTestUtil.parseResponseBody(registrationResponse, "client_id") + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.CREATED) + + //Write Client Id to config file. + AUTestUtil.writeToConfigFile(clientId) + + //Authorise consent + doConsentAuthorisation(clientId) + Assert.assertNotNull(authorisationCode) + + //Generate User Access Token + userAccessToken = AURequestBuilder.getUserToken(authorisationCode, AUConstants.CODE_VERIFIER, + clientId) + String userToken = userAccessToken.tokens.accessToken + cdrArrangementId = userAccessToken.getCustomParameters().get("cdr_arrangement_id") + Assert.assertNotNull(cdrArrangementId) + Assert.assertNotNull(userToken) + + //retrieve consumer data successfully + doAccountRetrieval(userToken) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Delete Application + deleteApplicationIfExists(clientId) + Assert.assertEquals(deletionResponse.statusCode(), AUConstants.STATUS_CODE_204) + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //New Ongoing Individual count and the revoked count increased by 1. + + revokedCurrentDayIndividual = revokedCurrentDayIndividual + 1 + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + highPriorityCurrentDay = highPriorityCurrentDay + 3 + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the response + assertMetricsAuthorisationResponse(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/customerAndRecipientCount/CustomerRecipientCountValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/customerAndRecipientCount/CustomerRecipientCountValidationTests.groovy new file mode 100644 index 000000000..1a44f9c16 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/customerAndRecipientCount/CustomerRecipientCountValidationTests.groovy @@ -0,0 +1,213 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.customerAndRecipientCount + +import com.nimbusds.oauth2.sdk.AccessTokenResponse +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountProfile +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import io.restassured.response.Response +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +/** + * Customer Count and Recipient Count Validation Tests. + */ +class CustomerRecipientCountValidationTests extends AUTest { + + private AccessTokenResponse accessTokenResponse + private String cdrArrangementId = "" + private String clientId, accessToken, requestUri + File xmlFile = new File(System.getProperty("user.dir").toString().concat("/../../resources/test-config.xml")) + + @BeforeClass + void "Initial Metrics Request"() { + + //Send Initial Metrics Request + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + + auConfiguration.setTppNumber(1) + jtiVal = String.valueOf(System.currentTimeMillis()) + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + + //Create New Application + if(auConfiguration.getAppInfoClientID().equalsIgnoreCase("") || + auConfiguration.getAppInfoClientID().equalsIgnoreCase("AppConfig2.Application.ClientID")) { + + Response registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder.getAURegularClaims()) + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + clientId = AUTestUtil.parseResponseBody(registrationResponse, AUConstants.CLIENT_ID) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.CREATED) + clientId = AUTestUtil.parseResponseBody(registrationResponse, "client_id") + AUTestUtil.writeXMLContent(xmlFile.toString(), "Application", "ClientID", clientId, 1) + } + } + + @Test + void "Verify the count 0 if there are no active authorisations"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_CUSTOMER_COUNT), + "${customerCount}", "$AUConstants.DATA_CUSTOMER_COUNT count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_RECIPIENT_COUNT), + "${recipientCount}", "$AUConstants.DATA_RECIPIENT_COUNT count mismatch") + } + + @Test + void "Verify the count equals to the PSU count with active authorisations"() { + + auConfiguration.setPsuNumber(1) + + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Get User Access Token + accessTokenResponse = AURequestBuilder.getUserToken(authorisationCode, auAuthorisationBuilder.getCodeVerifier(), + auConfiguration.getAppInfoClientID()) + accessToken = accessTokenResponse.getTokens().accessToken + cdrArrangementId = accessTokenResponse.getCustomParameters().get("cdr_arrangement_id") + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + customerCount = customerCount + 1 + recipientCount = recipientCount + 1 + + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_CUSTOMER_COUNT), + "${customerCount}", "$AUConstants.DATA_CUSTOMER_COUNT count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_RECIPIENT_COUNT), + "${recipientCount}", "$AUConstants.DATA_RECIPIENT_COUNT count mismatch") + } + + @Test (dependsOnMethods = "Verify the count equals to the PSU count with active authorisations") + void "Verify the count after revoking consent"() { + + //revoke sharing arrangement + Response response = doRevokeCdrArrangement(auConfiguration.getAppInfoClientID(), cdrArrangementId) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_204) + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + customerCount = customerCount - 1 + recipientCount = recipientCount - 1 + + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_CUSTOMER_COUNT), + "${customerCount}", "$AUConstants.DATA_CUSTOMER_COUNT count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_RECIPIENT_COUNT), + "${recipientCount}", "$AUConstants.DATA_RECIPIENT_COUNT count mismatch") + } + + @Test + void "Verify the count unchanged when there is at least one active authorisation exist"() { + + //Create Consent + auConfiguration.setPsuNumber(1) + auConfiguration.setTppNumber(1) + + def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, + AUConstants.DEFAULT_SHARING_DURATION, true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Send Metrics Request and Verify count + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + customerCount = customerCount + 1 + recipientCount = recipientCount + 1 + + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_CUSTOMER_COUNT), + "${customerCount}", "$AUConstants.DATA_CUSTOMER_COUNT count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_RECIPIENT_COUNT), + "${recipientCount}", "$AUConstants.DATA_RECIPIENT_COUNT count mismatch") + + //Same TPP and PSU Create another consent + response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, + true, cdrArrangementId) + requestUri = AUTestUtil.parseResponseBody(response, AUConstants.REQUEST_URI) + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_201) + doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI(), auConfiguration.getAppInfoClientID(), + AUAccountProfile.INDIVIDUAL) + Assert.assertNotNull(authorisationCode) + + //Send Metrics Request and Verify count + metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_CUSTOMER_COUNT), + "${customerCount}", "$AUConstants.DATA_CUSTOMER_COUNT count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_RECIPIENT_COUNT), + "${recipientCount}", "$AUConstants.DATA_RECIPIENT_COUNT count mismatch") + } + + @Test (dependsOnMethods = "Verify the count unchanged when there is at least one active authorisation exist") + void "Verify the count after deleting App via DCR API"() { + + //Get Application Access Token + auConfiguration.setTppNumber(1) + + accessToken = getApplicationAccessToken(auConfiguration.getAppInfoClientID()) + Assert.assertNotNull(accessToken) + + //Delete DCR Request + def registrationResponse = AURegistrationRequestBuilder.buildBasicRequest(accessToken) + .when() + .delete(AUConstants.DCR_REGISTRATION_ENDPOINT + clientId) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_204) + + //Send Metrics Request and Verify count + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + customerCount = customerCount - 1 + recipientCount = recipientCount - 1 + + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_CUSTOMER_COUNT), + "${customerCount}", "$AUConstants.DATA_CUSTOMER_COUNT count mismatch") + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_RECIPIENT_COUNT), + "${recipientCount}", "$AUConstants.DATA_RECIPIENT_COUNT count mismatch") + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy new file mode 100644 index 000000000..6065462b9 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy @@ -0,0 +1,1048 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.error + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import io.restassured.http.ContentType +import io.restassured.response.Response +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +import java.nio.charset.Charset + +/** + * Authenticated Error Metrics Validation. + */ +class ErrorMetrics_Authenticated extends AUTest { + + String encryptedAccount1Id, encryptedAccount2Id + def clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" + + @BeforeClass + void "Initial Metrics Request"() { + + if(!auConfiguration.getAppInfoClientID().equalsIgnoreCase("") || + !auConfiguration.getAppInfoClientID().equalsIgnoreCase("AppConfig.Application.ClientID") ) { + + doConsentAuthorisation() + generateUserAccessToken() + + //Account Retrieval + doAccountRetrieval(userAccessToken) + encryptedAccount1Id = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[0]") + encryptedAccount2Id = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[1]") + } + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Verify the 400 error count for authenticated High priority invocation is listed"() { + + //Send DCR Registration request with same Service Provider Name + if(auConfiguration.getAppInfoClientID().equalsIgnoreCase("") || + auConfiguration.getAppInfoClientID().equalsIgnoreCase("AppConfig.Application.ClientID") ) { + + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + + Response registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder.getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), + new File(auConfiguration.getAppDCRSelfSignedSSAPath()).text)) + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + clientId = AUTestUtil.parseResponseBody(registrationResponse, AUConstants.CLIENT_ID) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_400) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_400) + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + } + + @Test + void "Verify the 401 error count for authenticated High priority invocation is listed"(){ + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(AUConstants.INCORRECT_ACCESS_TOKEN, + AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_401) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + sleep(AUConstants.ABANDON_WAIT_TIME) + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 403 error count for authenticated High priority invocation is listed"() { + + scopes = [ + AUAccountScope.BANK_ACCOUNT_BASIC_READ + ] + + doConsentAuthorisation() + generateUserAccessToken() + + def response = AURequestBuilder.buildBasicRequest(userAccessToken, + AUConstants.X_V_HEADER_CUSTOMER_DETAIL) + .header(AUConstants.X_FAPI_CUSTOMER_IP_ADDRESS , AUConstants.IP) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CUSTOMER)) + .get("${AUConstants.CUSTOMER_DETAILS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_403) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_403) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //High Priority Invocation count increase by 3 + highPriorityCurrentDay = highPriorityCurrentDay + 3 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 405 error count for authenticated High priority invocation is listed"() { + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .post("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_405) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_405) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 406 error count for authenticated High priority invocation is listed"() { + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.UNSUPPORTED_X_V_VERSION, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 500 error count for authenticated High priority invocation is listed"() { + + accessToken = getApplicationAccessToken(clientId) + Assert.assertNotNull(accessToken) + + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + def response = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder.getRegularClaimsWithNewRedirectUri()) + .header(AUConstants.AUTHORIZATION_HEADER_KEY, "${AUConstants.AUTHORIZATION_BEARER_TAG}${accessToken}") + .contentType(ContentType.JSON) + .when() + .put(AUConstants.REGISTER_PATH + auConfiguration.getAppInfoClientID()) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_500) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_500) + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + } + + @Test + void "Verify the 400 error count for authenticated Low priority invocation is listed"() { + + Response response = AURestAsRequestBuilder.buildRequest() + .header(AUConstants.AUTHORIZATION_HEADER_KEY, "Bearer ${userAccessToken}") + .header(AUConstants.X_FAPI_CUSTOMER_IP_ADDRESS , AUConstants.IP) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PAYEES)) + .get("${AUConstants.BULK_PAYEES}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_400) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 401 error count for authenticated Low priority invocation is listed"(){ + + Response response = AURequestBuilder.buildBasicRequest(AUConstants.INCORRECT_ACCESS_TOKEN, AUConstants.X_V_HEADER_PAYEES) + .header(AUConstants.X_FAPI_CUSTOMER_IP_ADDRESS , AUConstants.IP) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PAYEES)) + .get("${AUConstants.BULK_PAYEES}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_401) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 403 error count for authenticated Low priority invocation is listed"() { + + scopes = [ + AUAccountScope.BANK_ACCOUNT_BASIC_READ + ] + + doConsentAuthorisation() + generateUserAccessToken() + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.X_V_HEADER_ACCOUNT, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_403) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_403) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //High Priority Invocation count increase by 2 + highPriorityCurrentDay = highPriorityCurrentDay + 2 + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 405 error count for authenticated Low priority invocation is listed"() { + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.X_V_HEADER_PAYEES, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PAYEES)) + .put("${AUConstants.BULK_PAYEES}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_405) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_405) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 404 error count for authenticated Low priority invocation is listed"() { + + doConsentAuthorisation() + generateUserAccessToken() + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_PAYEES) + .header(AUConstants.X_FAPI_CUSTOMER_IP_ADDRESS , AUConstants.IP) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PAYEES)) + .get("${AUConstants.BULK_PAYEES}/1426558421") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_404) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_404) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 406 error count for authenticated Low priority invocation is listed"() { + + doConsentAuthorisation() + generateUserAccessToken() + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.UNSUPPORTED_X_V_VERSION, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_BALANCES)) + .get("${AUConstants.BULK_BALANCES_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (invocationCount = 3) + void "Verify the 415 error count for authenticated Low priority invocation is listed"() { + + String requestBody = """ + { + "data": { + "accountIds": [ + "${encryptedAccount1Id}", "${encryptedAccount2Id}" + ] + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .contentType(ContentType.XML) + .body(requestBody) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_SCHEDULED_PAYMENT)) + .post("${AUConstants.BULK_SCHEDULE_PAYMENTS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_415) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_415) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 400 error count for authenticated Unattended invocation is listed"() { + + def response = AURestAsRequestBuilder.buildRequest() + .header(AUConstants.AUTHORIZATION_HEADER_KEY, "Bearer ${userAccessToken}") + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CUSTOMER)) + .get("${AUConstants.CUSTOMER_DETAILS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_400) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Unattended count increase by 2 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 401 error count for authenticated Unattended invocation is listed"(){ + + def response = AURequestBuilder.buildBasicRequest(AUConstants.INCORRECT_ACCESS_TOKEN, AUConstants.X_V_HEADER_PAYMENT_SCHEDULED) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_SCHEDULED_PAYMENT)) + .get("${AUConstants.BULK_SCHEDULE_PAYMENTS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_401) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Unattended count increase by 2 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 403 error count for authenticated Unattended invocation is listed"() { + + scopes = [ + AUAccountScope.BANK_CUSTOMER_BASIC_READ + ] + + doConsentAuthorisationWithoutAccountSelection() + generateUserAccessToken() + + def response = AURequestBuilder.buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_CUSTOMER) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CUSTOMER)) + .get("${AUConstants.CUSTOMER_DETAILS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_403) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_403) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //High Priority count increase by 2 + highPriorityCurrentDay = highPriorityCurrentDay + 2 + + //Unattended count increase by 2 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 405 error count for authenticated Unattended invocation is listed"() { + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_CUSTOMER_DETAIL) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CUSTOMER)) + .put("${AUConstants.CUSTOMER_DETAILS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_405) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_405) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Unattended count increase by 2 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 404 error count for authenticated Unattended invocation is listed"() { + + doConsentAuthorisation() + generateUserAccessToken() + + String requestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/12345/transactions" + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_TRANSACTIONS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_TRANSACTIONS)) + .get(requestUrl) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_404) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_404) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Unattended count increase by 2 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 406 error count for authenticated Unattended invocation is listed"() { + + doConsentAuthorisation() + generateUserAccessToken() + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.UNSUPPORTED_X_V_VERSION) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Unattended count increase by 2 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 415 error count for authenticated Unattended invocation is listed"() { + + String assertionString = generator.getClientAssertionJwt(AUConstants.ADMIN_API_ISSUER, AUConstants.ADMIN_API_AUDIENCE) + + String requestBody = """ + { + "data": { + "action": "REFRESH" + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder.buildBasicRequest(assertionString, AUConstants.X_V_HEADER_METRICS) + .contentType(ContentType.TEXT) + .header(AUConstants.X_MIN_HEADER, AUConstants.X_V_MIN_HEADER_METRICS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ADMIN)) + .body(requestBody) + .post("${AUConstants.CDS_PATH}/admin/register/metadata") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_415) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_415) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Unattended count increase by 2 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 400 error count for authenticated LargePayload invocation is listed"() { + + def response = AURestAsRequestBuilder.buildRequest() + .header(AUConstants.AUTHORIZATION_HEADER_KEY, "Bearer ${userAccessToken}") + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .get("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_400) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Large Payload count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 401 error count for authenticated LargePayload invocation is listed"(){ + + def response = AURequestBuilder.buildBasicRequestWithCustomHeaders(AUConstants.INCORRECT_ACCESS_TOKEN, + AUConstants.X_V_HEADER_DIRECT_DEBITS, clientHeader) + .header(AUConstants.X_FAPI_CUSTOMER_IP_ADDRESS , AUConstants.IP) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .get("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_401) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Large Payload count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 403 error count for authenticated LargePayload invocation is listed"() { + + scopes = [ + AUAccountScope.BANK_ACCOUNT_BASIC_READ, + AUAccountScope.BANK_ACCOUNT_DETAIL_READ, + AUAccountScope.BANK_TRANSACTION_READ + ] + + doConsentAuthorisation() + generateUserAccessToken() + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .get("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_403) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_403) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //High Priority count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 2 + + //Large Payload count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 405 error count for authenticated LargePayload invocation is listed"() { + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .put("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_405) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_405) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Large Payload count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 406 error count for authenticated LargePayload invocation is listed"() { + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.UNSUPPORTED_X_V_VERSION) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .get("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Large Payload count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 415 error count for authenticated LargePayload invocation is listed"() { + + String requestBody = """ + { + "data": { + "accountIds": [ + "${consentedAccount}", "${secondConsentedAccount}" + ] + }, + "meta": {} + } + """.stripIndent() + + String directDebitRequestUrl = "${AUConstants.BULK_DIRECT_DEBITS_PATH}" + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.X_V_HEADER_DIRECT_DEBITS, clientHeader) + .contentType(ContentType.TEXT) + .body(requestBody) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .post(directDebitRequestUrl) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_415) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_415) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Large Payload count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 422 error count for authenticated Low priority invocation is listed"() { + + String requestBody = """ + { + "data": { + "accountIds": [ + "eryvsy35278feegyegyse", "yvwylyg89" + ] + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .contentType(ContentType.JSON) + .body(requestBody) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_BALANCES)) + .post("${AUConstants.BULK_BALANCES_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_422) + + //Get the expected errors metrics + authErrorCurrentDay = getErrorsMetrics(authErrorCurrentDay, AUConstants.STATUS_CODE_422) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Low Priority count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 including Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Unauthenticated.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Unauthenticated.groovy new file mode 100644 index 000000000..eea87870c --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Unauthenticated.groovy @@ -0,0 +1,206 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.error + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AURestAsRequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import io.restassured.response.Response +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +/** + * Unauthenticated Error Metrics Validation. + */ +class ErrorMetrics_Unauthenticated extends AUTest { + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test () + void "Verify the 400 error count for unauthenticated invocation is listed"() { + + Response response = AURestAsRequestBuilder.buildRequest() + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PRODUCTS)) + .get("${AUConstants.BANKING_PRODUCT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_400) + + unauthErrorCurrentDay = getErrorsMetrics(unauthErrorCurrentDay, AUConstants.STATUS_CODE_400) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Unauthenticated Invocation count increase by 1 + unauthenticatedCurrentDay = unauthenticatedCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test () + void "Verify the 406 error count for unauthenticated invocation is listed"() { + + Response response = AURestAsRequestBuilder.buildRequest() + .header(AUConstants.X_V_HEADER, AUConstants.UNSUPPORTED_X_V_VERSION) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PRODUCTS)) + .get("${AUConstants.BANKING_PRODUCT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + unauthErrorCurrentDay = getErrorsMetrics(unauthErrorCurrentDay, AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Unauthenticated Invocation count increase by 1 + unauthenticatedCurrentDay = unauthenticatedCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test () + void "Verify the 405 error count for unauthenticated invocation is listed"() { + + Response response = AURestAsRequestBuilder.buildRequest() + .header(AUConstants.X_V_HEADER, AUConstants.X_V_HEADER_PRODUCT) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PRODUCTS)) + .put("${AUConstants.BANKING_PRODUCT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_405) + + unauthErrorCurrentDay = getErrorsMetrics(unauthErrorCurrentDay, AUConstants.STATUS_CODE_405) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step but unauthenticated invocation count + // should not increase as this cannot be considered as an invocation. + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 406 error from Get Status invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithoutAuthorisationHeader(AUConstants.UNSUPPORTED_X_V_VERSION) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DISCOVERY)) + .get("${AUConstants.DISCOVERY_STATUS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + unauthErrorCurrentDay = getErrorsMetrics(unauthErrorCurrentDay, AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //HighPriorityCurrentDay Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Verify the 406 error from Get Outages invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithoutAuthorisationHeader(AUConstants.UNSUPPORTED_X_V_VERSION) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DISCOVERY)) + .get("${AUConstants.DISCOVERY_OUTAGES}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + unauthErrorCurrentDay = getErrorsMetrics(unauthErrorCurrentDay, AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Asserting the Errors Metrics response + assertMetricsErrorResponse(metricsResponse) + + //HighPriorityCurrentDay Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/HighPriorityMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/HighPriorityMetricsValidation.groovy new file mode 100644 index 000000000..46f7539c6 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/HighPriorityMetricsValidation.groovy @@ -0,0 +1,728 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.invocation_performance_averageResponse + +import com.nimbusds.oauth2.sdk.AccessTokenResponse +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUAccountScope +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURegistrationRequestBuilder +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import io.restassured.response.Response +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +import java.nio.charset.Charset + +/** + * Test Cases for Invocations, Performance, Average Response and Average TPS Metrics - High Priority Tier + */ +class HighPriorityMetricsValidation extends AUTest { + + private AccessTokenResponse accessTokenResponse + private String cdrArrangementId = "" + private String clientId, accessToken, refreshToken + def clientHeader + + @BeforeClass + void "Get User Access Token"() { + + clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" + + if(!auConfiguration.getAppInfoClientID().equalsIgnoreCase("") || + !auConfiguration.getAppInfoClientID().equalsIgnoreCase("AppConfig.Application.ClientID") ) { + doConsentAuthorisation() + generateUserAccessToken() + } + + //Initial Metrics Call + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Count increase with Get Status invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithoutAuthorisationHeader(AUConstants.X_V_HEADER_STATUS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DISCOVERY)) + .get("${AUConstants.DISCOVERY_STATUS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Outages invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithoutAuthorisationHeader(AUConstants.X_V_HEADER_OUTAGES) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DISCOVERY)) + .get("${AUConstants.DISCOVERY_OUTAGES}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Accounts - customer present invocation"() { + + def response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Customer Detail - customer present invocation"() { + + Response response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.X_V_HEADER_CUSTOMER_DETAIL, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CUSTOMER)) + .get("${AUConstants.CUSTOMER_DETAILS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Customer - customer present invocation"() { + + Response response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.X_V_HEADER_CUSTOMER, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CUSTOMER)) + .get("${AUConstants.BULK_CUSTOMER}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test(priority = 1) + void "Count Increase with valid authorise request"() { + + auConfiguration.setTppNumber(0) + + //Authorise the consent + doConsentAuthorisation() + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Authorisation Count increase by 1 for the new Authorisation + activeAuthIndividual = activeAuthIndividual + 1 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 1, dependsOnMethods = "Count Increase with valid authorise request") + void "Count increase with User Access Token invocation"() { + + //Get User Access Token + accessTokenResponse = getUserAccessTokenResponse(auConfiguration.getAppInfoClientID()) + accessToken = accessTokenResponse.getTokens().accessToken + refreshToken = accessTokenResponse.getTokens().refreshToken + cdrArrangementId = accessTokenResponse.getCustomParameters().get("cdr_arrangement_id") + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 1, dependsOnMethods = "Count increase with User Access Token invocation") + void "Count increase with Introspect invocation"() { + + def response = AURequestBuilder + .buildIntrospectionRequest(refreshToken.toString(), auConfiguration.getAppInfoClientID()) + .post(AUConstants.INTROSPECTION_ENDPOINT) + + Assert.assertTrue(response.jsonPath().get("active").toString().contains("true")) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 1, dependsOnMethods = "Count increase with User Access Token invocation") + void "Count increase with Revoke invocation"() { + + def revokeResponse = AURequestBuilder + .buildRevokeIntrospectionRequest(accessToken.toString(), auConfiguration.getAppInfoClientID()) + .post(AUConstants.TOKEN_REVOKE_PATH) + + Assert.assertEquals(revokeResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + revokedCurrentDayIndividual = revokedCurrentDayIndividual + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 2) + void "Count increase when an High Priority request return an 406 error"() { + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, + AUConstants.UNSUPPORTED_X_V_VERSION, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 2) + void "Count increase when an High Priority request return an 403 error"() { + + scopes = [ + AUAccountScope.BANK_ACCOUNT_BASIC_READ + ] + + doConsentAuthorisation() + generateUserAccessToken() + + def response = AURequestBuilder.buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_CUSTOMER_DETAIL) + .header(AUConstants.X_FAPI_CUSTOMER_IP_ADDRESS , AUConstants.IP) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CUSTOMER)) + .get("${AUConstants.CUSTOMER_DETAILS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_403) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //High Priority Invocation count increase by 3 (Authorisation + Token Request + API Request) + highPriorityCurrentDay = highPriorityCurrentDay + 3 + newAuthCurrentDayOngoingIndividual = newAuthCurrentDayOngoingIndividual + 1 + activeAuthIndividual = activeAuthIndividual + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 2) + void "Count increase when an High Priority request return an 401 error"() { + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(AUConstants.INCORRECT_ACCESS_TOKEN, + AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.UNAUTHORIZED) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 2) + void "Count increase when error in Get Status invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithoutAuthorisationHeader(AUConstants.UNSUPPORTED_X_V_VERSION) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DISCOVERY)) + .get("${AUConstants.DISCOVERY_STATUS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 2) + void "Count increase when error in Get Outages invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithoutAuthorisationHeader(AUConstants.UNSUPPORTED_X_V_VERSION) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DISCOVERY)) + .get("${AUConstants.DISCOVERY_OUTAGES}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 3) + void "Count increase with DCR Register invocation"() { + + //Send DCR Request + auConfiguration.setTppNumber(1) + + jtiVal = String.valueOf(System.currentTimeMillis()) + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder.getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), + auConfiguration.getAppDCRSelfSignedSSAPath())) + .when() + .post(AUConstants.DCR_REGISTRATION_ENDPOINT) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.CREATED) + clientId = AUTestUtil.parseResponseBody(registrationResponse, "client_id") + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Verify Metrics Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 3, dependsOnMethods = "Count increase with DCR Register invocation") + void "Count increase with Application Access Token invocation"() { + + auConfiguration.setTppNumber(1) + //Get Application Access Token + accessToken = getApplicationAccessToken(clientId) + Assert.assertNotNull(accessToken) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 3, dependsOnMethods = "Count increase with Application Access Token invocation") + void "Count increase with DCR Retrieval invocation"() { + + auConfiguration.setTppNumber(1) + //DCR Retrieval Request + def registrationResponse = AURegistrationRequestBuilder.buildBasicRequest(accessToken) + .when() + .get(AUConstants.DCR_REGISTRATION_ENDPOINT + clientId) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.OK) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 3, dependsOnMethods = "Count increase with Application Access Token invocation") + void "Count increase with DCR Update invocation"() { + + auConfiguration.setTppNumber(1) + + //DCR Update Request + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder.getAURegularClaims(auConfiguration.getAppDCRSoftwareId(), + auConfiguration.getAppDCRSelfSignedSSAPath())) + .header(AUConstants.AUTHORIZATION_HEADER_KEY, "${AUConstants.AUTHORIZATION_BEARER_TAG}${accessToken}") + .when() + .put(AUConstants.DCR_REGISTRATION_ENDPOINT + clientId) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.OK) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 4, dependsOnMethods = "Count increase with Application Access Token invocation") + void "Count increase with DCR Delete invocation"() { + + //Delete DCR Request + def registrationResponse = AURegistrationRequestBuilder.buildBasicRequest(accessToken) + .when() + .delete(AUConstants.DCR_REGISTRATION_ENDPOINT + clientId) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_204) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 4) + void "Count increase with DCR Retrieval invocation with incorrect access token"() { + + //DCR Retrieval Request + def registrationResponse = AURegistrationRequestBuilder.buildBasicRequest( + AUConstants.INCORRECT_ACCESS_TOKEN) + .when() + .get(AUConstants.DCR_REGISTRATION_ENDPOINT + clientId) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.UNAUTHORIZED) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), + AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 4) + void "Count increase with DCR Update invocation with incorrect access token"() { + + //DCR Update Request + AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() + def registrationResponse = AURegistrationRequestBuilder + .buildRegistrationRequest(registrationRequestBuilder.getAURegularClaims()) + .header(AUConstants.AUTHORIZATION_HEADER_KEY, + "${AUConstants.AUTHORIZATION_BEARER_TAG}${AUConstants.INCORRECT_ACCESS_TOKEN}") + .when() + .put(AUConstants.DCR_REGISTRATION_ENDPOINT + clientId) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.UNAUTHORIZED) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 4) + void "Count increase with DCR Delete invocation with incorrect access token"() { + + //Delete DCR Request + def registrationResponse = AURegistrationRequestBuilder.buildBasicRequest( + AUConstants.INCORRECT_ACCESS_TOKEN) + .when() + .delete(AUConstants.DCR_REGISTRATION_ENDPOINT + clientId) + + Assert.assertEquals(registrationResponse.statusCode(), AUConstants.UNAUTHORIZED) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //High Priority Invocation count increase by 1 + highPriorityCurrentDay = highPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LargePayloadMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LargePayloadMetricsValidation.groovy new file mode 100644 index 000000000..62448b791 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LargePayloadMetricsValidation.groovy @@ -0,0 +1,283 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.invocation_performance_averageResponse + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import io.restassured.http.ContentType +import io.restassured.response.Response +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +import java.nio.charset.Charset + +/** + * Test Cases for Invocations, Performance, Average Response and Average TPS Metrics - Large Payload Tier + */ +class LargePayloadMetricsValidation extends AUTest { + + private String encryptedAccount1Id, encryptedAccount2Id + def clientHeader + + @BeforeClass + void "Get User Access Token"() { + + clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" + + if(!auConfiguration.getAppInfoClientID().equalsIgnoreCase("") || + !auConfiguration.getAppInfoClientID().equalsIgnoreCase("AppConfig.Application.ClientID") ) { + doConsentAuthorisation() + generateUserAccessToken() + + //Account Retrieval + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + encryptedAccount1Id = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[0]") + encryptedAccount2Id = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[1]") + } + + //Initial Metrics Call + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Count increase with Get Bulk Direct Debits invocation - customer present"() { + + Response response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_DIRECT_DEBITS, clientHeader ) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .get("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Large Payload Current Day Invocation count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Bulk Direct Debits invocation - without customer present"() { + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_DIRECT_DEBITS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .get("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Large Payload Current Day Invocation count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Direct Debits For Specific Accounts invocation - customer present"() { + + String requestBody = """ + { + "data": { + "accountIds": [ + "${encryptedAccount1Id}", "${encryptedAccount2Id}" + ] + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_DIRECT_DEBITS, clientHeader) + .contentType(ContentType.JSON) + .body(requestBody) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .post("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Large Payload Current Day Invocation count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Direct Debits For Specific Accounts invocation - without customer present"() { + + String requestBody = """ + { + "data": { + "accountIds": [ + "${encryptedAccount1Id}", "${encryptedAccount2Id}" + ] + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_DIRECT_DEBITS) + .contentType(ContentType.JSON) + .body(requestBody) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .post("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Large Payload Current Day Invocation count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase when an Large Payload request return an error"() { + + String requestBody = """ + { + "data": { + "accountIds": [ + "4327823409", "455325897" + ] + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_DIRECT_DEBITS) + .contentType(ContentType.JSON) + .body(requestBody) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .post("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_422) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Large Payload Current Day Invocation count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase when an Large Payload request return an 401 error"() { + + Response response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(AUConstants.INCORRECT_ACCESS_TOKEN, + AUConstants.X_V_HEADER_DIRECT_DEBITS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .get("${AUConstants.BULK_DIRECT_DEBITS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Large Payload Current Day Invocation count increase by 1 + largePayloadCurrentDay = largePayloadCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LowPriorityMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LowPriorityMetricsValidation.groovy new file mode 100644 index 000000000..80b8409d8 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LowPriorityMetricsValidation.groovy @@ -0,0 +1,508 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.invocation_performance_averageResponse + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import io.restassured.http.ContentType +import io.restassured.response.Response +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +import java.nio.charset.Charset + +/** + * Test Cases for Invocations, Performance, Average Response and Average TPS Metrics - Low Priority Tier + */ +class LowPriorityMetricsValidation extends AUTest { + + private String encryptedAccount1Id, encryptedAccount2Id, encryptedTransactionId, encryptedPayeeId + def clientHeader + + @BeforeClass + void "Get User Access Token"() { + + clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" + + if(!auConfiguration.getAppInfoClientID().equalsIgnoreCase("") || + !auConfiguration.getAppInfoClientID().equalsIgnoreCase("AppConfig.Application.ClientID") ) { + doConsentAuthorisation() + generateUserAccessToken() + + //Account Retrieval + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + encryptedAccount1Id = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[0]") + encryptedAccount2Id = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[1]") + } + + //Initial Metrics Call + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Count increase with Get Account Details - customer present invocation"() { + + def response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_ACCOUNT, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Current Day Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Account Balance - customer present invocation"() { + + def response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_BALANCE, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_BALANCES)) + .get("${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/balance") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Current Day Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Bulk Balances - customer present invocation"() { + + def response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_BALANCES, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_BALANCES)) + .get("${AUConstants.BULK_BALANCES_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Current Day Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Balances For Specific Accounts - customer present invocation"() { + + def response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_BALANCE, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_BALANCES)) + .get("${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/balance") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Current Day Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Direct Debits For Account - customer present invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_DIRECT_DEBITS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/direct-debits") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Scheduled Payments Bulk - customer present invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_PAYMENT_SCHEDULED, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_SCHEDULED_PAYMENT)) + .get("${AUConstants.BULK_SCHEDULE_PAYMENTS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Scheduled Payments For Account - customer present invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_PAYMENT_SCHEDULED, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_SCHEDULED_PAYMENT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/payments/scheduled") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Scheduled Payments For Specific Accounts - customer present invocation"() { + + String requestBody = """ + { + "data": { + "accountIds": [ + "${encryptedAccount1Id}", "${encryptedAccount2Id}" + ] + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_PAYMENT_SCHEDULED, clientHeader) + .contentType(ContentType.JSON) + .body(requestBody) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_SCHEDULED_PAYMENT)) + .post("${AUConstants.BULK_SCHEDULE_PAYMENTS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 1) + void "Count increase with Get Transactions For Account - customer present invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_TRANSACTIONS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_TRANSACTIONS)) + .get("${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/transactions") + + encryptedTransactionId = AUTestUtil.parseResponseBody(response, "data.transactions.transactionId[0]") + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Current Day Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 1, dependsOnMethods = "Count increase with Get Transactions For Account - customer present invocation") + void "Count increase with Get Transaction Detail - customer present invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_TRANSACTION, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_TRANSACTIONS)) + .get("${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/" + + "transactions/$encryptedTransactionId") + + encryptedTransactionId = AUTestUtil.parseResponseBody(response, "data.transactions.transactionId[0]") + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Current Day Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 2) + void "Count increase with Get Payees - customer present invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_PAYEES, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PAYEES)) + .get("${AUConstants.BULK_PAYEES}") + + encryptedPayeeId = AUTestUtil.parseResponseBody(response, "data.payees.payeeId[0]") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Current Day Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 2, dependsOnMethods = "Count increase with Get Payees - customer present invocation") + void "Count increase with Get Payee Detail - customer present invocation"() { + + Response response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_PAYEES, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PAYEES)) + .get("${AUConstants.BULK_PAYEES}/${encryptedPayeeId}") + + encryptedPayeeId = AUTestUtil.parseResponseBody(response, "data.payees.payeeId[0]") + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Current Day Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 3) + void "Count increase when an Low Priority request return an error"() { + + String requestBody = """ + { + "data": { + "accountIds": [ + "eryvsy35278feegyegyse", "yvwylyg89" + ] + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder + .buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .contentType(ContentType.JSON) + .body(requestBody) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_BALANCES)) + .post("${AUConstants.BULK_BALANCES_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_422) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 3) + void "Count increase when an Low Priority request return an 401 error"() { + + def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(AUConstants.INCORRECT_ACCESS_TOKEN, + AUConstants.X_V_HEADER_ACCOUNTS, clientHeader) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Low Priority Invocation count increase by 1 + lowPriorityCurrentDay = lowPriorityCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/SessionCountMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/SessionCountMetricsValidation.groovy new file mode 100644 index 000000000..2125d0ef1 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/SessionCountMetricsValidation.groovy @@ -0,0 +1,86 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.invocation_performance_averageResponse + +import com.nimbusds.oauth2.sdk.TokenErrorResponse +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +/** + * Session Count Metrics Validation. + */ +class SessionCountMetricsValidation extends AUTest{ + + @BeforeClass + void "Initial Metrics Request"() { + + //Initial Metrics Call + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Count increase upon successful user access token request"() { + + //Get User Access Token + doConsentAuthorisation() + generateUserAccessToken() + Assert.assertNotNull(userAccessToken) + + //Send Metrics Request + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + sessionCount = sessionCount + 1 + + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_SESSION_COUNT_CURRENTDAY), + "${sessionCount}", "$AUConstants.DATA_SESSION_COUNT_CURRENTDAY count mismatch") + } + + @Test + void "Count unchanged when unsuccessful token request"() { + + //Get User Access Token + doConsentAuthorisation() + + //Send User Access Token request with incorrect redirect url + TokenErrorResponse errorResponse = AURequestBuilder.getUserTokenErrorResponse(authorisationCode, + "https://abc.com", auConfiguration.getAppInfoClientID(), true, true, + auConfiguration.getCommonSigningAlgorithm(), auAuthorisationBuilder.getCodeVerifier()) + Assert.assertEquals(errorResponse.toJSONObject().get(AUConstants.ERROR_DESCRIPTION), + AUConstants.CALLBACK_MISMATCH) + + //Send Metrics Request + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + + Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.DATA_SESSION_COUNT_CURRENTDAY), + "${sessionCount}", "$AUConstants.DATA_SESSION_COUNT_CURRENTDAY count mismatch") + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnattendedMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnattendedMetricsValidation.groovy new file mode 100644 index 000000000..0499d1c5e --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnattendedMetricsValidation.groovy @@ -0,0 +1,600 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.invocation_performance_averageResponse + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import io.restassured.http.ContentType +import io.restassured.response.Response +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +import java.nio.charset.Charset + +/** + * Test Cases for Invocations, Performance, Average Response and Average TPS Metrics - Unattended Tier + */ +class UnattendedMetricsValidation extends AUTest { + + private String encryptedAccount1Id, encryptedAccount2Id, encryptedTransactionId, encryptedPayeeId + def clientHeader + + @BeforeClass + void "Get User Access Token"() { + + clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" + + if(!auConfiguration.getAppInfoClientID().equalsIgnoreCase("") || + !auConfiguration.getAppInfoClientID().equalsIgnoreCase("AppConfig.Application.ClientID") ) { + doConsentAuthorisation() + generateUserAccessToken() + + //Account Retrieval + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + encryptedAccount1Id = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[0]") + encryptedAccount2Id = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[1]") + } + + //Initial Metrics Call + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Count increase with Get Customer - Unattended invocation"() { + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_CUSTOMER) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CUSTOMER)) + .get("${AUConstants.BULK_CUSTOMER}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Customer Detail - Unattended invocation"() { + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_CUSTOMER_DETAIL) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_CUSTOMER)) + .get("${AUConstants.CUSTOMER_DETAILS}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Metadata Update invocation"() { + + String assertionString = generator.getClientAssertionJwt(AUConstants.ADMIN_API_ISSUER, AUConstants.ADMIN_API_AUDIENCE) + + String requestBody = """ + { + "data": { + "action": "REFRESH" + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder.buildBasicRequest(assertionString, AUConstants.X_V_HEADER_METRICS) + .header(AUConstants.CONTENT_TYPE, "application/json") + .header(AUConstants.X_MIN_HEADER, AUConstants.X_V_MIN_HEADER_METRICS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ADMIN)) + .body(requestBody) + .post("${AUConstants.CDS_PATH}/admin/register/metadata") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (invocationCount = 3) + void "Count increase with Get Accounts - Unattended invocation"() { + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + encryptedAccount1Id = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[0]") + encryptedAccount2Id = AUTestUtil.parseResponseBody(response, "data.accounts.accountId[1]") + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Account Balance invocation"() { + + String requestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/balance" + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_BALANCE) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_BALANCES)) + .get(requestUrl) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Account Detail invocation"() { + + String requestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}" + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_ACCOUNT) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get(requestUrl) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Balances For Specific Accounts invocation"() { + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_BALANCE) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_BALANCES)) + .get("${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/balance") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Transactions For Account invocation"() { + + String requestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/transactions" + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_TRANSACTIONS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_TRANSACTIONS)) + .get(requestUrl) + + encryptedTransactionId = AUTestUtil.parseResponseBody(response, "data.transactions.transactionId[0]") + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Direct Debits For Account invocation"() { + + String requestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/direct-debits" + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_DIRECT_DEBITS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) + .get(requestUrl) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Scheduled Payments Bulk invocation"() { + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_PAYMENT_SCHEDULED) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_SCHEDULED_PAYMENT)) + .get("${AUConstants.BULK_SCHEDULE_PAYMENTS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Scheduled Payments For Account invocation"() { + + String requestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/payments/scheduled" + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_PAYMENT_SCHEDULED) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_SCHEDULED_PAYMENT)) + .get(requestUrl) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase with Get Scheduled Payments For Specific Accounts invocation"() { + + String requestBody = """ + { + "data": { + "accountIds": [ + "${encryptedAccount1Id}", "${encryptedAccount2Id}" + ] + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_PAYMENT_SCHEDULED) + .contentType(ContentType.JSON) + .body(requestBody) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_SCHEDULED_PAYMENT)) + .post("${AUConstants.BULK_SCHEDULE_PAYMENTS_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test + void "Count increase when an Unattended request return an error"() { + + String requestBody = """ + { + "data": { + "accountIds": [ + "eryvsy35278feegyegyse", "yvwylyg89" + ] + }, + "meta": {} + } + """.stripIndent() + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_ACCOUNTS) + .contentType(ContentType.JSON) + .body(requestBody) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_BALANCES)) + .post("${AUConstants.BULK_BALANCES_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_422) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 1) + void "TC1202001_Get Bulk Balances"() { + + def response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_BALANCES) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_BALANCES)) + .get("${AUConstants.BULK_BALANCES_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 1, dependsOnMethods = "Count increase with Get Transactions For Account invocation") + void "Count increase with Get Transaction Detail invocation"() { + + String requestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${encryptedAccount1Id}/" + + "transactions/$encryptedTransactionId" + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_TRANSACTION) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_TRANSACTIONS)) + .get(requestUrl) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 2) + void "Count increase with Get Payees invocation"() { + + String requestUrl = "${AUConstants.BULK_PAYEES}" + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_PAYEES) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PAYEES)) + .get(requestUrl) + + encryptedPayeeId = AUTestUtil.parseResponseBody(response, "data.payees.payeeId[0]") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 2, dependsOnMethods = "Count increase with Get Payees invocation") + void "Count increase with Get Payee Detail invocation"() { + + String requestUrl = "${AUConstants.BULK_PAYEES}/${encryptedPayeeId}" + + Response response = AURequestBuilder + .buildBasicRequest(userAccessToken, AUConstants.X_V_HEADER_PAYEES) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PAYEES)) + .get(requestUrl) + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (priority = 3) + void "Count increase when an Unattended request return an 401 error"() { + + def response = AURequestBuilder + .buildBasicRequest(AUConstants.INCORRECT_ACCESS_TOKEN, AUConstants.X_V_HEADER_ACCOUNTS) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_ACCOUNT)) + .get("${AUConstants.BULK_ACCOUNT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_401) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unattended Invocation count increase by 2 (API Request + Metrics Call of BeforeClass Step) + unattendedCurrentDay = unattendedCurrentDay + 2 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnauthenticatedMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnauthenticatedMetricsValidation.groovy new file mode 100644 index 000000000..071fe9854 --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnauthenticatedMetricsValidation.groovy @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.cds.integration.test.admin_api.invocation_performance_averageResponse + +import org.wso2.cds.test.framework.AUTest +import org.wso2.cds.test.framework.constant.AUConstants +import org.wso2.cds.test.framework.request_builder.AURequestBuilder +import org.wso2.cds.test.framework.utility.AUTestUtil +import io.restassured.response.Response +import org.testng.Assert +import org.testng.annotations.BeforeClass +import org.testng.annotations.Test + +/** + * Test Cases for Invocations, Performance, Average Response and Average TPS Metrics - Unauthenticated Tier + */ +class UnauthenticatedMetricsValidation extends AUTest { + + @BeforeClass + void "Initial Metrics Request"() { + + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Assign Metrics to Variables + getInitialMetricsResponse(metricsResponse) + } + + @Test + void "Count increase with Products Invocation"(){ + + Response response = AURequestBuilder.buildBasicRequestWithoutAuthorisationHeader(AUConstants.X_V_HEADER_PRODUCTS) + .accept(AUConstants.ACCEPT) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PRODUCTS)) + .get("${AUConstants.BANKING_PRODUCT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(response.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_PRODUCTS) + productId = AUTestUtil.parseResponseBody(response, "data.products.productId[0]").toString() + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unauthenticated Invocation count increase by 1 + unauthenticatedCurrentDay = unauthenticatedCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (dependsOnMethods = "Count increase with Products Invocation") + void "Count increase with Product Details Invocation"(){ + + Response response = AURequestBuilder.buildBasicRequestWithoutAuthorisationHeader(AUConstants.X_V_HEADER_PRODUCT) + .accept(AUConstants.ACCEPT) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PRODUCTS)) + .get("${AUConstants.BANKING_PRODUCT_PATH}/$productId") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_200) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unauthenticated Invocation count increase by 1 + unauthenticatedCurrentDay = unauthenticatedCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } + + @Test (invocationCount = 15) + void "Count increase when an unauthenticated request return an error"() { + + Response response = AURequestBuilder.buildBasicRequestWithoutAuthorisationHeader(1) + .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_PRODUCTS)) + .get("${AUConstants.BANKING_PRODUCT_PATH}") + + Assert.assertEquals(response.statusCode(), AUConstants.STATUS_CODE_406) + + //Calculate Performance, Average Response and Average TPS Metrics for each tier + calculateTierBasedMetrics() + + //Send Metrics Request and Verify Response + def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) + + Assert.assertEquals(metricsResponse.statusCode(), AUConstants.STATUS_CODE_200) + Assert.assertEquals(metricsResponse.getHeader(AUConstants.X_V_HEADER).toInteger(), AUConstants.X_V_HEADER_METRICS) + + //Unauthenticated Invocation count increase by 1 + unauthenticatedCurrentDay = unauthenticatedCurrentDay + 1 + + //Unattended count increase by 1 for the Metrics Call of BeforeClass Step + unattendedCurrentDay = unattendedCurrentDay + 1 + + //Asserting the Performance, Average Response and Average TPS + assertTierBasedMetrics(metricsResponse) + } +} diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy index efedde36f..435c6a473 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/authorizationflow/AuthorisationFlowTest.groovy @@ -307,7 +307,7 @@ class AuthorisationFlowTest extends AUTest { .execute() def authUrl = automation.currentUrl.get() - Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) String stateParam = authUrl.split("state=")[1] Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy index ea5c3de3d..f6592ae2e 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy @@ -232,7 +232,7 @@ class ConsentAuthFlowValidationTests extends AUTest{ .execute() def authUrl = automation.currentUrl.get() - Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) def stateParam = authUrl.split("state=")[1] Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) } @@ -276,7 +276,7 @@ class ConsentAuthFlowValidationTests extends AUTest{ .execute() def authUrl = automation.currentUrl.get() - Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) def stateParam = authUrl.split("state=")[1] Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) } diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy index 1a0225f0f..a9459c5ea 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserInstructionsAuthorisationTest.groovy @@ -276,7 +276,7 @@ class SecondaryUserInstructionsAuthorisationTest extends AUTest { .execute() def authUrl = automation.currentUrl.get() - Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) def stateParam = authUrl.split("state=")[1] Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) } @@ -306,7 +306,7 @@ class SecondaryUserInstructionsAuthorisationTest extends AUTest { .execute() def authUrl = automation.currentUrl.get() - Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.USER_SKIP_THE_CONSENT_FLOW)) + Assert.assertTrue(AUTestUtil.getDecodedUrl(authUrl).contains(AUConstants.CANCEL_ERROR_IN_ACCOUNTS_PAGE)) def stateParam = authUrl.split("state=")[1] Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) } diff --git a/integration-test-suite/cds-toolkit-test-framework/pom.xml b/integration-test-suite/cds-toolkit-test-framework/pom.xml index f4ca56921..cb2152375 100644 --- a/integration-test-suite/cds-toolkit-test-framework/pom.xml +++ b/integration-test-suite/cds-toolkit-test-framework/pom.xml @@ -110,6 +110,11 @@ org.wso2.orbit.com.nimbusds nimbus-jose-jwt + + mysql + mysql-connector-java + 5.1.49 + diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy index ffbb49a66..22478d5e2 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy @@ -1571,9 +1571,6 @@ class AUTest extends OBTest { */ static void assertMetricsAuthorisationResponse(Response metricsResponse) { - //Asserting the Invocations - assertMetricsInvocationResponse(metricsResponse) - Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ACTIVE_AUTHORIZATION_INDIVIDUAL), "${activeAuthIndividual}", "$AUConstants.ACTIVE_AUTHORIZATION_INDIVIDUAL count mismatch") Assert.assertEquals(AUTestUtil.parseResponseBody(metricsResponse, AUConstants.ACTIVE_AUTHORIZATION_NONINDIVIDUAL), diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUConstants.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUConstants.groovy index 8f2284db3..364f01eb8 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUConstants.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/constant/AUConstants.groovy @@ -409,7 +409,7 @@ class AUConstants extends OBConstants { public static final String ERROR_NOT_ALLOWED_TO_ACCESS = "The access token does not allow you to access the requested resource" public static final String PARAM_PROFILE_NAME = "profileName" public static final String USER_DENIED_THE_CONSENT = "User denied the consent" - public static final String USER_SKIP_THE_CONSENT_FLOW = "User skip the consent flow" + public static final String USER_SKIP_THE_CONSENT_FLOW = "User skipped the consent flow" public static final String CANCEL_ERROR_IN_ACCOUNTS_PAGE = "User skip the consent flow" public static final String ACTIVE = "active" diff --git a/integration-test-suite/pom.xml b/integration-test-suite/pom.xml index 316f0d7b2..d6ceb9414 100644 --- a/integration-test-suite/pom.xml +++ b/integration-test-suite/pom.xml @@ -212,6 +212,11 @@ java-jwt ${com.auth0.version} + + mysql + mysql-connector-java + 5.1.49 + From 0f123dd4876e0d8bd964f8e7b8dda5138dc1fed9 Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Wed, 27 Nov 2024 08:34:11 +0530 Subject: [PATCH 08/20] Test Update for Metrics V5 --- .../test/admin_api/error/ErrorMetrics_Authenticated.groovy | 2 +- .../main/groovy/org/wso2/cds/test/framework/AUTest.groovy | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy index 6065462b9..8be9f9699 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy @@ -970,7 +970,7 @@ class ErrorMetrics_Authenticated extends AUTest { def response = AURequestBuilder.buildBasicRequestWithOptionalHeaders(userAccessToken, AUConstants.X_V_HEADER_DIRECT_DEBITS, clientHeader) - .contentType(ContentType.TEXT) + .contentType(ContentType.XML) .body(requestBody) .baseUri(AUTestUtil.getBaseUrl(AUConstants.BASE_PATH_TYPE_DIRECT_DEBIT)) .post(directDebitRequestUrl) diff --git a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy index 22478d5e2..6ee591734 100644 --- a/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy +++ b/integration-test-suite/cds-toolkit-test-framework/src/main/groovy/org/wso2/cds/test/framework/AUTest.groovy @@ -1768,9 +1768,9 @@ class AUTest extends OBTest { errorCountKeyValuePairs.sort(new Comparator() { @Override int compare(String o1, String o2) { - int key1 = Integer.parseInt(o1.split(":")[0]) - int key2 = Integer.parseInt(o2.split(":")[0]) - return Integer.compare(expectedOrderKeys.indexOf(key1), expectedOrderKeys.indexOf(key2)) + int key1 = Integer.parseInt(o1.split(":")[1]) + int key2 = Integer.parseInt(o2.split(":")[1]) + return Integer.compare(key1, key2) } }) From 42173661a9d7132700738bbd7097f50f96b2d1b9 Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Thu, 28 Nov 2024 11:39:37 +0530 Subject: [PATCH 09/20] Add SmokeTest Tag and updated the testng.xml --- .../accounts/AccountsIdPermanenceTest.groovy | 30 +- .../accounts/DuplicateCommonAuthIdTest.groovy | 6 +- .../AbandonFailedTokenExchangeMetrics.groovy | 6 +- .../AbandonPreAccountSelectionMetrics.groovy | 6 +- .../AbandonPreAuthenticationMetrics.groovy | 4 +- .../AbandonPreAuthorisationMetrics.groovy | 4 +- .../AbandonPreIdentificationMetrics.groovy | 4 +- .../AbandonRejectedMetrics.groovy | 4 +- .../ActiveAndNewAuthorisationMetrics.groovy | 10 +- .../AmendedAuthorisationMetrics.groovy | 10 +- .../RevokedAuthorisationMetrics.groovy | 10 +- .../error/ErrorMetrics_Authenticated.groovy | 4 +- .../error/ErrorMetrics_Unauthenticated.groovy | 8 +- .../HighPriorityMetricsValidation.groovy | 4 +- .../LargePayloadMetricsValidation.groovy | 4 +- .../LowPriorityMetricsValidation.groovy | 4 +- .../SessionCountMetricsValidation.groovy | 4 +- .../UnattendedMetricsValidation.groovy | 4 +- .../UnauthenticatedMetricsValidation.groovy | 4 +- .../ProductRetrievalValidationTest.groovy | 4 +- .../ConcurrentConsentTest.groovy | 2 +- ...DynamicClientRegistrationCreateTest.groovy | 6 +- ...namicClientRegistrationRetrieveTest.groovy | 6 +- .../test/tokenEndpoint/AccessTokenTest.groovy | 14 +- .../CommonTppOnboardingStep.groovy | 4 +- .../bnr/ConsentAuthFlowValidationTests.groovy | 4 +- ...ponseModeFormPostJwtValidationTests.groovy | 2 +- ...ponseModeFragmentJwtValidationTests.groovy | 2 +- .../JarmResponseModeJwtValidationTests.groovy | 2 +- ...ResponseModeQueryJwtValidationTests.groovy | 2 +- .../par/PushedAuthorisationFlowTest.groovy | 6 +- ...CeasingSecondaryUserConsentFlowTest.groovy | 4 +- .../CeasingSecondaryUserManagementTest.groovy | 4 +- .../SecondaryUserAmendmentFlow.groovy | 2 +- .../src/test/resources/testng.xml | 126 +++++--- .../src/test/resources/testngSmokeTest.xml | 287 ++++++++++++++++++ 36 files changed, 460 insertions(+), 147 deletions(-) create mode 100644 integration-test-suite/cds-toolkit-integration-test/src/test/resources/testngSmokeTest.xml diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy index 587944303..21baafe21 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/AccountsIdPermanenceTest.groovy @@ -51,7 +51,7 @@ class AccountsIdPermanenceTest extends AUTest { generateUserAccessToken() } - @Test(priority = 1, groups = "SmokeTest") + @Test(groups = "SmokeTest", priority = 1) void "TC1201001_Get Accounts"() { String bulkAccountRequestUrl = "${AUConstants.BULK_ACCOUNT_PATH}" @@ -88,7 +88,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (dependsOnMethods = "TC1201001_Get Accounts", priority = 1) + @Test (groups = "SmokeTest", dependsOnMethods = "TC1201001_Get Accounts", priority = 1) void "TC1203001_Get Balances For Specific Accounts"() { String requestBody = """ @@ -136,7 +136,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (dependsOnMethods = "TC1201001_Get Accounts", priority = 1) + @Test (groups = "SmokeTest", dependsOnMethods = "TC1201001_Get Accounts", priority = 1) void "TC1204001_Get Account Balance"() { String accBalanceRequestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${firstEncryptedAccountId}/balance" @@ -157,7 +157,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (dependsOnMethods = "TC1201001_Get Accounts", priority = 1) + @Test (groups = "SmokeTest", dependsOnMethods = "TC1201001_Get Accounts", priority = 1) void "TC1205001_Get Account Detail"() { String accountRequestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${firstEncryptedAccountId}" @@ -232,7 +232,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (dependsOnMethods = "TC1201001_Get Accounts", priority = 1) + @Test (groups = "SmokeTest", dependsOnMethods = "TC1201001_Get Accounts", priority = 1) void "TC1208001_Get Direct Debits For Account"() { String directDebitRequestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${firstEncryptedAccountId}/direct-debits" @@ -284,7 +284,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (dependsOnMethods = "TC1201001_Get Accounts", priority = 1) + @Test (groups = "SmokeTest", dependsOnMethods = "TC1201001_Get Accounts", priority = 1) void "TC1210001_Get Direct Debits For Specific Accounts"() { String requestBody = """ @@ -329,7 +329,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (dependsOnMethods = "TC1201001_Get Accounts", priority = 1) + @Test (groups = "SmokeTest", dependsOnMethods = "TC1201001_Get Accounts", priority = 1) void "TC1211001_Get Scheduled Payments for Account"() { String schedulePaymentRequestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${firstEncryptedAccountId}/payments/scheduled" @@ -374,7 +374,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (dependsOnMethods = "TC1201001_Get Accounts", priority = 1) + @Test (groups = "SmokeTest", dependsOnMethods = "TC1201001_Get Accounts", priority = 1) void "TC1213001_Get Scheduled Payments For Specific Accounts"() { String requestBody = """ @@ -432,7 +432,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (dependsOnMethods = "TC1201001_Get Accounts", priority = 1) + @Test (groups = "SmokeTest", dependsOnMethods = "TC1201001_Get Accounts", priority = 1) void "TC1206001_Get Transactions For Account"() { String transactionRequestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${firstEncryptedAccountId}/transactions" @@ -468,7 +468,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (dependsOnMethods = "TC1206001_Get Transactions For Account", priority = 1) + @Test (groups = "SmokeTest", dependsOnMethods = "TC1206001_Get Transactions For Account", priority = 1) void "TC1207001_Get Transaction Detail"() { String transactionRequestUrl = "${AUConstants.BULK_ACCOUNT_PATH}/${firstEncryptedAccountId}/" + @@ -496,7 +496,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test + @Test (groups = "SmokeTest") void "TC1202001_Get Bulk Balances"() { String balanceRequestUrl = "${AUConstants.BULK_BALANCES_PATH}" @@ -621,7 +621,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test + @Test (groups = "SmokeTest") void "TC1209001_Get Bulk Direct Debits"() { String directDebitRequestUrl = "${AUConstants.BULK_DIRECT_DEBITS_PATH}" @@ -688,7 +688,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test + @Test (groups = "SmokeTest") void "TC1212001_Get Scheduled Payments Bulk"() { String schedulePaymentRequestUrl = "${AUConstants.BULK_SCHEDULE_PAYMENTS_PATH}" @@ -796,7 +796,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (priority = 2) + @Test (groups = "SmokeTest", priority = 2) void "TC1214001_Get Payees"() { String payeeRequestUrl = "${AUConstants.BULK_PAYEES}" @@ -829,7 +829,7 @@ class AccountsIdPermanenceTest extends AUTest { softAssertion.assertAll() } - @Test (dependsOnMethods = "TC1214001_Get Payees", priority = 2) + @Test (groups = "SmokeTest", dependsOnMethods = "TC1214001_Get Payees", priority = 2) void "TC1215001_Get Payee Detail"() { String payeeRequestUrl = "${AUConstants.BULK_PAYEES}/${encryptedPayeeId}" diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy index 3953792d4..ab7a69052 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/accounts/DuplicateCommonAuthIdTest.groovy @@ -40,7 +40,7 @@ class DuplicateCommonAuthIdTest extends AUTest { def clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" private def accessTokenResponse - @Test + @Test (groups = "SmokeTest") void "TC0202006_Initiate two authorisation consent flows on same browser session"() { def sessionId @@ -94,7 +94,7 @@ class DuplicateCommonAuthIdTest extends AUTest { Assert.assertNotNull(authorisationCode) } - @Test(dependsOnMethods = "TC0202006_Initiate two authorisation consent flows on same browser session") + @Test(groups = "SmokeTest", dependsOnMethods = "TC0202006_Initiate two authorisation consent flows on same browser session") void "TC0203005_Exchange authorisation code for access token"() { AccessTokenResponse accessTokenResponse = getUserAccessTokenResponse(auConfiguration.getAppInfoClientID()) @@ -102,7 +102,7 @@ class DuplicateCommonAuthIdTest extends AUTest { Assert.assertNotNull(userAccessToken) } - @Test(dependsOnMethods = "TC0203005_Exchange authorisation code for access token") + @Test(groups = "SmokeTest", dependsOnMethods = "TC0203005_Exchange authorisation code for access token") void "TC0401007_Retrieve bulk accounts list"() { def response = AURequestBuilder.buildBasicRequestWithCustomHeaders(userAccessToken, diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonFailedTokenExchangeMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonFailedTokenExchangeMetrics.groovy index 3cbe449b9..27eb9f2a9 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonFailedTokenExchangeMetrics.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonFailedTokenExchangeMetrics.groovy @@ -40,7 +40,7 @@ class AbandonFailedTokenExchangeMetrics extends AUTest { private String requestUri private String secondAuthorisationCode = null - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -52,7 +52,7 @@ class AbandonFailedTokenExchangeMetrics extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Verify Metrics response after abandon the flow without generating token"() { //Consent Authorisation Flow @@ -136,7 +136,7 @@ class AbandonFailedTokenExchangeMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Verify Metrics response when token request failure due to an error"() { //Consent Authorisation Flow diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAccountSelectionMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAccountSelectionMetrics.groovy index 7f67fd57d..4fbd5cd4a 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAccountSelectionMetrics.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAccountSelectionMetrics.groovy @@ -44,7 +44,7 @@ class AbandonPreAccountSelectionMetrics extends AUTest { def shareableElements String accountID, userId - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -101,7 +101,7 @@ class AbandonPreAccountSelectionMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Cancel Auth flow in Profile Selection Page"() { //Consent Authorisation Flow @@ -155,7 +155,7 @@ class AbandonPreAccountSelectionMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Cancel in Individual Accounts Selection"() { //Consent Authorisation Flow diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthenticationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthenticationMetrics.groovy index e4b057cd1..57602a76e 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthenticationMetrics.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthenticationMetrics.groovy @@ -44,7 +44,7 @@ class AbandonPreAuthenticationMetrics extends AUTest { private String cdrArrangementId = "" private String requestUri - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -56,7 +56,7 @@ class AbandonPreAuthenticationMetrics extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Close browser session in OTP page"() { //Consent Authorisation Flow diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthorisationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthorisationMetrics.groovy index 3028dff73..1e6289b7e 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthorisationMetrics.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreAuthorisationMetrics.groovy @@ -41,7 +41,7 @@ class AbandonPreAuthorisationMetrics extends AUTest { private String cdrArrangementId = "" private String requestUri - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -53,7 +53,7 @@ class AbandonPreAuthorisationMetrics extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Close Browser Session in Consent Detail Page"() { //Consent Authorisation Flow diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreIdentificationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreIdentificationMetrics.groovy index c19d85027..0a4a4da41 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreIdentificationMetrics.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonPreIdentificationMetrics.groovy @@ -45,7 +45,7 @@ class AbandonPreIdentificationMetrics extends AUTest { private String cdrArrangementId = "" private String requestUri - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -57,7 +57,7 @@ class AbandonPreIdentificationMetrics extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Cancel consent flow from Login Page"() { //Consent Authorisation Flow diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonRejectedMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonRejectedMetrics.groovy index 2511b4ee9..76d1498ef 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonRejectedMetrics.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AbandonRejectedMetrics.groovy @@ -36,7 +36,7 @@ class AbandonRejectedMetrics extends AUTest { private String requestUri private def accessTokenResponse - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -48,7 +48,7 @@ class AbandonRejectedMetrics extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Deny the Consent Flow"() { response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/ActiveAndNewAuthorisationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/ActiveAndNewAuthorisationMetrics.groovy index 4518684c3..69065da52 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/ActiveAndNewAuthorisationMetrics.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/ActiveAndNewAuthorisationMetrics.groovy @@ -34,7 +34,7 @@ class ActiveAndNewAuthorisationMetrics extends AUTest { private String requestUri - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -46,7 +46,7 @@ class ActiveAndNewAuthorisationMetrics extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Authorise New ongoing consent for Individual Profile"(){ doConsentAuthorisation(auConfiguration.getAppInfoClientID(), AUAccountProfile.INDIVIDUAL) @@ -68,7 +68,7 @@ class ActiveAndNewAuthorisationMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Authorise New ongoing consent for Business Profile"(){ auConfiguration.setPsuNumber(2) @@ -91,7 +91,7 @@ class ActiveAndNewAuthorisationMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Authorise New once off consent for Individual Profile"(){ response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SHORT_SHARING_DURATION, @@ -119,7 +119,7 @@ class ActiveAndNewAuthorisationMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Authorise New once off consent for Business Profile"(){ auConfiguration.setPsuNumber(2) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AmendedAuthorisationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AmendedAuthorisationMetrics.groovy index ee9ebdb4c..b8321284a 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AmendedAuthorisationMetrics.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/AmendedAuthorisationMetrics.groovy @@ -42,7 +42,7 @@ class AmendedAuthorisationMetrics extends AUTest { public String secondAuthorisationCode, thirdAuthorisationCode = null def clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -54,7 +54,7 @@ class AmendedAuthorisationMetrics extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Consent Amendment for Ongoing Single account consent"(){ //Send Authorisation Request for 1st time @@ -100,7 +100,7 @@ class AmendedAuthorisationMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test (priority = 1) + @Test (groups = "SmokeTest", priority = 1) void "Consent Amendment for Ongoing Business account consent"(){ auConfiguration.setPsuNumber(2) @@ -148,7 +148,7 @@ class AmendedAuthorisationMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test (priority = 2) + @Test (groups = "SmokeTest", priority = 2) void "Consent Amendment for Joint account consent"(){ automationResponse = doJointAccountConsentAuthorisation(auConfiguration.getAppInfoClientID(), true) @@ -194,7 +194,7 @@ class AmendedAuthorisationMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test (priority = 3) + @Test (groups = "SmokeTest", priority = 3) void "Consent Amendment for Secondary account consent"(){ auConfiguration.setPsuNumber(1) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/RevokedAuthorisationMetrics.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/RevokedAuthorisationMetrics.groovy index 64fc198d8..c63270f9a 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/RevokedAuthorisationMetrics.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/authorisation/RevokedAuthorisationMetrics.groovy @@ -37,7 +37,7 @@ class RevokedAuthorisationMetrics extends AUTest { private AccessTokenResponse userAccessToken private String requestUri - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -49,7 +49,7 @@ class RevokedAuthorisationMetrics extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Consent revocation via CDR Arrangement Endpoint for Individual Consent"(){ //Send Authorisation Request for 1st time @@ -89,7 +89,7 @@ class RevokedAuthorisationMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Consent revocation via CDR Arrangement Endpoint for Business Consent"(){ auConfiguration.setPsuNumber(2) @@ -137,7 +137,7 @@ class RevokedAuthorisationMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Consent revocation via CDR Arrangement Endpoint for Individual Once off Consent"(){ response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SINGLE_ACCESS_CONSENT, @@ -180,7 +180,7 @@ class RevokedAuthorisationMetrics extends AUTest { assertMetricsAuthorisationResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Consent revocation via CDR Arrangement Endpoint for Business Once off Consent"(){ response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.SINGLE_ACCESS_CONSENT, diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy index 8be9f9699..b8889aeb3 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Authenticated.groovy @@ -41,7 +41,7 @@ class ErrorMetrics_Authenticated extends AUTest { String encryptedAccount1Id, encryptedAccount2Id def clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { if(!auConfiguration.getAppInfoClientID().equalsIgnoreCase("") || @@ -65,7 +65,7 @@ class ErrorMetrics_Authenticated extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Verify the 400 error count for authenticated High priority invocation is listed"() { //Send DCR Registration request with same Service Provider Name diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Unauthenticated.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Unauthenticated.groovy index eea87870c..1859fa0fa 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Unauthenticated.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/error/ErrorMetrics_Unauthenticated.groovy @@ -33,7 +33,7 @@ import org.testng.annotations.Test */ class ErrorMetrics_Unauthenticated extends AUTest { - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -45,7 +45,7 @@ class ErrorMetrics_Unauthenticated extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test () + @Test (groups = "SmokeTest") void "Verify the 400 error count for unauthenticated invocation is listed"() { Response response = AURestAsRequestBuilder.buildRequest() @@ -77,7 +77,7 @@ class ErrorMetrics_Unauthenticated extends AUTest { assertTierBasedMetrics(metricsResponse) } - @Test () + @Test void "Verify the 406 error count for unauthenticated invocation is listed"() { Response response = AURestAsRequestBuilder.buildRequest() @@ -110,7 +110,7 @@ class ErrorMetrics_Unauthenticated extends AUTest { assertTierBasedMetrics(metricsResponse) } - @Test () + @Test void "Verify the 405 error count for unauthenticated invocation is listed"() { Response response = AURestAsRequestBuilder.buildRequest() diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/HighPriorityMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/HighPriorityMetricsValidation.groovy index 46f7539c6..a12b495d1 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/HighPriorityMetricsValidation.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/HighPriorityMetricsValidation.groovy @@ -42,7 +42,7 @@ class HighPriorityMetricsValidation extends AUTest { private String clientId, accessToken, refreshToken def clientHeader - @BeforeClass + @BeforeClass (alwaysRun = true) void "Get User Access Token"() { clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" @@ -121,7 +121,7 @@ class HighPriorityMetricsValidation extends AUTest { assertTierBasedMetrics(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Count increase with Get Accounts - customer present invocation"() { def response = AURequestBuilder diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LargePayloadMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LargePayloadMetricsValidation.groovy index 62448b791..66ab628b2 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LargePayloadMetricsValidation.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LargePayloadMetricsValidation.groovy @@ -38,7 +38,7 @@ class LargePayloadMetricsValidation extends AUTest { private String encryptedAccount1Id, encryptedAccount2Id def clientHeader - @BeforeClass + @BeforeClass (alwaysRun = true) void "Get User Access Token"() { clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" @@ -68,7 +68,7 @@ class LargePayloadMetricsValidation extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Count increase with Get Bulk Direct Debits invocation - customer present"() { Response response = AURequestBuilder diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LowPriorityMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LowPriorityMetricsValidation.groovy index 80b8409d8..9d9d17378 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LowPriorityMetricsValidation.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/LowPriorityMetricsValidation.groovy @@ -38,7 +38,7 @@ class LowPriorityMetricsValidation extends AUTest { private String encryptedAccount1Id, encryptedAccount2Id, encryptedTransactionId, encryptedPayeeId def clientHeader - @BeforeClass + @BeforeClass (alwaysRun = true) void "Get User Access Token"() { clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" @@ -68,7 +68,7 @@ class LowPriorityMetricsValidation extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Count increase with Get Account Details - customer present invocation"() { def response = AURequestBuilder diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/SessionCountMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/SessionCountMetricsValidation.groovy index 2125d0ef1..e4780f202 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/SessionCountMetricsValidation.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/SessionCountMetricsValidation.groovy @@ -32,7 +32,7 @@ import org.testng.annotations.Test */ class SessionCountMetricsValidation extends AUTest{ - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { //Initial Metrics Call @@ -45,7 +45,7 @@ class SessionCountMetricsValidation extends AUTest{ getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Count increase upon successful user access token request"() { //Get User Access Token diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnattendedMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnattendedMetricsValidation.groovy index 0499d1c5e..fe9ea7ef3 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnattendedMetricsValidation.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnattendedMetricsValidation.groovy @@ -38,7 +38,7 @@ class UnattendedMetricsValidation extends AUTest { private String encryptedAccount1Id, encryptedAccount2Id, encryptedTransactionId, encryptedPayeeId def clientHeader - @BeforeClass + @BeforeClass (alwaysRun = true) void "Get User Access Token"() { clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" @@ -68,7 +68,7 @@ class UnattendedMetricsValidation extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Count increase with Get Customer - Unattended invocation"() { Response response = AURequestBuilder diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnauthenticatedMetricsValidation.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnauthenticatedMetricsValidation.groovy index 071fe9854..ee49df2f0 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnauthenticatedMetricsValidation.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/admin_api/invocation_performance_averageResponse/UnauthenticatedMetricsValidation.groovy @@ -32,7 +32,7 @@ import org.testng.annotations.Test */ class UnauthenticatedMetricsValidation extends AUTest { - @BeforeClass + @BeforeClass (alwaysRun = true) void "Initial Metrics Request"() { def metricsResponse = getMetrics(AUConstants.PERIOD_CURRENT) @@ -44,7 +44,7 @@ class UnauthenticatedMetricsValidation extends AUTest { getInitialMetricsResponse(metricsResponse) } - @Test + @Test (groups = "SmokeTest") void "Count increase with Products Invocation"(){ Response response = AURequestBuilder.buildBasicRequestWithoutAuthorisationHeader(AUConstants.X_V_HEADER_PRODUCTS) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy index d202962dd..6f65bccee 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/banking_products/ProductRetrievalValidationTest.groovy @@ -36,7 +36,7 @@ class ProductRetrievalValidationTest extends AUTest { def clientHeader = "${Base64.encoder.encodeToString(getCDSClient().getBytes(Charset.defaultCharset()))}" - @Test (priority = 1, groups = "SmokeTest") + @Test (groups = "SmokeTest", priority = 1) void "TC1101001_Retrieve banking products"() { Response response = AURequestBuilder.buildBasicRequestWithoutAuthorisationHeader(AUConstants.X_V_HEADER_PRODUCTS) @@ -67,7 +67,7 @@ class ProductRetrievalValidationTest extends AUTest { Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.LINKS_LAST)) } - @Test (priority = 1, dependsOnMethods = "TC1101001_Retrieve banking products") + @Test (groups = "SmokeTest", priority = 1, dependsOnMethods = "TC1101001_Retrieve banking products") void "TC1101002_Retrieve specific banking product details"() { Response response = AURequestBuilder.buildBasicRequestWithoutAuthorisationHeader(AUConstants.X_V_HEADER_PRODUCTS) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy index e5429e9e0..1da9d5a4f 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/cdr_arrangement/ConcurrentConsentTest.groovy @@ -125,7 +125,7 @@ class ConcurrentConsentTest extends AUTest { Assert.assertEquals(secondAccountsResponse.statusCode(), AUConstants.STATUS_CODE_403) } - @Test + @Test (groups = "SmokeTest") void "TC0902001_Revoke consent using cdr management endpoint"() { List sharingScope = [ AUAccountScope.BANK_ACCOUNT_BASIC_READ ] diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy index 858e35ed6..4beec2193 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationCreateTest.groovy @@ -43,7 +43,7 @@ class DynamicClientRegistrationCreateTest extends AUTest{ AUJWTGenerator generator = new AUJWTGenerator() String clientId, softwareId - @BeforeClass + @BeforeClass (alwaysRun = true) void "Delete Application if exists"() { deleteApplicationIfExists(auConfiguration.getAppInfoClientID()) softwareId = "SP1" @@ -57,7 +57,7 @@ class DynamicClientRegistrationCreateTest extends AUTest{ Assert.assertNotNull(accessToken) } - @Test(priority = 1) + @Test(groups = "SmokeTest", priority = 1) void "TC0101008_Verify Dynamic client registration test"(ITestContext context){ jtiVal = String.valueOf(System.currentTimeMillis()) @@ -636,7 +636,7 @@ class DynamicClientRegistrationCreateTest extends AUTest{ AUConstants.ERROR_WITHOUT_IDTOKEN_SINGED_ALG) } - @Test (priority = 2, groups = "SmokeTest") + @Test (priority = 2) void "CDS-476_Create application without ID_Token Response Type and verify id_token encryption not Mandatory"() { deleteApplicationIfExists(auConfiguration.getAppInfoClientID()) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy index fbd488e19..c9c4a204c 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/clientRegistration/DynamicClientRegistrationRetrieveTest.groovy @@ -33,7 +33,7 @@ import org.testng.ITestContext class DynamicClientRegistrationRetrieveTest extends AUTest{ @SuppressWarnings('GroovyAccessibility') - @Test + @Test (groups = "SmokeTest") void "TC0101018_Retrieve Application"(ITestContext context) { AURegistrationRequestBuilder registrationRequestBuilder = new AURegistrationRequestBuilder() @@ -49,7 +49,7 @@ class DynamicClientRegistrationRetrieveTest extends AUTest{ AUTestUtil.writeToConfigFile(clientId) } - @Test(priority = 1, dependsOnMethods = "TC0101018_Retrieve Application") + @Test(groups = "SmokeTest", priority = 1, dependsOnMethods = "TC0101018_Retrieve Application") void "TC0101009_Get access token"() { accessToken = getApplicationAccessToken(clientId) @@ -68,7 +68,7 @@ class DynamicClientRegistrationRetrieveTest extends AUTest{ Assert.assertEquals(registrationResponse.statusCode(), AUConstants.STATUS_CODE_401) } - @Test(priority = 2, dependsOnMethods = "TC0101009_Get access token") + @Test(groups = "SmokeTest", priority = 2, dependsOnMethods = "TC0101009_Get access token") void "TC0102002_Get registration details"() { def registrationResponse = AURegistrationRequestBuilder.buildBasicRequest(accessToken) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy index 256386ed9..44647d58d 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tokenEndpoint/AccessTokenTest.groovy @@ -201,7 +201,7 @@ class AccessTokenTest extends AUTest { Assert.assertEquals(userAccessToken.toJSONObject().get("scope"),ACCOUNTS_BASIC_ACCOUNT_DETAIL_OPENID_SCOPE_LIST) } - @Test + @Test (groups = "SmokeTest") void "CDS-705_Verify introspection response not returning username field"() { // Generating a new authorisation code @@ -227,7 +227,7 @@ class AccessTokenTest extends AUTest { Assert.assertNull(introspectResponse.jsonPath().get("username")) } - @Test (dependsOnMethods = "CDS-705_Verify introspection response not returning username field") + @Test (groups = "SmokeTest", dependsOnMethods = "CDS-705_Verify introspection response not returning username field") void "CDS-718_Send introspection call for user access token"() { def introspectResponse = AURequestBuilder.buildIntrospectionRequest(user_AccessToken, @@ -237,7 +237,7 @@ class AccessTokenTest extends AUTest { Assert.assertTrue(introspectResponse.jsonPath().get("active").equals(false)) } - @Test (dependsOnMethods = "CDS-705_Verify introspection response not returning username field") + @Test (groups = "SmokeTest", dependsOnMethods = "CDS-705_Verify introspection response not returning username field") void "CDS-718_Send introspection call for id_token"() { def introspectResponse = AURequestBuilder.buildIntrospectionRequest(idToken, @@ -247,7 +247,7 @@ class AccessTokenTest extends AUTest { Assert.assertTrue(introspectResponse.jsonPath().get("active").equals(false)) } - @Test(dependsOnMethods = "CDS-705_Verify introspection response not returning username field") + @Test(groups = "SmokeTest", dependsOnMethods = "CDS-705_Verify introspection response not returning username field") void "CDS-1023_Verify introspection request return cdr_arrangement_id"() { def response = AURequestBuilder.buildIntrospectionRequest(refreshToken, @@ -295,7 +295,7 @@ class AccessTokenTest extends AUTest { Assert.assertEquals(revokeResponse.statusCode(), AUConstants.STATUS_CODE_200) } - @Test + @Test (groups = "SmokeTest") void "CDS-1053_Token Request with client id param in the request body similar to sub value"() { doConsentAuthorisation( auConfiguration.getAppInfoClientID()) @@ -308,7 +308,7 @@ class AccessTokenTest extends AUTest { Assert.assertNotNull(user_AccessToken) } - @Test (dependsOnMethods = "CDS-1053_Token Request with client id param in the request body similar to sub value") + @Test (groups = "SmokeTest", dependsOnMethods = "CDS-1053_Token Request with client id param in the request body similar to sub value") void "CDS-1057_Token introspection Request with client id param in the request body similar to sub value"() { def introspectResponseSecondToken = AURequestBuilder.buildIntrospectionRequest(refreshToken, @@ -318,7 +318,7 @@ class AccessTokenTest extends AUTest { Assert.assertTrue(introspectResponseSecondToken.jsonPath().get("active").toString().contains("true")) } - @Test (dependsOnMethods = "CDS-1057_Token introspection Request with client id param in the request body similar to sub value") + @Test (groups = "SmokeTest", dependsOnMethods = "CDS-1057_Token introspection Request with client id param in the request body similar to sub value") void "CDS-1056_Token Revocation Request with client id param in the request body similar to sub value"() { // Revoke access Token diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy index 95b63da8d..b920f3f76 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/integration/test/tpponboarding/CommonTppOnboardingStep.groovy @@ -37,12 +37,12 @@ class CommonTppOnboardingStep extends AUTest{ AUJWTGenerator generator = new AUJWTGenerator() String clientId - @BeforeClass + @BeforeClass (alwaysRun = true) void "Delete Application if exists"() { deleteApplicationIfExists() } - @Test + @Test (groups = "SmokeTest") void "Tpp Onboarding Step"(ITestContext context){ jtiVal = String.valueOf(System.currentTimeMillis()) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy index f6592ae2e..556df7fac 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/bnr/ConsentAuthFlowValidationTests.groovy @@ -237,7 +237,7 @@ class ConsentAuthFlowValidationTests extends AUTest{ Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) } - @Test + @Test (groups = "SmokeTest") void "CDS-588_Verify a Consent cancellation flow after Business Account selection"() { //Get Authorisation URL @@ -281,7 +281,7 @@ class ConsentAuthFlowValidationTests extends AUTest{ Assert.assertEquals(auAuthorisationBuilder.state.toString(), stateParam) } - @Test (priority = 1) + @Test (groups = "SmokeTest", priority = 1) void "CDS-540_Consent Authorisation after updating nominated representatives permission from view to authorise"() { auConfiguration.setPsuNumber(3) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy index b659216eb..c86087594 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFormPostJwtValidationTests.groovy @@ -37,7 +37,7 @@ class JarmResponseModeFormPostJwtValidationTests extends AUTest { HashMap mapPayload JWTClaimsSet jwtPayload - @Test + @Test (groups = "SmokeTest") void "CDS-582_Verify response_mode form_post jwt navigates to Authorization Flow"() { def clientId = auConfiguration.getAppInfoClientID() diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy index 744460d4a..354450dd0 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeFragmentJwtValidationTests.groovy @@ -37,7 +37,7 @@ class JarmResponseModeFragmentJwtValidationTests extends AUTest { HashMap mapPayload JWTClaimsSet jwtPayload - @Test (priority = 1) + @Test (groups = "SmokeTest", priority = 1) void "CDS-569_Verify response_mode fragment jwt navigates to Authorization Flow"() { response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy index 1cff6a34b..91e87cc25 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeJwtValidationTests.groovy @@ -37,7 +37,7 @@ class JarmResponseModeJwtValidationTests extends AUTest{ String responseJwt JWTClaimsSet jwtPayload - @Test + @Test (groups = "SmokeTest") void "CDS-577_Verify authorisation flow with response method jwt and response type code"() { doConsentAuthorisation(ResponseMode.JWT, ResponseType.CODE, auConfiguration.getAppInfoClientID()) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy index 719ecceb6..3fc9e27db 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/jarm/JarmResponseModeQueryJwtValidationTests.groovy @@ -36,7 +36,7 @@ class JarmResponseModeQueryJwtValidationTests extends AUTest { String responseJwt JWTClaimsSet jwtPayload - @Test + @Test (groups = "SmokeTest") void "CDS-587_Verify in query jwt response mode if response_type = code"() { response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy index f32dbbbd4..05f18e4d1 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/par/PushedAuthorisationFlowTest.groovy @@ -46,7 +46,7 @@ class PushedAuthorisationFlowTest extends AUTest { AUJWTGenerator generator = new AUJWTGenerator() def refreshToken - @Test + @Test (groups = "SmokeTest") void "TC0205001_Data Recipients Initiate authorisation request using PAR"() { def response = auAuthorisationBuilder.doPushAuthorisationRequest(scopes, AUConstants.DEFAULT_SHARING_DURATION, @@ -58,14 +58,14 @@ class PushedAuthorisationFlowTest extends AUTest { Assert.assertNotNull(AUTestUtil.parseResponseBody(response, AUConstants.RESPONSE_EXPIRES_IN)) } - @Test(dependsOnMethods = "TC0205001_Data Recipients Initiate authorisation request using PAR") + @Test(groups = "SmokeTest", dependsOnMethods = "TC0205001_Data Recipients Initiate authorisation request using PAR") void "TC0205002_Initiate consent authorisation flow with pushed authorisation request uri"() { doConsentAuthorisationViaRequestUri(scopes, requestUri.toURI()) Assert.assertNotNull(authorisationCode) } - @Test(dependsOnMethods = "TC0205002_Initiate consent authorisation flow with pushed authorisation request uri") + @Test(groups = "SmokeTest", dependsOnMethods = "TC0205002_Initiate consent authorisation flow with pushed authorisation request uri") void "TC0203013_Generate User access token by code generated from PAR model"() { AccessTokenResponse userAccessToken = AURequestBuilder.getUserToken(authorisationCode, diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy index 9d357d519..508ab4f6e 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserConsentFlowTest.groovy @@ -45,7 +45,7 @@ class CeasingSecondaryUserConsentFlowTest extends AUTest { Response response List legalEntityList - @BeforeClass + @BeforeClass (alwaysRun = true) void "Pre Execution Step"() { auConfiguration.setPsuNumber(1) @@ -71,7 +71,7 @@ class CeasingSecondaryUserConsentFlowTest extends AUTest { legalEntityId = registrationResponse.jsonPath().get(AUConstants.DCR_CLAIM_LEGAL_ENTITY_ID) } - @Test + @Test (groups = "SmokeTest") void "CDS-643_Verify account is listed under unavailable accounts once the legal entity is restricted by account owner"() { //Block the sharing status diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy index 0fa42ec80..be620feea 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/CeasingSecondaryUserManagementTest.groovy @@ -39,7 +39,7 @@ class CeasingSecondaryUserManagementTest extends AUTest { Response response List legalEntityList - @BeforeClass + @BeforeClass (alwaysRun = true) void "Pre Execution Step"() { auConfiguration.setPsuNumber(4) @@ -71,7 +71,7 @@ class CeasingSecondaryUserManagementTest extends AUTest { altLegalEntityId = AUConstants.ALT_LEGAL_ENTITY } - @Test (priority = 1) + @Test (groups = "SmokeTest", priority = 1) void "CDS-631_Block the sharing status for a legal entity"() { response = updateLegalEntityStatus(clientHeader, accountID, userId, legalEntityId, AUConstants.BLOCK_ENTITY) diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy index 56ad7c853..32f3d0177 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/groovy/org/wso2/cds/keymanager/test/secondaryUser/SecondaryUserAmendmentFlow.groovy @@ -111,7 +111,7 @@ class SecondaryUserAmendmentFlow extends AUTest { .execute() } - @Test + @Test (groups = "SmokeTest") void "CDS-427_Verify Consent Amendment if consumer nominated as secondary user for account by providing secondary user instruction"() { //Consent Authorisation by selecting individual accounts diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/resources/testng.xml b/integration-test-suite/cds-toolkit-integration-test/src/test/resources/testng.xml index 32af9e64d..c2d40de96 100644 --- a/integration-test-suite/cds-toolkit-integration-test/src/test/resources/testng.xml +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/resources/testng.xml @@ -21,126 +21,152 @@ - - - - - + + + + + - + - - - - - + + + + + - - + + - - + + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - + + + + + - + - - - - + + + + - - - + + + - - + + - - - - - + + + + + - - - - + + + + - + - - + + - - + + diff --git a/integration-test-suite/cds-toolkit-integration-test/src/test/resources/testngSmokeTest.xml b/integration-test-suite/cds-toolkit-integration-test/src/test/resources/testngSmokeTest.xml new file mode 100644 index 000000000..4436581da --- /dev/null +++ b/integration-test-suite/cds-toolkit-integration-test/src/test/resources/testngSmokeTest.xml @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d109bdaec028898f683d16a8f101cd6cf0064dc8 Mon Sep 17 00:00:00 2001 From: Anju Chamantha Date: Wed, 4 Dec 2024 08:36:28 +0530 Subject: [PATCH 10/20] Fix error while deleting non-existing dropins dir --- toolkits/ob-apim/pom.xml | 2 +- toolkits/ob-is/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolkits/ob-apim/pom.xml b/toolkits/ob-apim/pom.xml index 9b3772ed5..41532346e 100644 --- a/toolkits/ob-apim/pom.xml +++ b/toolkits/ob-apim/pom.xml @@ -90,7 +90,7 @@ regex="org.wso2.openbanking.cds.gateway-(\d.*?)\.jar$"/> - + diff --git a/toolkits/ob-is/pom.xml b/toolkits/ob-is/pom.xml index cf942a7da..30fa18574 100644 --- a/toolkits/ob-is/pom.xml +++ b/toolkits/ob-is/pom.xml @@ -67,7 +67,7 @@ package - + From d514bb1e70529e71edaebe8fc094172674fabaf1 Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Wed, 4 Dec 2024 10:01:16 +0530 Subject: [PATCH 11/20] Updated links in README.md --- integration-test-suite/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-test-suite/README.md b/integration-test-suite/README.md index 7fcf44342..e915eea0f 100644 --- a/integration-test-suite/README.md +++ b/integration-test-suite/README.md @@ -6,8 +6,8 @@ This test suite covers all the functional scenarios and use cases of CDS Toolkit 1. Clone the master branch of the [financial-open-banking](https://github.com/wso2-enterprise/financial-open-banking/tree/master) repository. 2. Goto "integration-test-suite" and build the following modules (These are the base modules of open banking test framework); - 1. [bfsi-test-framework](https://github.com/wso2-enterprise/financial-open-banking/tree/master/integration-test-suite/bfsi-test-framework) - 2. [open-banking-test-framework](https://github.com/wso2-enterprise/financial-open-banking/tree/master/integration-test-suite/open-banking-test-framework) + 1. [bfsi-test-framework](https://github.com/wso2/financial-services-accelerator/tree/main/integration-test-framework/bfsi-test-framework) + 2. [open-banking-test-framework](https://github.com/wso2/financial-services-accelerator/tree/main/integration-test-framework/open-banking-test-framework) Command : `mvn clean install` From 52b62c8f847594340e644c6b156a6c13132babd5 Mon Sep 17 00:00:00 2001 From: malshanisenarathne Date: Wed, 4 Dec 2024 10:10:19 +0530 Subject: [PATCH 12/20] Updated links in README.md --- integration-test-suite/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/integration-test-suite/README.md b/integration-test-suite/README.md index e915eea0f..0780d4e4c 100644 --- a/integration-test-suite/README.md +++ b/integration-test-suite/README.md @@ -5,9 +5,8 @@ This test suite covers all the functional scenarios and use cases of CDS Toolkit ### How to run Integration Test Suite (integration-test-suite) 1. Clone the master branch of the [financial-open-banking](https://github.com/wso2-enterprise/financial-open-banking/tree/master) repository. -2. Goto "integration-test-suite" and build the following modules (These are the base modules of open banking test framework); - 1. [bfsi-test-framework](https://github.com/wso2/financial-services-accelerator/tree/main/integration-test-framework/bfsi-test-framework) - 2. [open-banking-test-framework](https://github.com/wso2/financial-services-accelerator/tree/main/integration-test-framework/open-banking-test-framework) +2. Goto "integration-test-suite" and build the module (These are the base modules of open banking test framework); + 1. [integration-test-framework](https://github.com/wso2/financial-services-accelerator/tree/main/integration-test-framework) Command : `mvn clean install` From 2914f790dcdedd2668ede47bdfcdba12d1bacc83 Mon Sep 17 00:00:00 2001 From: aka4rKO Date: Wed, 4 Dec 2024 15:14:13 +0530 Subject: [PATCH 13/20] fix for recipientCount not updating issue --- .../impl/persist/CDSConsentPersistStep.java | 9 ++++++++- .../event/executor/CDSConsentEventExecutor.java | 13 ++++++++++++- .../CDSCustomerRecipientMetricsApp.siddhi | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/authorize/impl/persist/CDSConsentPersistStep.java b/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/authorize/impl/persist/CDSConsentPersistStep.java index 51c5cc59a..1c4d1b762 100644 --- a/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/authorize/impl/persist/CDSConsentPersistStep.java +++ b/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/authorize/impl/persist/CDSConsentPersistStep.java @@ -259,7 +259,14 @@ protected DetailedConsentResource createConsent(ConsentCoreServiceImpl consentCo ConsentResource requestedConsent, ConsentData consentData) throws ConsentManagementException { - return consentCoreService.createAuthorizableConsent(requestedConsent, consentData.getUserId(), + String userId = consentData.getUserId(); + + // Adding a consent attribute to identify the primary user of the consent + Map consentAttributes = requestedConsent.getConsentAttributes(); + consentAttributes.put(CDSConsentExtensionConstants.AUTH_RESOURCE_TYPE_PRIMARY, userId); + requestedConsent.setConsentAttributes(consentAttributes); + + return consentCoreService.createAuthorizableConsent(requestedConsent, userId, CDSConsentExtensionConstants.CREATED_STATUS, CDSConsentExtensionConstants.AUTH_RESOURCE_TYPE_PRIMARY, true); } diff --git a/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutor.java b/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutor.java index 6532aeb3a..585740045 100644 --- a/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutor.java +++ b/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutor.java @@ -132,10 +132,19 @@ public void processEvent(OBEvent obEvent) { log.debug("Publishing consent data for metrics."); HashMap consentData = new HashMap<>(); consentData.put(CONSENT_ID_KEY, eventData.get(CONSENT_ID)); - consentData.put(USER_ID_KEY, eventData.get(USER_ID)); consentData.put(CLIENT_ID_KEY, eventData.get(CLIENT_ID)); consentData.put(STATUS_KEY, obEvent.getEventType()); + String userId = null; + if (consentResource != null) { + userId = consentResource.getConsentAttributes() + .get(CDSConsentExtensionConstants.AUTH_RESOURCE_TYPE_PRIMARY); + } + + if (StringUtils.isBlank(userId)) { + userId = (String) eventData.get(USER_ID); + } + long expiryTime; if (AUTHORIZED_STATE.equalsIgnoreCase(obEvent.getEventType())) { if (consentResource != null) { @@ -148,6 +157,8 @@ public void processEvent(OBEvent obEvent) { } else { expiryTime = 0; } + + consentData.put(USER_ID_KEY, userId); consentData.put(EXPIRY_TIME_KEY, expiryTime); dataPublishingService.publishConsentData(consentData); } diff --git a/toolkits/ob-bi/carbon-home/deployment/siddhi-files/CDSCustomerRecipientMetricsApp.siddhi b/toolkits/ob-bi/carbon-home/deployment/siddhi-files/CDSCustomerRecipientMetricsApp.siddhi index 2e8209ac7..9ef3fa21b 100644 --- a/toolkits/ob-bi/carbon-home/deployment/siddhi-files/CDSCustomerRecipientMetricsApp.siddhi +++ b/toolkits/ob-bi/carbon-home/deployment/siddhi-files/CDSCustomerRecipientMetricsApp.siddhi @@ -93,7 +93,7 @@ select CDR_ARRANGEMENT_ID as CONSENT_ID, CLIENT_ID, USER_ID insert into CountableConsentAuthStream; -- Filter revoked authorizations that should be counted -from ConsentInputStream[STATUS == "Revoked"]#window.unique:first(CDR_ARRANGEMENT_ID) as I join CONSENT_RAW_DATA as T +from ConsentInputStream[str:equalsIgnoreCase(STATUS, "Revoked")]#window.unique:first(CDR_ARRANGEMENT_ID) as I join CONSENT_RAW_DATA as T on I.CDR_ARRANGEMENT_ID == T.CONSENT_ID select I.CDR_ARRANGEMENT_ID as CONSENT_ID, T.CLIENT_ID as CLIENT_ID, T.USER_ID as USER_ID, T.STATUS as CURRENT_STATUS having CURRENT_STATUS == "authorized" From f83009340e9caa2929ec13a5faf9858ae7afce7b Mon Sep 17 00:00:00 2001 From: aka4rKO Date: Wed, 4 Dec 2024 17:20:48 +0530 Subject: [PATCH 14/20] changed implementation to retrieve primary user from auth resources --- .../impl/persist/CDSConsentPersistStep.java | 9 +-- .../executor/CDSConsentEventExecutor.java | 78 +++++++++++++------ .../CDSConsentEventExecutorTests.java | 18 ++++- 3 files changed, 73 insertions(+), 32 deletions(-) diff --git a/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/authorize/impl/persist/CDSConsentPersistStep.java b/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/authorize/impl/persist/CDSConsentPersistStep.java index 1c4d1b762..51c5cc59a 100644 --- a/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/authorize/impl/persist/CDSConsentPersistStep.java +++ b/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/authorize/impl/persist/CDSConsentPersistStep.java @@ -259,14 +259,7 @@ protected DetailedConsentResource createConsent(ConsentCoreServiceImpl consentCo ConsentResource requestedConsent, ConsentData consentData) throws ConsentManagementException { - String userId = consentData.getUserId(); - - // Adding a consent attribute to identify the primary user of the consent - Map consentAttributes = requestedConsent.getConsentAttributes(); - consentAttributes.put(CDSConsentExtensionConstants.AUTH_RESOURCE_TYPE_PRIMARY, userId); - requestedConsent.setConsentAttributes(consentAttributes); - - return consentCoreService.createAuthorizableConsent(requestedConsent, userId, + return consentCoreService.createAuthorizableConsent(requestedConsent, consentData.getUserId(), CDSConsentExtensionConstants.CREATED_STATUS, CDSConsentExtensionConstants.AUTH_RESOURCE_TYPE_PRIMARY, true); } diff --git a/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutor.java b/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutor.java index 585740045..8edb81489 100644 --- a/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutor.java +++ b/components/org.wso2.openbanking.cds.consent.extensions/src/main/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutor.java @@ -20,11 +20,14 @@ import com.wso2.openbanking.accelerator.common.event.executor.OBEventExecutor; import com.wso2.openbanking.accelerator.common.event.executor.model.OBEvent; +import com.wso2.openbanking.accelerator.common.exception.ConsentManagementException; import com.wso2.openbanking.accelerator.common.exception.OpenBankingException; import com.wso2.openbanking.accelerator.common.util.Generated; +import com.wso2.openbanking.accelerator.consent.mgt.dao.models.AuthorizationResource; import com.wso2.openbanking.accelerator.consent.mgt.dao.models.ConsentResource; import com.wso2.openbanking.accelerator.consent.mgt.dao.models.DetailedConsentResource; import com.wso2.openbanking.accelerator.consent.mgt.service.constants.ConsentCoreServiceConstants; +import com.wso2.openbanking.accelerator.consent.mgt.service.impl.ConsentCoreServiceImpl; import com.wso2.openbanking.accelerator.identity.util.HTTPClientUtils; import com.wso2.openbanking.accelerator.identity.util.IdentityCommonHelper; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -71,6 +74,7 @@ public class CDSConsentEventExecutor implements OBEventExecutor { private static final Log log = LogFactory.getLog(CDSConsentEventExecutor.class); private CDSDataPublishingService dataPublishingService = CDSDataPublishingService.getCDSDataPublishingService(); + private ConsentCoreServiceImpl consentCoreService = new ConsentCoreServiceImpl(); private static final String DATA_RECIPIENT_CDR_ARRANGEMENT_REVOCATION_PATH = "/arrangements/revoke"; private static final String REVOKED_STATE = "revoked"; private static final String EXPIRED_STATE = "expired"; @@ -130,35 +134,27 @@ public void processEvent(OBEvent obEvent) { AUTHORIZED_STATE.equalsIgnoreCase(obEvent.getEventType())) { log.debug("Publishing consent data for metrics."); - HashMap consentData = new HashMap<>(); - consentData.put(CONSENT_ID_KEY, eventData.get(CONSENT_ID)); - consentData.put(CLIENT_ID_KEY, eventData.get(CLIENT_ID)); - consentData.put(STATUS_KEY, obEvent.getEventType()); - String userId = null; - if (consentResource != null) { - userId = consentResource.getConsentAttributes() - .get(CDSConsentExtensionConstants.AUTH_RESOURCE_TYPE_PRIMARY); + String consentId = (String) eventData.get(CONSENT_ID); + String primaryUserId; + try { + primaryUserId = getPrimaryUserForConsent(detailedConsentResource, consentId); + } catch (ConsentManagementException e) { + log.error("Error while trying to retrieve consent data", e); + return; } - if (StringUtils.isBlank(userId)) { - userId = (String) eventData.get(USER_ID); + if (StringUtils.isBlank(primaryUserId)) { + return; } - long expiryTime; - if (AUTHORIZED_STATE.equalsIgnoreCase(obEvent.getEventType())) { - if (consentResource != null) { - expiryTime = consentResource.getValidityPeriod(); - } else if (detailedConsentResource != null) { - expiryTime = detailedConsentResource.getValidityPeriod(); - } else { - expiryTime = OffsetDateTime.now(ZoneOffset.UTC).toEpochSecond(); - } - } else { - expiryTime = 0; - } + long expiryTime = getExpiryTime(obEvent, consentResource, detailedConsentResource); - consentData.put(USER_ID_KEY, userId); + HashMap consentData = new HashMap<>(); + consentData.put(CONSENT_ID_KEY, consentId); + consentData.put(USER_ID_KEY, primaryUserId); + consentData.put(CLIENT_ID_KEY, eventData.get(CLIENT_ID)); + consentData.put(STATUS_KEY, obEvent.getEventType()); consentData.put(EXPIRY_TIME_KEY, expiryTime); dataPublishingService.publishConsentData(consentData); } @@ -207,6 +203,42 @@ public void processEvent(OBEvent obEvent) { } + private String getPrimaryUserForConsent(DetailedConsentResource detailedConsentResource, String consentId) + throws ConsentManagementException { + + String primaryUser = null; + if (detailedConsentResource == null) { + detailedConsentResource = this.consentCoreService.getDetailedConsent(consentId); + } + + ArrayList authorizationResources = detailedConsentResource.getAuthorizationResources(); + for (AuthorizationResource authorizationResource : authorizationResources) { + if (CDSConsentExtensionConstants.AUTH_RESOURCE_TYPE_PRIMARY + .equalsIgnoreCase(authorizationResource.getAuthorizationType())) { + primaryUser = authorizationResource.getUserID(); + } + } + return primaryUser; + } + + private static long getExpiryTime(OBEvent obEvent, ConsentResource consentResource, + DetailedConsentResource detailedConsentResource) { + + long expiryTime; + if (AUTHORIZED_STATE.equalsIgnoreCase(obEvent.getEventType())) { + if (consentResource != null) { + expiryTime = consentResource.getValidityPeriod(); + } else if (detailedConsentResource != null) { + expiryTime = detailedConsentResource.getValidityPeriod(); + } else { + expiryTime = OffsetDateTime.now(ZoneOffset.UTC).toEpochSecond(); + } + } else { + expiryTime = 0; + } + return expiryTime; + } + /** * CDS Data Holder initiated CDR Arrangement Revocation: * to notify the Data Recipient of the consent withdrawn by a Customer via the Data Holder’s consent dashboard. diff --git a/components/org.wso2.openbanking.cds.consent.extensions/src/test/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutorTests.java b/components/org.wso2.openbanking.cds.consent.extensions/src/test/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutorTests.java index a70fb0386..911ba6676 100644 --- a/components/org.wso2.openbanking.cds.consent.extensions/src/test/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutorTests.java +++ b/components/org.wso2.openbanking.cds.consent.extensions/src/test/java/org/wso2/openbanking/cds/consent/extensions/event/executor/CDSConsentEventExecutorTests.java @@ -19,7 +19,9 @@ package org.wso2.openbanking.cds.consent.extensions.event.executor; import com.wso2.openbanking.accelerator.common.event.executor.model.OBEvent; +import com.wso2.openbanking.accelerator.common.exception.ConsentManagementException; import com.wso2.openbanking.accelerator.common.exception.OpenBankingException; +import com.wso2.openbanking.accelerator.consent.mgt.dao.models.AuthorizationResource; import com.wso2.openbanking.accelerator.consent.mgt.dao.models.ConsentResource; import com.wso2.openbanking.accelerator.consent.mgt.dao.models.DetailedConsentResource; import com.wso2.openbanking.accelerator.data.publisher.common.util.OBDataPublisherUtil; @@ -41,10 +43,13 @@ import org.testng.annotations.Test; import org.wso2.carbon.base.ServerConfiguration; import org.wso2.openbanking.cds.common.config.OpenBankingCDSConfigParser; +import org.wso2.openbanking.cds.consent.extensions.common.CDSConsentExtensionConstants; import org.wso2.openbanking.cds.identity.utils.CDSIdentityUtil; import java.io.ByteArrayOutputStream; import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -62,17 +67,26 @@ @PowerMockIgnore("jdk.internal.reflect.*") public class CDSConsentEventExecutorTests extends PowerMockTestCase { + public static final String USER_ID_PRIMARY = "test-primary-user-id"; + public static final String AUTH_ID_PRIMARY = "test-primary-auth-id"; + private static ByteArrayOutputStream outContent; private static Logger logger = null; private static PrintStream printStream; + private AuthorizationResource authResource; @BeforeClass - public void beforeTests() { + public void beforeTests() throws ConsentManagementException { outContent = new ByteArrayOutputStream(); printStream = new PrintStream(outContent); System.setOut(printStream); logger = LogManager.getLogger(CDSConsentEventExecutorTests.class); + + authResource = new AuthorizationResource(); + authResource.setAuthorizationID(AUTH_ID_PRIMARY); + authResource.setUserID(USER_ID_PRIMARY); + authResource.setAuthorizationType(CDSConsentExtensionConstants.AUTH_RESOURCE_TYPE_PRIMARY); } @Test @@ -110,6 +124,7 @@ public void testProcessEventSuccess() throws Exception { DetailedConsentResource detailedConsentResource = new DetailedConsentResource(); detailedConsentResource.setConsentAttributes(consentAttributes); + detailedConsentResource.setAuthorizationResources(new ArrayList<>(Arrays.asList(authResource))); consentDataMap.put("ConsentResource", consentResource); consentDataMap.put("DetailedConsentResource", detailedConsentResource); @@ -160,6 +175,7 @@ public void testProcessEventFailure() throws Exception { DetailedConsentResource detailedConsentResource = new DetailedConsentResource(); detailedConsentResource.setConsentAttributes(consentAttributes); + detailedConsentResource.setAuthorizationResources(new ArrayList<>(Arrays.asList(authResource))); consentDataMap.put("ConsentResource", consentResource); consentDataMap.put("DetailedConsentResource", detailedConsentResource); From b42a67ba6f1f7339ddbd29fede480484774be80e Mon Sep 17 00:00:00 2001 From: aka4rKO Date: Wed, 4 Dec 2024 19:30:03 +0530 Subject: [PATCH 15/20] prepare for release 1.0.6 --- components/org.wso2.openbanking.cds.common/pom.xml | 2 +- .../org.wso2.openbanking.cds.consent.extensions/pom.xml | 2 +- components/org.wso2.openbanking.cds.demo.backend/pom.xml | 2 +- components/org.wso2.openbanking.cds.gateway/pom.xml | 2 +- components/org.wso2.openbanking.cds.identity/pom.xml | 2 +- components/org.wso2.openbanking.cds.metrics/pom.xml | 2 +- components/pom.xml | 2 +- integration-test-suite/cds-toolkit-integration-test/pom.xml | 4 ++-- integration-test-suite/cds-toolkit-test-framework/pom.xml | 4 ++-- integration-test-suite/pom.xml | 2 +- .../identity-outbound-auth-sms-otp/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml | 2 +- .../org.wso2.openbanking.cds.metrics.endpoint/pom.xml | 2 +- internal-apis/pom.xml | 2 +- pom.xml | 2 +- react-apps/pom.xml | 2 +- toolkits/ob-apim/pom.xml | 2 +- toolkits/ob-bi/pom.xml | 2 +- toolkits/ob-is/pom.xml | 2 +- toolkits/pom.xml | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/components/org.wso2.openbanking.cds.common/pom.xml b/components/org.wso2.openbanking.cds.common/pom.xml index f7c9d35db..97d0c393c 100644 --- a/components/org.wso2.openbanking.cds.common/pom.xml +++ b/components/org.wso2.openbanking.cds.common/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.consent.extensions/pom.xml b/components/org.wso2.openbanking.cds.consent.extensions/pom.xml index 9d80fa5ef..6e19c3656 100644 --- a/components/org.wso2.openbanking.cds.consent.extensions/pom.xml +++ b/components/org.wso2.openbanking.cds.consent.extensions/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.demo.backend/pom.xml b/components/org.wso2.openbanking.cds.demo.backend/pom.xml index e9b34553e..7576ab50c 100644 --- a/components/org.wso2.openbanking.cds.demo.backend/pom.xml +++ b/components/org.wso2.openbanking.cds.demo.backend/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.gateway/pom.xml b/components/org.wso2.openbanking.cds.gateway/pom.xml index b21863865..054f432ce 100644 --- a/components/org.wso2.openbanking.cds.gateway/pom.xml +++ b/components/org.wso2.openbanking.cds.gateway/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.identity/pom.xml b/components/org.wso2.openbanking.cds.identity/pom.xml index 13434e14d..cb865c22a 100644 --- a/components/org.wso2.openbanking.cds.identity/pom.xml +++ b/components/org.wso2.openbanking.cds.identity/pom.xml @@ -24,7 +24,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.metrics/pom.xml b/components/org.wso2.openbanking.cds.metrics/pom.xml index c33a379fa..249a969f6 100644 --- a/components/org.wso2.openbanking.cds.metrics/pom.xml +++ b/components/org.wso2.openbanking.cds.metrics/pom.xml @@ -24,7 +24,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml 4.0.0 diff --git a/components/pom.xml b/components/pom.xml index 8187f07de..748a6f8e8 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml diff --git a/integration-test-suite/cds-toolkit-integration-test/pom.xml b/integration-test-suite/cds-toolkit-integration-test/pom.xml index 5d22c707f..f9f6c85f3 100644 --- a/integration-test-suite/cds-toolkit-integration-test/pom.xml +++ b/integration-test-suite/cds-toolkit-integration-test/pom.xml @@ -22,13 +22,13 @@ 4.0.0 cds-toolkit-integration-test - 1.0.6-SNAPSHOT + 1.0.6 jar org.wso2.openbanking integration-test-suite - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml diff --git a/integration-test-suite/cds-toolkit-test-framework/pom.xml b/integration-test-suite/cds-toolkit-test-framework/pom.xml index 3488eff7b..bdcbb4a88 100644 --- a/integration-test-suite/cds-toolkit-test-framework/pom.xml +++ b/integration-test-suite/cds-toolkit-test-framework/pom.xml @@ -21,13 +21,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 cds-toolkit-test-framework - 1.0.6-SNAPSHOT + 1.0.6 jar org.wso2.openbanking integration-test-suite - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml diff --git a/integration-test-suite/pom.xml b/integration-test-suite/pom.xml index 8d7f03541..f2141b60b 100644 --- a/integration-test-suite/pom.xml +++ b/integration-test-suite/pom.xml @@ -22,7 +22,7 @@ 4.0.0 org.wso2.openbanking integration-test-suite - 1.0.6-SNAPSHOT + 1.0.6 pom diff --git a/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml b/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml index c8d8db264..7240cec13 100644 --- a/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml +++ b/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml @@ -143,7 +143,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.common - 1.0.6-SNAPSHOT + 1.0.6 org.json.wso2 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml index 53ec93492..061b58854 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking internal-apis - 1.0.6-SNAPSHOT + 1.0.6 ../../pom.xml diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml index 59b7a2b3a..640bdbc02 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml @@ -23,7 +23,7 @@ internal-apis org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../../pom.xml 4.0.0 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml index ba67bc935..ad652b0cc 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../../../pom.xml 4.0.0 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml index 0248893ae..06daae9d3 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../../../pom.xml 4.0.0 diff --git a/internal-apis/pom.xml b/internal-apis/pom.xml index 74dd9b2eb..2f754e0b4 100644 --- a/internal-apis/pom.xml +++ b/internal-apis/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index 4529e9f41..2292228c3 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking reference-implementation-consumerdatastandards-au pom - 1.0.6-SNAPSHOT + 1.0.6 org.wso2 wso2 diff --git a/react-apps/pom.xml b/react-apps/pom.xml index 5d6bd85ac..b9114c1bb 100644 --- a/react-apps/pom.xml +++ b/react-apps/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml diff --git a/toolkits/ob-apim/pom.xml b/toolkits/ob-apim/pom.xml index 8e3671f8f..697a8eece 100644 --- a/toolkits/ob-apim/pom.xml +++ b/toolkits/ob-apim/pom.xml @@ -25,7 +25,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml diff --git a/toolkits/ob-bi/pom.xml b/toolkits/ob-bi/pom.xml index f000a10b0..6dd075405 100644 --- a/toolkits/ob-bi/pom.xml +++ b/toolkits/ob-bi/pom.xml @@ -25,7 +25,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml diff --git a/toolkits/ob-is/pom.xml b/toolkits/ob-is/pom.xml index 3dec95278..7c52751af 100644 --- a/toolkits/ob-is/pom.xml +++ b/toolkits/ob-is/pom.xml @@ -24,7 +24,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml diff --git a/toolkits/pom.xml b/toolkits/pom.xml index 8aefb059f..38292b8b7 100644 --- a/toolkits/pom.xml +++ b/toolkits/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking reference-implementation-consumerdatastandards-au - 1.0.6-SNAPSHOT + 1.0.6 ../pom.xml From 077561f5ae481cd4607ad798521e0cc95735489d Mon Sep 17 00:00:00 2001 From: aka4rKO Date: Wed, 4 Dec 2024 20:20:39 +0530 Subject: [PATCH 16/20] fix for not displaying name data cluster when profile scope is present --- .../ob-is/repository/resources/wso2is-6.0.0-deployment-cds.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/toolkits/ob-is/repository/resources/wso2is-6.0.0-deployment-cds.toml b/toolkits/ob-is/repository/resources/wso2is-6.0.0-deployment-cds.toml index e6dbb096c..7aa31a959 100644 --- a/toolkits/ob-is/repository/resources/wso2is-6.0.0-deployment-cds.toml +++ b/toolkits/ob-is/repository/resources/wso2is-6.0.0-deployment-cds.toml @@ -168,6 +168,7 @@ skip_db_schema_creation = true [oauth] allowed_scopes = ["OB.*", "profile"] +keep_oidc_scopes_in_consent_url = true [oauth.token_renewal] renew_refresh_token = false From 1f3a3d19baf1ce1385c605b3105676534a855b00 Mon Sep 17 00:00:00 2001 From: Anju Chamantha Date: Fri, 6 Dec 2024 11:50:56 +0530 Subject: [PATCH 17/20] Prepare for the development iteration 1.0.7 --- components/org.wso2.openbanking.cds.common/pom.xml | 2 +- .../org.wso2.openbanking.cds.consent.extensions/pom.xml | 2 +- components/org.wso2.openbanking.cds.demo.backend/pom.xml | 2 +- components/org.wso2.openbanking.cds.gateway/pom.xml | 2 +- components/org.wso2.openbanking.cds.identity/pom.xml | 2 +- components/org.wso2.openbanking.cds.metrics/pom.xml | 2 +- components/pom.xml | 2 +- integration-test-suite/cds-toolkit-integration-test/pom.xml | 4 ++-- integration-test-suite/cds-toolkit-test-framework/pom.xml | 4 ++-- integration-test-suite/pom.xml | 2 +- .../identity-outbound-auth-sms-otp/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml | 2 +- .../org.wso2.openbanking.cds.metrics.endpoint/pom.xml | 2 +- internal-apis/pom.xml | 2 +- pom.xml | 2 +- react-apps/pom.xml | 2 +- toolkits/ob-apim/pom.xml | 2 +- toolkits/ob-bi/pom.xml | 2 +- toolkits/ob-is/pom.xml | 2 +- toolkits/pom.xml | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/components/org.wso2.openbanking.cds.common/pom.xml b/components/org.wso2.openbanking.cds.common/pom.xml index 97d0c393c..3b0f07f1d 100644 --- a/components/org.wso2.openbanking.cds.common/pom.xml +++ b/components/org.wso2.openbanking.cds.common/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.consent.extensions/pom.xml b/components/org.wso2.openbanking.cds.consent.extensions/pom.xml index 6e19c3656..bd6fcba3b 100644 --- a/components/org.wso2.openbanking.cds.consent.extensions/pom.xml +++ b/components/org.wso2.openbanking.cds.consent.extensions/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.demo.backend/pom.xml b/components/org.wso2.openbanking.cds.demo.backend/pom.xml index 7576ab50c..51c79c4ff 100644 --- a/components/org.wso2.openbanking.cds.demo.backend/pom.xml +++ b/components/org.wso2.openbanking.cds.demo.backend/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.gateway/pom.xml b/components/org.wso2.openbanking.cds.gateway/pom.xml index 054f432ce..bf39a8f4b 100644 --- a/components/org.wso2.openbanking.cds.gateway/pom.xml +++ b/components/org.wso2.openbanking.cds.gateway/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.identity/pom.xml b/components/org.wso2.openbanking.cds.identity/pom.xml index cb865c22a..fdc1f94e7 100644 --- a/components/org.wso2.openbanking.cds.identity/pom.xml +++ b/components/org.wso2.openbanking.cds.identity/pom.xml @@ -24,7 +24,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.metrics/pom.xml b/components/org.wso2.openbanking.cds.metrics/pom.xml index 249a969f6..4dc42a5dc 100644 --- a/components/org.wso2.openbanking.cds.metrics/pom.xml +++ b/components/org.wso2.openbanking.cds.metrics/pom.xml @@ -24,7 +24,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/pom.xml b/components/pom.xml index 748a6f8e8..155586361 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml diff --git a/integration-test-suite/cds-toolkit-integration-test/pom.xml b/integration-test-suite/cds-toolkit-integration-test/pom.xml index 8ce566111..4d6377dd7 100644 --- a/integration-test-suite/cds-toolkit-integration-test/pom.xml +++ b/integration-test-suite/cds-toolkit-integration-test/pom.xml @@ -22,13 +22,13 @@ 4.0.0 cds-toolkit-integration-test - 1.0.6 + 1.0.7-SNAPSHOT jar org.wso2.openbanking integration-test-suite - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml diff --git a/integration-test-suite/cds-toolkit-test-framework/pom.xml b/integration-test-suite/cds-toolkit-test-framework/pom.xml index 1bfc1371f..2da25c2db 100644 --- a/integration-test-suite/cds-toolkit-test-framework/pom.xml +++ b/integration-test-suite/cds-toolkit-test-framework/pom.xml @@ -21,13 +21,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 cds-toolkit-test-framework - 1.0.6 + 1.0.7-SNAPSHOT jar org.wso2.openbanking integration-test-suite - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml diff --git a/integration-test-suite/pom.xml b/integration-test-suite/pom.xml index b06b95285..379e40308 100644 --- a/integration-test-suite/pom.xml +++ b/integration-test-suite/pom.xml @@ -22,7 +22,7 @@ 4.0.0 org.wso2.openbanking integration-test-suite - 1.0.6 + 1.0.7-SNAPSHOT pom diff --git a/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml b/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml index 7240cec13..fcc82de07 100644 --- a/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml +++ b/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml @@ -143,7 +143,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.common - 1.0.6 + 1.0.7-SNAPSHOT org.json.wso2 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml index 061b58854..20aab31bc 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking internal-apis - 1.0.6 + 1.0.7-SNAPSHOT ../../pom.xml diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml index 640bdbc02..42ec48fff 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml @@ -23,7 +23,7 @@ internal-apis org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml index ad652b0cc..b3b457bca 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml index 06daae9d3..2c17c9ff7 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/internal-apis/pom.xml b/internal-apis/pom.xml index 2f754e0b4..a8e4d989d 100644 --- a/internal-apis/pom.xml +++ b/internal-apis/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index 2292228c3..750bc86b8 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking reference-implementation-consumerdatastandards-au pom - 1.0.6 + 1.0.7-SNAPSHOT org.wso2 wso2 diff --git a/react-apps/pom.xml b/react-apps/pom.xml index b9114c1bb..1539d186e 100644 --- a/react-apps/pom.xml +++ b/react-apps/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml diff --git a/toolkits/ob-apim/pom.xml b/toolkits/ob-apim/pom.xml index 697a8eece..df63ff88c 100644 --- a/toolkits/ob-apim/pom.xml +++ b/toolkits/ob-apim/pom.xml @@ -25,7 +25,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml diff --git a/toolkits/ob-bi/pom.xml b/toolkits/ob-bi/pom.xml index 6dd075405..242c7c6e1 100644 --- a/toolkits/ob-bi/pom.xml +++ b/toolkits/ob-bi/pom.xml @@ -25,7 +25,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml diff --git a/toolkits/ob-is/pom.xml b/toolkits/ob-is/pom.xml index 7c52751af..b6b46b7cc 100644 --- a/toolkits/ob-is/pom.xml +++ b/toolkits/ob-is/pom.xml @@ -24,7 +24,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml diff --git a/toolkits/pom.xml b/toolkits/pom.xml index 38292b8b7..2eec6c85f 100644 --- a/toolkits/pom.xml +++ b/toolkits/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking reference-implementation-consumerdatastandards-au - 1.0.6 + 1.0.7-SNAPSHOT ../pom.xml From 8d31782852677ab8a8cca7ec77becb93ccaa5203 Mon Sep 17 00:00:00 2001 From: Anju Chamantha Date: Fri, 6 Dec 2024 15:25:49 +0530 Subject: [PATCH 18/20] Prepare for 1.1.0 release --- components/org.wso2.openbanking.cds.common/pom.xml | 2 +- .../org.wso2.openbanking.cds.consent.extensions/pom.xml | 2 +- components/org.wso2.openbanking.cds.demo.backend/pom.xml | 2 +- components/org.wso2.openbanking.cds.gateway/pom.xml | 2 +- components/org.wso2.openbanking.cds.identity/pom.xml | 2 +- components/org.wso2.openbanking.cds.metrics/pom.xml | 2 +- components/pom.xml | 2 +- integration-test-suite/cds-toolkit-integration-test/pom.xml | 4 ++-- integration-test-suite/cds-toolkit-test-framework/pom.xml | 4 ++-- integration-test-suite/pom.xml | 2 +- .../identity-outbound-auth-sms-otp/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml | 2 +- .../org.wso2.openbanking.cds.metrics.endpoint/pom.xml | 2 +- internal-apis/pom.xml | 2 +- pom.xml | 2 +- react-apps/pom.xml | 2 +- toolkits/ob-apim/pom.xml | 2 +- toolkits/ob-bi/pom.xml | 2 +- toolkits/ob-is/pom.xml | 2 +- toolkits/pom.xml | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/components/org.wso2.openbanking.cds.common/pom.xml b/components/org.wso2.openbanking.cds.common/pom.xml index 3b0f07f1d..856ef73b0 100644 --- a/components/org.wso2.openbanking.cds.common/pom.xml +++ b/components/org.wso2.openbanking.cds.common/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.consent.extensions/pom.xml b/components/org.wso2.openbanking.cds.consent.extensions/pom.xml index bd6fcba3b..220f199a4 100644 --- a/components/org.wso2.openbanking.cds.consent.extensions/pom.xml +++ b/components/org.wso2.openbanking.cds.consent.extensions/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.demo.backend/pom.xml b/components/org.wso2.openbanking.cds.demo.backend/pom.xml index 51c79c4ff..4ba3c228c 100644 --- a/components/org.wso2.openbanking.cds.demo.backend/pom.xml +++ b/components/org.wso2.openbanking.cds.demo.backend/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.gateway/pom.xml b/components/org.wso2.openbanking.cds.gateway/pom.xml index bf39a8f4b..5ffcb3776 100644 --- a/components/org.wso2.openbanking.cds.gateway/pom.xml +++ b/components/org.wso2.openbanking.cds.gateway/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.identity/pom.xml b/components/org.wso2.openbanking.cds.identity/pom.xml index fdc1f94e7..45b6f9311 100644 --- a/components/org.wso2.openbanking.cds.identity/pom.xml +++ b/components/org.wso2.openbanking.cds.identity/pom.xml @@ -24,7 +24,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.metrics/pom.xml b/components/org.wso2.openbanking.cds.metrics/pom.xml index 4dc42a5dc..3a93b06bc 100644 --- a/components/org.wso2.openbanking.cds.metrics/pom.xml +++ b/components/org.wso2.openbanking.cds.metrics/pom.xml @@ -24,7 +24,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml 4.0.0 diff --git a/components/pom.xml b/components/pom.xml index 155586361..05ad65f43 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml diff --git a/integration-test-suite/cds-toolkit-integration-test/pom.xml b/integration-test-suite/cds-toolkit-integration-test/pom.xml index 4d6377dd7..f4267efcf 100644 --- a/integration-test-suite/cds-toolkit-integration-test/pom.xml +++ b/integration-test-suite/cds-toolkit-integration-test/pom.xml @@ -22,13 +22,13 @@ 4.0.0 cds-toolkit-integration-test - 1.0.7-SNAPSHOT + 1.1.0 jar org.wso2.openbanking integration-test-suite - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml diff --git a/integration-test-suite/cds-toolkit-test-framework/pom.xml b/integration-test-suite/cds-toolkit-test-framework/pom.xml index 2da25c2db..244a4a948 100644 --- a/integration-test-suite/cds-toolkit-test-framework/pom.xml +++ b/integration-test-suite/cds-toolkit-test-framework/pom.xml @@ -21,13 +21,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 cds-toolkit-test-framework - 1.0.7-SNAPSHOT + 1.1.0 jar org.wso2.openbanking integration-test-suite - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml diff --git a/integration-test-suite/pom.xml b/integration-test-suite/pom.xml index 379e40308..6435f5e1a 100644 --- a/integration-test-suite/pom.xml +++ b/integration-test-suite/pom.xml @@ -22,7 +22,7 @@ 4.0.0 org.wso2.openbanking integration-test-suite - 1.0.7-SNAPSHOT + 1.1.0 pom diff --git a/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml b/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml index fcc82de07..ceb33b08d 100644 --- a/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml +++ b/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml @@ -143,7 +143,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.common - 1.0.7-SNAPSHOT + 1.1.0 org.json.wso2 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml index 20aab31bc..657bdb7dc 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking internal-apis - 1.0.7-SNAPSHOT + 1.1.0 ../../pom.xml diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml index 42ec48fff..8f37aba88 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml @@ -23,7 +23,7 @@ internal-apis org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../../pom.xml 4.0.0 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml index b3b457bca..20ce40efe 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../../../pom.xml 4.0.0 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml index 2c17c9ff7..ee9a51587 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../../../pom.xml 4.0.0 diff --git a/internal-apis/pom.xml b/internal-apis/pom.xml index a8e4d989d..26c8408ce 100644 --- a/internal-apis/pom.xml +++ b/internal-apis/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index 750bc86b8..c204aa6d6 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking reference-implementation-consumerdatastandards-au pom - 1.0.7-SNAPSHOT + 1.1.0 org.wso2 wso2 diff --git a/react-apps/pom.xml b/react-apps/pom.xml index 1539d186e..a6796d441 100644 --- a/react-apps/pom.xml +++ b/react-apps/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml diff --git a/toolkits/ob-apim/pom.xml b/toolkits/ob-apim/pom.xml index df63ff88c..ebbc161fb 100644 --- a/toolkits/ob-apim/pom.xml +++ b/toolkits/ob-apim/pom.xml @@ -25,7 +25,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml diff --git a/toolkits/ob-bi/pom.xml b/toolkits/ob-bi/pom.xml index 242c7c6e1..6a2d50979 100644 --- a/toolkits/ob-bi/pom.xml +++ b/toolkits/ob-bi/pom.xml @@ -25,7 +25,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml diff --git a/toolkits/ob-is/pom.xml b/toolkits/ob-is/pom.xml index b6b46b7cc..80f5c6391 100644 --- a/toolkits/ob-is/pom.xml +++ b/toolkits/ob-is/pom.xml @@ -24,7 +24,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml diff --git a/toolkits/pom.xml b/toolkits/pom.xml index 2eec6c85f..8e1a552be 100644 --- a/toolkits/pom.xml +++ b/toolkits/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking reference-implementation-consumerdatastandards-au - 1.0.7-SNAPSHOT + 1.1.0 ../pom.xml From 2d9a23702d4c1e8f6579ae766d86800c20da0c23 Mon Sep 17 00:00:00 2001 From: imesh94 Date: Fri, 6 Dec 2024 15:52:59 +0530 Subject: [PATCH 19/20] Add release-tag github workflow --- .github/workflows/create-release-tag.yaml | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/create-release-tag.yaml diff --git a/.github/workflows/create-release-tag.yaml b/.github/workflows/create-release-tag.yaml new file mode 100644 index 000000000..db8be09a9 --- /dev/null +++ b/.github/workflows/create-release-tag.yaml @@ -0,0 +1,55 @@ +name: Release + +on: + workflow_dispatch: + inputs: + release-version: + description: "Release version (e.g., 1.0.1). A tag will be created with the format v" + required: true + snapshot-version: + description: "Snapshot version (e.g., 1.0.2-SNAPSHOT). Snapshot version for the next development iteration." + required: true + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' + + - name: Configure Git user as workflow triggerer + run: | + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor }}@users.noreply.github.com" + + - name: Remove -SNAPSHOT for release + run: | + echo "Updating versions to release version..." + mvn versions:set -DnewVersion=${{ github.event.inputs.release-version }} -DprocessAllModules + mvn versions:commit + git commit -am "Prepare for the release ${{ github.event.inputs.release-version }}" + + - name: Create a Git tag for the release + run: | + echo "Creating a Git tag for the release..." + git tag v${{ github.event.inputs.release-version }} + + - name: Increment to SNAPSHOT version + run: | + echo "Incrementing to the next development version..." + mvn versions:set -DnewVersion=${{ github.event.inputs.snapshot-version }} -DprocessAllModules + mvn versions:commit + git commit -am "Prepare for the development iteration ${{ github.event.inputs.snapshot-version }}" + + - name: Push changes and tags + run: | + echo "Pushing version update and tags to the repository..." + git push origin main + git push origin --tags From f97598564e4d109e256a260be9c919559436d7af Mon Sep 17 00:00:00 2001 From: Anju Chamantha Date: Fri, 6 Dec 2024 16:56:01 +0530 Subject: [PATCH 20/20] Prepare for the development iteration 1.1.1 --- components/org.wso2.openbanking.cds.common/pom.xml | 2 +- .../org.wso2.openbanking.cds.consent.extensions/pom.xml | 2 +- components/org.wso2.openbanking.cds.demo.backend/pom.xml | 2 +- components/org.wso2.openbanking.cds.gateway/pom.xml | 2 +- components/org.wso2.openbanking.cds.identity/pom.xml | 2 +- components/org.wso2.openbanking.cds.metrics/pom.xml | 2 +- components/pom.xml | 2 +- integration-test-suite/cds-toolkit-integration-test/pom.xml | 4 ++-- integration-test-suite/cds-toolkit-test-framework/pom.xml | 4 ++-- integration-test-suite/pom.xml | 2 +- .../identity-outbound-auth-sms-otp/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml | 2 +- .../org.wso2.openbanking.cds.metrics.endpoint/pom.xml | 2 +- internal-apis/pom.xml | 2 +- pom.xml | 2 +- react-apps/pom.xml | 2 +- toolkits/ob-apim/pom.xml | 2 +- toolkits/ob-bi/pom.xml | 2 +- toolkits/ob-is/pom.xml | 2 +- toolkits/pom.xml | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/components/org.wso2.openbanking.cds.common/pom.xml b/components/org.wso2.openbanking.cds.common/pom.xml index 856ef73b0..8e0c64cba 100644 --- a/components/org.wso2.openbanking.cds.common/pom.xml +++ b/components/org.wso2.openbanking.cds.common/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.consent.extensions/pom.xml b/components/org.wso2.openbanking.cds.consent.extensions/pom.xml index 220f199a4..3b522d829 100644 --- a/components/org.wso2.openbanking.cds.consent.extensions/pom.xml +++ b/components/org.wso2.openbanking.cds.consent.extensions/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.demo.backend/pom.xml b/components/org.wso2.openbanking.cds.demo.backend/pom.xml index 4ba3c228c..240db1c9c 100644 --- a/components/org.wso2.openbanking.cds.demo.backend/pom.xml +++ b/components/org.wso2.openbanking.cds.demo.backend/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.gateway/pom.xml b/components/org.wso2.openbanking.cds.gateway/pom.xml index 5ffcb3776..8c6d866b1 100644 --- a/components/org.wso2.openbanking.cds.gateway/pom.xml +++ b/components/org.wso2.openbanking.cds.gateway/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.identity/pom.xml b/components/org.wso2.openbanking.cds.identity/pom.xml index 45b6f9311..535c29a15 100644 --- a/components/org.wso2.openbanking.cds.identity/pom.xml +++ b/components/org.wso2.openbanking.cds.identity/pom.xml @@ -24,7 +24,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/org.wso2.openbanking.cds.metrics/pom.xml b/components/org.wso2.openbanking.cds.metrics/pom.xml index 3a93b06bc..ce1be2203 100644 --- a/components/org.wso2.openbanking.cds.metrics/pom.xml +++ b/components/org.wso2.openbanking.cds.metrics/pom.xml @@ -24,7 +24,7 @@ reference-implementation-consumerdatastandards-au-components org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/components/pom.xml b/components/pom.xml index 05ad65f43..640e6824c 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -22,7 +22,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml diff --git a/integration-test-suite/cds-toolkit-integration-test/pom.xml b/integration-test-suite/cds-toolkit-integration-test/pom.xml index f4267efcf..6b1f7ca06 100644 --- a/integration-test-suite/cds-toolkit-integration-test/pom.xml +++ b/integration-test-suite/cds-toolkit-integration-test/pom.xml @@ -22,13 +22,13 @@ 4.0.0 cds-toolkit-integration-test - 1.1.0 + 1.1.1-SNAPSHOT jar org.wso2.openbanking integration-test-suite - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml diff --git a/integration-test-suite/cds-toolkit-test-framework/pom.xml b/integration-test-suite/cds-toolkit-test-framework/pom.xml index 244a4a948..f5cf63d2a 100644 --- a/integration-test-suite/cds-toolkit-test-framework/pom.xml +++ b/integration-test-suite/cds-toolkit-test-framework/pom.xml @@ -21,13 +21,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 cds-toolkit-test-framework - 1.1.0 + 1.1.1-SNAPSHOT jar org.wso2.openbanking integration-test-suite - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml diff --git a/integration-test-suite/pom.xml b/integration-test-suite/pom.xml index 6435f5e1a..63dcba416 100644 --- a/integration-test-suite/pom.xml +++ b/integration-test-suite/pom.xml @@ -22,7 +22,7 @@ 4.0.0 org.wso2.openbanking integration-test-suite - 1.1.0 + 1.1.1-SNAPSHOT pom diff --git a/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml b/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml index ceb33b08d..cc038798f 100644 --- a/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml +++ b/integration-test-suite/test-artifacts/custom-authenticator-sms-otp/identity-outbound-auth-sms-otp/pom.xml @@ -143,7 +143,7 @@ org.apache.oltu.oauth2 org.apache.oltu.oauth2.common - 1.1.0 + 1.1.1-SNAPSHOT org.json.wso2 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml index 657bdb7dc..9e60588aa 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.account.type.management.endpoint/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking internal-apis - 1.1.0 + 1.1.1-SNAPSHOT ../../pom.xml diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml index 8f37aba88..2285dc3f0 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.arrangement.revocation.endpoint/pom.xml @@ -23,7 +23,7 @@ internal-apis org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../../pom.xml 4.0.0 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml index 20ce40efe..b0bac56a5 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metadata.mgt.endpoint/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml index ee9a51587..32d281bd5 100644 --- a/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml +++ b/internal-apis/internal-webapps/org.wso2.openbanking.cds.metrics.endpoint/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../../../pom.xml 4.0.0 diff --git a/internal-apis/pom.xml b/internal-apis/pom.xml index 26c8408ce..44e4859b7 100644 --- a/internal-apis/pom.xml +++ b/internal-apis/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index c204aa6d6..8fa8f45d6 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking reference-implementation-consumerdatastandards-au pom - 1.1.0 + 1.1.1-SNAPSHOT org.wso2 wso2 diff --git a/react-apps/pom.xml b/react-apps/pom.xml index a6796d441..7e151b2c0 100644 --- a/react-apps/pom.xml +++ b/react-apps/pom.xml @@ -23,7 +23,7 @@ reference-implementation-consumerdatastandards-au org.wso2.openbanking - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml diff --git a/toolkits/ob-apim/pom.xml b/toolkits/ob-apim/pom.xml index ebbc161fb..e6bee06b8 100644 --- a/toolkits/ob-apim/pom.xml +++ b/toolkits/ob-apim/pom.xml @@ -25,7 +25,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml diff --git a/toolkits/ob-bi/pom.xml b/toolkits/ob-bi/pom.xml index 6a2d50979..739cfa863 100644 --- a/toolkits/ob-bi/pom.xml +++ b/toolkits/ob-bi/pom.xml @@ -25,7 +25,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml diff --git a/toolkits/ob-is/pom.xml b/toolkits/ob-is/pom.xml index 80f5c6391..10de0e11e 100644 --- a/toolkits/ob-is/pom.xml +++ b/toolkits/ob-is/pom.xml @@ -24,7 +24,7 @@ org.wso2.openbanking open-banking-toolkit-cds-modules - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml diff --git a/toolkits/pom.xml b/toolkits/pom.xml index 8e1a552be..b491b86b7 100644 --- a/toolkits/pom.xml +++ b/toolkits/pom.xml @@ -23,7 +23,7 @@ org.wso2.openbanking reference-implementation-consumerdatastandards-au - 1.1.0 + 1.1.1-SNAPSHOT ../pom.xml