Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 11.5 KB

test-cases.md

File metadata and controls

49 lines (39 loc) · 11.5 KB

Test Cases for Account Endpoints

All these Test Cases are automated using Rest Assured.
To run that you need to run the app and after that run ./gradlew test on your terminal.
You can also run the GitHub Workflow

Endpoints


GET /accounts/v1/accounts/{accountId}

Test Case ID Test Case Description Preconditions Expected Results Status Comments
TC001 Valid account ID returns account data Valid authentication token is available Account details for the specified account are returned with status code 200. Response structure matches the expected format. Passing
TC002 Invalid account ID returns error Valid authentication token is available Error message "Internal Server Error" is returned with status code 500. Error message contains "Internal Server Error: Invalid UUID string: {invalid Id}". Passing
TC003 A short account ID returns error Valid authentication token is available Error message "Internal Server Error" is returned with status code 500. Error message contains "Internal Server Error: Invalid UUID string: {invalid Id}". Failing Does not validate the Account ID format.
TC004 Account ID not found returns error Valid authentication token is available Error message "Not Found" is returned with status code 404. Error message contains "Account Id {non-existent id} not found". Passing
TC005 Request without proper authorization returns error No authentication token is available Error message "Unauthorized" is returned with status code 401. Passing
TC006 Request with invalid token returns error Authentication code with invalid format is available Error message "Unauthorized" is returned with status code 401. Passing
TC007 Request with token without payload Authentication code with an empty payload is available Error message "Internal Server Error" is returned with status code 500. Error message contains "Internal Server Error: Cannot invoke "java.util.Map.getOrDefault(Object, Object)" because "payload" is null". Passing
TC008 Request with a consent scope token Authentication code with consent scope Error message "Forbidden" is returned with status code 403. Passing
TC009 Request with a not existent consent ID scope token Authentication code with a non-existent consent Error message "Not Found" is returned with status code 404. Error message contains: "Consent Id {consentId} not found". Failing Does not validate that the Consent Id exists.
TC010 Request with a consentId in AWAITING_AUTHORISATION status Authentication code with an AWAITING_AUTHORISATION consent Error message "Forbidden" is returned with status code 403. Error message contains: "Consent Id {consentId} is not in the right status". Failing Does not validate the Consent status.
TC011 Request with a consentId in REJECTED status Authentication code with a REJECTED consent Error message "Forbidden" is returned with status code 403. Error message contains: "Consent Id {consentId} is not in the right status". Failing Does not validate the Consent status.
TC012 Request with an expired consentId Authentication code with an expired consent Error message "Forbidden" is returned with status code 403. Error message contains: "Consent expired". Failing Does not validate the Consent expiration data.
TC013 Request without a valid consentId returns error Authentication code with an invalid consentId Error message "Forbidden" is returned with status code 403. Error message contains: "Consent ID not present on the request". Failing Does not validate if the Consent Id is present.

GET /accounts/v1/accounts

Test Case ID Test Case Description Preconditions Expected Results Status Comments
TC001 Request accounts returns accounts list Valid authentication token is available Account list is returned with status code 200. Response structure matches the expected format. Passing
TC002 Request without proper authorization returns error No authentication token is available Error message "Unauthorized" is returned with status code 401. Passing
TC003 Request with invalid token returns error Authentication code with invalid format is available Error message "Unauthorized" is returned with status code 401. Passing
TC004 Request with an invalid token payload returns error Authentication code with an invalid payload is available Error message "Internal Server Error" is returned with status code 500. Error message contains "Internal Server Error: Cannot invoke "java.util.Map.getOrDefault(Object, Object)" because "payload" is null". Passing
TC005 Request with a token scope CONSENTS_MANAGE returns error Authentication code with CONSENTS_MANAGE scope Error message "Forbidden" is returned with status code 403. Passing
TC006 Request with a non-existent consent ID returns error Authentication code with a non-existent consent Error message "Not Found" is returned with status code 404. Error message contains: "Consent Id {consentId} not found". Passing
TC007 Request without a valid consent ID returns error Authentication code with an invalid consent ID Error message "Forbidden" is returned with status code 403. Error message contains: "Consent ID not present on the request". Passing
TC008 Request with a consentId in AWAITING_AUTHORISATION status returns error Authentication code with an AWAITING_AUTHORISATION consent Error message "Forbidden" is returned with status code 403. Error message contains: "Consent Id {consentId} is not in the right status". Passing
TC009 Request with a consentId in REJECTED status returns error Authentication code with a REJECTED consent Error message "Forbidden" is returned with status code 403. Error message contains: "Consent Id {consentId} is not in the right status". Passing
TC010 Request with an expired consent returns error Authentication code with an expired consent Error message "Forbidden" is returned with status code 403. Error message contains: "Consent expired". Failing Does not validate the Consent expiration data.