Test Plan for CAPIF Api Events Service
At this documentation you will have all information and related files and examples of test plan for this API.
Tests
Test Case 1: Creates a new individual CAPIF Event Subscription.
Test ID: capif_api_events-1
Description:
This test case will check that a CAPIF subscriber (Invoker or Publisher) can Subscribe to Events Pre-Conditions:
- CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority)
Information of Test:
-
Perform Invoker Onboarding
-
Event Subscription:
- Send POST to https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions
- body event subscription request body
- Use Invoker Certificate
Execution Steps:
- Register Invoker and Onboard Invoker at CCF
- Subscribe to Events
- Retrieve {subscriberId} and {subscriptionId} from Location Header
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 Event Subscription must accomplish:
- 201 Created
- The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: *{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}
- Response Body must follow EventSubscription data structure.
-
Event Subscriptions are stored in CAPIF Database
Test Case 2: Creates a new individual CAPIF Event Subscription with Invalid SubscriberId
Test ID: capif_api_events-2
Description:
This test case will check that a CAPIF subscriber (Invoker or Publisher) cannot Subscribe to Events without valid SubcriberId
Pre-Conditions:
- CAPIF subscriber is not pre-authorised (has invalid InvokerId or apfId)
Information of Test:
-
Perform Invoker Onboarding
-
Event Subscription:
- Send POST to https://{CAPIF_HOSTNAME}/capif-events/v1/{SUBSCRIBER_NOT_REGISTERED}/subscriptions
- body event subscription request body
- Use Invoker Certificate
Execution Steps:
- Register Invoker and Onboard Invoker at CCF
- Subscribe to Events
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 Event Subscription must accomplish:
- 404 Not Found
- Error Response Body must accomplish with ProblemDetails data structure with:
- status 404
- title with message "Not Found"
- detail with message "Invoker or APF or AEF or AMF Not found".
- cause with message "Subscriber Not Found".
-
Event Subscriptions are not stored in CAPIF Database
Test Case 3: Deletes an individual CAPIF Event Subscription
Test ID: capif_api_events-3
Description:
This test case will check that a CAPIF subscriber (Invoker or Publisher) can Delete an Event Subscription
Pre-Conditions:
- CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority)
Information of Test:
-
Perform Invoker Onboarding
-
Event Subscription:
- Send POST to https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions
- body event subscription request body
- Use Invoker Certificate
-
Remove Event Subscription:
- Send DELETE to https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions
- Use Invoker Certificate
Execution Steps:
- Register Invoker and Onboard Invoker at CCF
- Subscribe to Events
- Retrieve {subscriberId} and {subscriptionId} from Location Header
- Remove Event Subscription
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 Event Subscription must accomplish:
- 201 Created
- The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: *{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}
- Response Body must follow EventSubscription data structure.
-
Event Subscriptions are stored in CAPIF Database
-
Remove Event Subscription:
- 204 No Content
-
Event Subscription is not present at CAPIF Database.
Test Case 4: Deletes an individual CAPIF Event Subscription with invalid SubscriberId
Test ID: capif_api_events-4
Description:
This test case will check that a CAPIF subscriber (Invoker or Publisher) cannot Delete to Events without valid SubcriberId
Pre-Conditions:
- CAPIF subscriber is pre-authorised (has valid InvokerId or apfId).
- CAPIF subscriber is subscribed to Events.
Information of Test:
-
Perform Invoker Onboarding
-
Event Subscription:
- Send POST to https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions
- body event subscription request body
- Use Invoker Certificate
-
Remove Event Subcription with not valid subscriber:
- Send DELETE to to https://{CAPIF_HOSTNAME}/capif-events/v1/{SUBSCRIBER_ID_NOT_VALID}/subscriptions/{subcriptionId}
- Use Invoker Certificate
Execution Steps:
- Register Invoker and Onboard Invoker at CCF
- Subscribe to Events
- Retrieve Location Header with subscriptionId.
- Remove Event Subscribed with not valid Subscriber.
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 Event Subscription must accomplish:
- 201 Created
- The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: *{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}
- Response Body must follow EventSubscription data structure.
-
Event Subscriptions are stored in CAPIF Database
- Error Response Body must accomplish with ProblemDetails data structure with: * status 404 * title with message "Not Found" * detail with message "Invoker or APF or AEF or AMF Not found". * cause with message "Subscriber Not Found".
Test Case 5: Deletes an individual CAPIF Event Subscription with invalid SubscriptionId
Test ID: capif_api_events-5
Description:
This test case will check that a CAPIF subscriber (Invoker or Publisher) cannot Delete an Event Subscription without valid SubscriptionId
Pre-Conditions:
- CAPIF subscriber is pre-authorised (has invalid InvokerId or apfId).
- CAPIF subscriber is subscribed to Events.
Information of Test:
-
Perform Invoker Onboarding
-
Event Subscription:
- Send POST to https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions
- body event subscription request body
- Use Invoker Certificate
-
Remove Event Subcription with not valid subscriber:
- Send DELETE to to https://{CAPIF_HOSTNAME}/capif-events/v1/{subcriberId}/subscriptions/{SUBSCRIPTION_ID_NOT_VALID}
- Use Invoker Certificate
Execution Steps:
- Register Invoker and Onboard Invoker at CCF
- Subscribe to Events
- Retrieve Location Header with subscriptionId.
- Remove Event Subscribed with not valid Subscriber.
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 Event Subscription must accomplish:
- 201 Created
- The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: *{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}
- Response Body must follow EventSubscription data structure.
-
Event Subscriptions are stored in CAPIF Database
- Remove Event Subscription with not valid subscriber:
- 404 Not Found
- Error Response Body must accomplish with ProblemDetails data structure with:
- status 404
- detail with message "Service API not existing".
- cause with message "Event API subscription id not found".