Test Plan for CAPIF Api Invoker Management
At this documentation you will have all information and related files and examples of test plan for this API.
Test Case 1: Onboard Network App
Test ID: capif_api_invoker_management-1
Description:
This test will try to register new Network App at CAPIF Core.
Pre-Conditions:
- Network App was not registered previously
- Network App was not onboarded previously
- Preconditions: The administrator must have previously registered the User.
Execution Steps:
- Retrieve access_token by User from register
- Onboard Invoker at CCF
- Store signed Certificate
Information of Test:
-
Create public and private key at invoker
-
Retrieve access_token by User:
- Send GET to https://${CAPIF_REGISTER}:${CAPIF_REGISTER_PORT}/getauth
- Include basic Auth Header with Admin user/password
- Retrieve access_token and the urls needed for next requests from response body user_getauth_response_body_example
-
Onboard Invoker:
- Send POST to https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers
- Reference Request Body: invoker onboarding body
- "onboardingInformation"->"apiInvokerPublicKey": must contain public key generated by Invoker.
- Send in Authorization Header the Bearer access_token obtained previously (Authorization:Bearer ${access_token})
Expected Result:
- Response to Onboard request must accomplish:
- 201 Created
- Response Body must follow APIInvokerEnrolmentDetails data structure with:
- apiInvokerId
- onboardingInformation->apiInvokerCertificate must contain the public key signed.
- Response Header Location must be received with URI to new resource created, following this structure: {apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}
Test Case 2: Onboard Network App Already onboarded
Test ID: capif_api_invoker_management-2
Description:
This test will check second onboard of same Network App is not allowed.
Pre-Conditions:
- Network App was registered previously
- Network App was onboarded previously
Execution Steps:
- Register Network App at CCF
- Onboard Network App at CCF
- Store signed Certificate at Network App
- Onboard Again the Network App at CCF
Information of Test:
-
Perform Invoker Onboarding
-
Repeat Onboard Invoker:
- Send POST to https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers
- Reference Request Body: invoker onboarding body
- "onboardingInformation"->"apiInvokerPublicKey": must contain public key generated by Invoker.
- Send in Authorization Header the Bearer access_token obtained previously (Authorization:Bearer ${access_token})
Expected Result:
- Response to Onboard request must accomplish:
- 201 Created
- Response Body must follow APIInvokerEnrolmentDetails data structure with:
- apiInvokerId
- onboardingInformation->apiInvokerCertificate must contain the public key signed.
- Response Header Location must be received with URI to new resource created, following this structure: {apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}
- Response to Second Onboard of Network App must accomplish:
- 403 Forbidden
- Error Response Body must accomplish with ProblemDetails data structure with:
- status 403
- title with message "Forbidden"
- detail with message "Invoker Already registered".
- cause with message "Identical invoker public key".
Test Case 3: Update Onboarded Network App
Test ID: capif_api_invoker_management-3
Description:
This test will try to update information of previous onboard Network App at CAPIF Core.
Pre-Conditions:
- Network App was registered previously
- Network App was onboarded previously with {onboardingId}
Execution Steps:
- Register Invoker at CCF
- Onboard Invoker at CCF
- Store signed Certificate
- Update Onboarding Information at CCF with a minor change on "notificationDestination"
Information of Test:
-
Perform Invoker Onboarding
-
Update information of previously onboarded Invoker:
- Send PUT to https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{onboardingId}
- Reference Request Body is: [put invoker onboarding body]
- "notificationDestination": "http://host.docker.internal:8086/netapp_new_callback",
Expected Result:
- Response to Onboard request must accomplish:
- 201 Created
- Response Body must follow APIInvokerEnrolmentDetails data structure with:
- apiInvokerId
- onboardingInformation->apiInvokerCertificate must contain the public key signed.
- Response Header Location must be received with URI to new resource created, following this structure: {apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}
- Response to Update Request (PUT) with minor change must contain:
- 200 OK response.
- notificationDestination on response must contain the new value
Test Case 4: Update Not Onboarded Network App
Test ID: capif_api_invoker_management-4
Description:
This test will try to update information of not onboarded Network App at CAPIF Core.
Pre-Conditions:
- Network App was registered previously
- Network App was not onboarded previously
Execution Steps:
- Register Invoker at CCF
- Onboard Invoker at CCF
- Update Onboarding Information at CCF of not onboarded
Information of Test:
-
Perform Invoker Onboarding
-
Update information of not onboarded Invoker:
- Send PUT to https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{INVOKER_NOT_REGISTERED}
- Reference Request Body is: [put invoker onboarding body]
Expected Result:
- Response to Onboard request must accomplish:
- 201 Created
- Response to Update Request (PUT) must contain:
- 404 Not Found
- Error Response Body must accomplish with ProblemDetails data structure with:
- status 404
- title with message "Not Found"
- detail with message "Please provide an existing Network App ID".
- cause with message "Not exist Network App ID".
Test Case 5: Offboard Network App
Test ID: capif_api_invoker_management-5
Description:
This test case will check that a Registered Network App can be deleted.
Pre-Conditions:
- Network App was registered previously
- Network App was onboarded previously
Execution Steps:
- Register Invoker at CCF
- Onboard Invoker at CCF
- Offboard Invoker at CCF
Information of Test:
-
Perform Invoker Onboarding
-
Offboard:
- Send DELETE to https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{onboardingId}
Expected Result:
- Response to Onboard request must accomplish:
- 201 Created
- Response to Offboard Request (DELETE) must contain:
- 204 No Content
Test Case 6: Offboard Not previsouly Onboarded Network App
Test ID: capif_api_invoker_management-6
Description:
This test case will check that a Non-Registered Network App cannot be deleted
Pre-Conditions:
- Network App was registered previously
- Network App was not onboarded previously
Execution Steps:
- Register Invoker at CCF
- Offboard Invoker at CCF
Information of Test:
-
Perform Invoker Onboarding
-
Offboard:
- Send DELETE to https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{INVOKER_NOT_REGISTERED}
Expected Result:
- Response to Offboard Request (DELETE) must contain:
- 404 Not Found
- Error Response Body must accomplish with ProblemDetails data structure with:
- status 404
- title with message "Not Found"
- detail with message "Please provide an existing Network App ID".
- cause with message "Not exist Network App ID".
Test Case 7: Update Onboarded Network App Certificate
Test ID: capif_api_invoker_management-7
Description:
This test will try to update public key and get a new signed certificate by CAPIF Core.
Pre-Conditions:
- Network App was registered previously
- Network App was onboarded previously with {onboardingId} and {public_key_1}
Execution Steps:
- Register Invoker at CCF
- Onboard Invoker at CCF
- Store signed Certificate
- Update Onboarding Information at CCF with new public key
- Update Onboarding Information at CCF with minor change
Information of Test:
-
Perform Invoker Onboarding with public_key_1.
-
Create {public_key_2}
-
Update information of previously onboarded Invoker:
- Send PUT to https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{onboardingId}
- Reference Request Body is: [put invoker onboarding body]
- ["onboardingInformation"]["apiInvokerPublicKey"]: {public_key_2},
- Store new certificate.
-
Update information of previously onboarded Invoker Using new certificate:
- Send PUT to https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{onboardingId}
- Reference Request Body is: [put invoker onboarding body]
- "notificationDestination": "http://host.docker.internal:8086/netapp_new_callback",
- Use new Invoker Certificate
Expected Result:
- Response to Onboard request must accomplish:
- 201 Created
- Response Body must follow APIInvokerEnrolmentDetails data structure with:
- apiInvokerId
- onboardingInformation->apiInvokerCertificate must contain the public key signed.
- Response Header Location must be received with URI to new resource created, following this structure: {apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}
- Response to Update Request (PUT) with new public key:
- 200 OK response.
- apiInvokerCertificate with new certificate on response -> store to use.
- Response to Update Request (PUT) with minor change must contain:
- 200 OK response.
- notificationDestination on response must contain the new value