Test Plan for CAPIF Api Provider Management
December 9, 2022 ยท View on GitHub
- Test Plan for CAPIF Api Provider Management
- Tests
- Test Case 1: Register Api Provider
- Test Case 2: Register Api Provider Already registered
- Test Case 3: Update Registered Api Provider
- Test Case 4: Update Not Registered Api Provider
- Test Case 5: Partially Update Registered Api Provider
- Test Case 6: Partially Update Not Registered Api Provider
- Test Case 7: Delete Registered Api Provider
- Test Case 8: Delete Not Registered Api Provider
Test Plan for CAPIF Api Provider Management
At this documentation you will have all information and related files and examples of test plan for this API.
Tests
Test Case 1: Register Api Provider
-
Test ID: capif_api_provider_management-1
-
Description:
This test case will check that Api Provider can be registered con CCF
-
Pre-Conditions:
- Provider is pre-authorised (has valid certificate from CAPIF Authority)
-
Information of Test:
-
Create public and private key at provider for provider itself and each function (apf, aef and amf)
-
Register of Provider at CCF:
- Send POST to http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register
- body provider register body
-
Obtain Access Token:
- Send POST to http://{CAPIF_HOSTNAME}/getauth
- Body provider getauth body
-
Register Provider:
- Send POST https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations
- body provider request body
- Authentication Bearer with access_token
- Store each cert in a file with according name.
-
-
Execution Steps:
- Create private and public key for provider and each function to register.
- Register Provider.
-
Expected Result:
- Register Provider at Provider Management:
- 201 Created response.
- body returned must accomplish APIProviderEnrolmentDetails data structure.
- For each apiProvFuncs, we must check:
- apiProvFuncId is set
- apiProvCert under regInfo is set properly
- Location Header must contain the new resource URL {apiRoot}/api-provider-management/v1/registrations/{registrationId}
- Register Provider at Provider Management:
Test Case 2: Register Api Provider Already registered
-
Test ID: capif_api_provider_management-2
-
Description:
This test case will check that a Api Provider previously registered cannot be re-registered
-
Pre-Conditions:
- Api Provider was registered previously and there is a {registerId} for his Api Provider in the DB
-
Information of Test:
-
Create public and private key at provider for provider itself and each function (apf, aef and amf)
-
Register of Provider at CCF:
- Send POST to http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register
- body provider register body
-
Obtain Access Token:
- Send POST to http://{CAPIF_HOSTNAME}/getauth
- Body provider getauth body
-
Register Provider:
- Send POST https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations
- body provider request body
- Authentication Bearer with access_token
- Store each cert in a file with according name.
-
Re-Register Provider:
- Same regSec than Previous registration
-
-
Execution Steps:
- Create private and public key for provider and each function to register.
- Register Provider.
- Re-Register Provider.
-
Expected Result:
- Re-Register Provider:
- 403 Forbidden response.
- body returned must accomplish ProblemDetails data structure, with:
- status 403
- title with message "Forbidden"
- detail with message "Provider already registered".
- cause with message "Identical provider reg sec".
- Re-Register Provider:
Test Case 3: Update Registered Api Provider
-
Test ID: capif_api_provider_management-3
-
Description:
This test case will check that a Registered Api Provider can be updated
-
Pre-Conditions:
- Api Provider was registered previously and there is a {registerId} for his Api Provider in the DB
-
Information of Test:
-
Create public and private key at provider for provider itself and each function (apf, aef and amf)
-
Register of Provider at CCF:
- Send POST to http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register
- body provider register body
-
Obtain Access Token:
- Send POST to http://{CAPIF_HOSTNAME}/getauth
- Body provider getauth body
-
Register Provider:
- Send POST https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations
- body provider request body
- Authentication Bearer with access_token
- Get Resource URL from Location
-
Update Provider:
- Send PUT to Resource URL returned at registration https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{registrationId}
- body provider request body with apiProvDomInfo set to ROBOT_TESTING_MOD
- Use AMF Certificate.
-
-
Execution Steps:
- Create private and public key for provider and each function to register.
- Register Provider
- Update Provider
-
Expected Result:
-
Register Provider:
- 201 Created response.
- body returned must accomplish APIProviderEnrolmentDetails data structure.
- Location Header must contain the new resource URL {apiRoot}/api-provider-management/v1/registrations/{registrationId}
-
Update Provider:
- 200 OK response.
- body returned must accomplish APIProviderEnrolmentDetails data structure, with:
- apiProvDomInfo set to ROBOT_TESTING_MOD
-
Test Case 4: Update Not Registered Api Provider
-
Test ID: capif_api_provider_management-4
-
Description:
This test case will check that a Non-Registered Api Provider cannot be updated
-
Pre-Conditions:
- Api Provider was not registered previously
-
Information of Test:
-
Create public and private key at provider for provider itself and each function (apf, aef and amf)
-
Register of Provider at CCF:
- Send POST to http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register
- body provider register body
-
Obtain Access Token:
- Send POST to http://{CAPIF_HOSTNAME}/getauth
- Body provider getauth body
-
Register Provider:
- Send POST https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations
- body provider request body
- Authentication Bearer with access_token
- Store each cert in a file with according name.
-
Update Not Registered Provider:
- Send PUT https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{API_PROVIDER_NOT_REGISTERED}
- body provider request body
- Use AMF Certificate.
-
-
Execution Steps:
- Register Provider at CCF
- Update Not Registered Provider
-
Expected Result:
- Update Not Registered Provider:
- 404 Not Found response.
- body returned must accomplish ProblemDetails data structure, with:
- status 404
- title with message "Not Found"
- detail with message "Not Exist Provider Enrolment Details".
- cause with message "Not found registrations to send this api provider details".
- Update Not Registered Provider:
Test Case 5: Partially Update Registered Api Provider
-
Test ID: capif_api_provider_management-5
-
Description:
This test case will check that a Registered Api Provider can be partially updated
-
Pre-Conditions:
- Api Provider was registered previously and there is a {registerId} for his Api Provider in the DB
-
Information of Test:
-
Create public and private key at provider for provider itself and each function (apf, aef and amf)
-
Register of Provider at CCF:
- Send POST to http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register
- body provider register body
-
Obtain Access Token:
- Send POST to http://{CAPIF_HOSTNAME}/getauth
- Body provider getauth body
-
Register Provider:
- Send POST https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations
- body provider request body
- Authentication Bearer with access_token
- Store each cert in a file with according name.
-
Partial update provider:
- Send PATCH https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{registrationId}
- body provider request patch body
- Use AMF Certificate.
-
-
Execution Steps:
- Register Provider at CCF
- Register Provider
- Partial update provider
-
Expected Result:
- Partial update provider at Provider Management:
- 200 OK response.
- body returned must accomplish APIProviderEnrolmentDetails data structure, with:
- apiProvDomInfo with "ROBOT_TESTING_MOD"
- Partial update provider at Provider Management:
Test Case 6: Partially Update Not Registered Api Provider
-
Test ID: capif_api_provider_management-6
-
Description:
This test case will check that a Non-Registered Api Provider cannot be partially updated
-
Pre-Conditions:
- Api Provider was not registered previously
-
Information of Test:
-
Create public and private key at provider for provider itself and each function (apf, aef and amf)
-
Register of Provider at CCF:
- Send POST to http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register
- body provider register body
-
Obtain Access Token:
- Send POST to http://{CAPIF_HOSTNAME}/getauth
- Body provider getauth body
-
Register Provider:
- Send POST https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations
- body provider request body
- Authentication Bearer with access_token
- Store each cert in a file with according name.
-
Partial update Provider:
- Send PATCH https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{API_API_PROVIDER_NOT_REGISTERED}
- body provider request patch body
- Use AMF Certificate.
-
-
Execution Steps:
- Register Provider at CCF
- Register Provider
- Partial update provider
-
Expected Result:
- Partial update provider:
- 404 Not Found response.
- body returned must accomplish ProblemDetails data structure, with:
- status 404
- title with message "Not Found"
- detail with message "Not Exist Provider Enrolment Details".
- cause with message "Not found registrations to send this api provider details".
- Partial update provider:
Test Case 7: Delete Registered Api Provider
-
Test ID: capif_api_provider_management-7
-
Description:
This test case will check that a Registered Api Provider can be deleted
-
Pre-Conditions:
- Api Provider was registered previously
-
Information of Test:
-
Create public and private key at provider for provider itself and each function (apf, aef and amf)
-
Register of Provider at CCF:
- Send POST to http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register
- body provider register body
-
Obtain Access Token:
- Send POST to http://{CAPIF_HOSTNAME}/getauth
- Body provider getauth body
-
Register Provider:
- Send POST https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations
- body provider request body
- Authentication Bearer with access_token
- Store each cert in a file with according name.
-
Delete registered provider:
- Send DELETE https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{registrationId}
- Use AMF Certificate.
-
-
Execution Steps:
- Register Provider at CCF
- Register Provider
- Delete Provider
-
Expected Result:
- Delete Provider:
- 204 No Content response.
- Delete Provider:
Test Case 8: Delete Not Registered Api Provider
-
Test ID: capif_api_provider_management-8
-
Description:
This test case will check that a Non-Registered Api Provider cannot be deleted
-
Pre-Conditions:
- Api Provider was not registered previously
-
Information of Test:
-
Create public and private key at provider for provider itself and each function (apf, aef and amf)
-
Register of Provider at CCF:
- Send POST to http://{CAPIF_HOSTNAME}:{CAPIF_HTTP_PORT}/register
- body provider register body
-
Obtain Access Token:
- Send POST to http://{CAPIF_HOSTNAME}/getauth
- Body provider getauth body
-
Register Provider:
- Send POST https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations
- body provider request body
- Authentication Bearer with access_token
- Store each cert in a file with according name.
-
Delete registered provider at Provider Management:
- Send DELETE https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{API_PROVIDER_NOT_REGISTERED}
- Use AMF Certificate.
-
-
Execution Steps:
- Register Provider at CCF
- Delete Provider
-
Expected Result:
- Delete Provider:
- 404 Not Found response.
- body returned must accomplish ProblemDetails data structure, with:
- status 404
- title with message "Not Found"
- detail with message "Not Exist Provider Enrolment Details".
- cause with message "Not found registrations to send this api provider details".
- Delete Provider: