Test Plan for Event Filter Feature
At this documentation you will have all information and related files and examples of test plan for this feature.
Test Case 1: Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE_API_UPDATE events filtered by apiIds
Test ID: event_filter-1 Additional Tags: mockserver
Description:
This test case will check an invoker can subscribe to SERVICE_API events and filter them by apiId.
Pre-Conditions:
- Invoker is previously registered and onboarded.
- Two providers registered and with APIs published.
- Mock Server is up and running to receive requests.
- Mock Server is clean.
Execution Steps:
- Register and onboard Invoker
- Register Provider 1 and publish service_1 api:
- Setup provider with Two AEFs.
- Publish service_1 with:
- Two AEFs. (aef_id_1 and aef_id_2)
- apiStatus empty list.
- supportedFeatures 020.
- Register Provider 2 and publish service_2 api:
- Publish service_2 with:
- apiStatus with AEF Id (aef2_id_1)
- supportedFeatures 020
- Publish service_2 with:
- Discover APIs by Invoker:
- filter by aef_id_1
- Only one api will be obtained, store apiId at api_id.
- Subscribe to events:
- Events: SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE, SERVICE_API_UPDATE.
- EventFilter: [apiId], [apiId], [apiId].
- supportedFeatures: C
- Update service_1 api:
- apiStatus with aefIds present on Provider 1.
- SupportedFeatures set to 20
- Remove Provider 1
- Remove Provider 2
Expected Results:
Mock Server received messages must accomplish:
- Three Events have been received.
- Validate received events follow EventNotification data structure, with:
- SERVICE_API_AVAILABLE:
- EventDetail include serviceAPIDescriptions with same Service API description Modified with apiStatus containing aefIds of provider 1
- SERVICE_API_UPDATE:
- EventDetail include serviceAPIDescriptions with same Service API description Modified with apiStatus containing aefIds of provider 1
- SERVICE_API_UNAVAILABLE
- EventDetail include serviceAPIDescriptions with same Service API description Modified with apiStatus containing aefIds of provider 1
- SERVICE_API_AVAILABLE:
Test Case 2: Invoker subscribed to SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE and SERVICE_API_UPDATE events filtered by not valid filters
Test ID: event_filter-2 Additional Tags: smoke
Description:
This test case will check all error response related with wrong filtering options when invoker subscribes to SERVICE_API events.
Pre-Conditions:
- Invoker is previously registered and onboarded.
- Two providers registered and with APIs published.
Execution Steps:
- Register and onboard Invoker
- Register Provider 1 and publish service_1 api:
- Setup provider with Two AEFs.
- Publish service_1 with:
- Two AEFs. (aef_id_1 and aef_id_2)
- apiStatus empty list.
- supportedFeatures 020.
- Register Provider 2 and publish service_2 api:
- Publish service_2 with:
- apiStatus with AEF Id (aef2_id_1)
- supportedFeatures 020
- Publish service_2 with:
- Discover APIs by Invoker:
- filter by aef_id_1
- Only one api will be obtained, store apiId at api_id.
- Subscribe to events:
- Events: SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE, SERVICE_API_UPDATE.
- EventFilter: [aefIds], [empty], [empty].
- supportedFeatures: C
- Subscribe to events:
- Events: SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE, SERVICE_API_UPDATE.
- EventFilter: [empty], [aefIds], [empty].
- supportedFeatures: C
- Subscribe to events:
- Events: SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE, SERVICE_API_UPDATE.
- EventFilter: [empty], [empty], [aefIds].
- supportedFeatures: C
- Subscribe to events:
- Events: SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE, SERVICE_API_UPDATE.
- EventFilter: [empty], [empty], [apiInvokerIds].
- supportedFeatures: C
Expected Results:
We will receive one error after each Event subscription:
- Response to first subscription:
- 400 Bad Request
- ProblemDetails Body with:
- title: Bad Request
- status: 400
- detail: Bad Param
- cause: Invalid eventFilter for event SERVICE_API_AVAILABLE
- invalidParams: [{ param:eventFilter, reason: The eventFilter aef_ids for event SERVICE_API_AVAILABLE are not applicable }]
- Response to first subscription:
- 400 Bad Request
- ProblemDetails Body with:
- title: Bad Request
- status: 400
- detail: Bad Param
- cause: Invalid eventFilter for event SERVICE_API_UNAVAILABLE
- invalidParams: [{ param:eventFilter, reason: The eventFilter aef_ids for event SERVICE_API_UNAVAILABLE are not applicable }]
- Response to first subscription:
- 400 Bad Request
- ProblemDetails Body with:
- title: Bad Request
- status: 400
- detail: Bad Param
- cause: Invalid eventFilter for event SERVICE_API_UPDATE
- invalidParams: [{ param:eventFilter, reason: The eventFilter aef_ids for event SERVICE_API_UPDATE are not applicable }]
- Response to first subscription:
- 400 Bad Request
- ProblemDetails Body with:
- title: Bad Request
- status: 400
- detail: Bad Param
- cause: Invalid eventFilter for event SERVICE_API_UPDATE
- invalidParams: [{ param:eventFilter, reason: The eventFilter api_invoker_ids for event SERVICE_API_UPDATE are not applicable }]
Test Case 3: Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INVOKER_UPDATED events filtered by invokerIds
Test ID: event_filter-3 Additional Tags: mockserver
Description:
This test case will check subcription to all API_INVOKER events by one provider.
Pre-Conditions:
- Provider is previously registered.
- Mock Server is up and running to receive requests.
- Mock Server is clean.
Execution Steps:
- Register Provider 1.
- Subscribe to events:
- Events: API_INVOKER_ONBOARDED
- EventFilter: No filter.
- supportedFeatures: C
- Register and onboard Invoker 1
- Register and onboard Invoker 2
- Subscribe provider to events:
- Events: API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED, API_INVOKER_UPDATED
- EventFilter: [empty], [apiInvokerId1], [apiInvokerId2].
- supportedFeatures: C
- Update Invoker 1:
- Setup new notificationDestination at invoker.
- Update Invoker 2:
- Setup new notificationDestination at invoker.
- Remove Invoker 1.
- Remove Invoker 2.
Expected Results:
Mock Server received messages must accomplish:
- Four Events have been received.
- Validate received events follow EventNotification data structure, with:
- API_INVOKER_ONBOARDED:
- EventDetail include apiInvokerIds with apiInvokerId of provider 1
- API_INVOKER_ONBOARDED:
- EventDetail include apiInvokerIds with apiInvokerId of provider 2
- API_INVOKER_UPDATED:
- EventDetail include apiInvokerIds with apiInvokerId of provider 2
- API_INVOKER_OFFBOARDED
- EventDetail include apiInvokerIds with apiInvokerId of provider 1
- API_INVOKER_ONBOARDED:
Test Case 4: Provider subscribed to API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED and API_INVOKER_UPDATED events filtered by not valid filters
Test ID: event_filter-4 Additional Tags:
Description:
This test will check API_INVOKER events subscription by Provider with not valid filters.
Pre-Conditions:
- Provider is previously registered.
Execution Steps:
- Register Provider 1.
- Register and onboard Invoker 1
- Register and onboard Invoker 2
- Subscribe provider to events:
- Subscription 1
- Events: API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED, API_INVOKER_UPDATED
- EventFilter: [aefIds], [empty], [empty].
- supportedFeatures: C
- Subscribe provider to events:
- Subscription 2
- Events: API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED, API_INVOKER_UPDATED
- EventFilter: [empty], [aefIds], [empty].
- supportedFeatures: C
- Subscribe provider to events:
- Subscription 3
- Events: API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED, API_INVOKER_UPDATED
- EventFilter: [empty], [empty], [aefIds].
- supportedFeatures: C
- Subscribe provider to events:
- Subscription 4
- Events: API_INVOKER_ONBOARDED, API_INVOKER_OFFBOARDED, API_INVOKER_UPDATED
- EventFilter: [empty], [empty], [apiIds].
- supportedFeatures: C
Expected Results:
- Response to first subscription:
- 400 Bad Request
- ProblemDetails Body with:
- title: Bad Request
- status: 400
- detail: Bad Param
- cause: Invalid eventFilter for event API_INVOKER_ONBOARDED
- invalidParams: [{ param:eventFilter, reason: The eventFilter aef_ids for event API_INVOKER_ONBOARDED are not applicable }]
- Response to second subscription:
- 400 Bad Request
- ProblemDetails Body with:
- title: Bad Request
- status: 400
- detail: Bad Param
- cause: Invalid eventFilter for event API_INVOKER_OFFBOARDED
- invalidParams: [{ param:eventFilter, reason: The eventFilter aef_ids for event API_INVOKER_OFFBOARDED are not applicable }]
- Response to third subscription:
- 400 Bad Request
- ProblemDetails Body with:
- title: Bad Request
- status: 400
- detail: Bad Param
- cause: Invalid eventFilter for event API_INVOKER_UPDATED
- invalidParams: [{ param:eventFilter, reason: The eventFilter aef_ids for event API_INVOKER_UPDATED are not applicable }]
- Response to fourth subscription:
- 400 Bad Request
- ProblemDetails Body with:
- title: Bad Request
- status: 400
- detail: Bad Param
- cause: Invalid eventFilter for event API_INVOKER_UPDATED
- invalidParams: [{ param:eventFilter, reason: The eventFilter api_ids for event API_INVOKER_UPDATED are not applicable }]
Test Case 5: Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by only apiId, only invokerId and both
Test ID: event_filter-5 Additional Tags: smoke, mockserver
Description:
This test case will check subcription to ACCESS_CONTROL_POLICY_UPDATE event by one provider.
Pre-Conditions:
- Two Providers are previously registered and published APIs
- Two invoker are previously registered.
- Mock Server is up and running to receive requests.
- Mock Server is clean.
Execution Steps:
- Register Provider 1 and publish service_1 api:
- Store apiId1
- Register Provider 2 and publish service_2 api:
- Store apiId2
- Register and onboard Invoker 1
- apiInvokerId1
- Register and onboard Invoker 2
- apiInvokerId2
- Subscribe to events:
- Subscription1
- Events: ACCESS_CONTROL_POLICY_UPDATE
- EventFilter: [apiId1].
- supportedFeatures: C
- Subscribe to events:
- Subscription2
- Events: ACCESS_CONTROL_POLICY_UPDATE
- EventFilter: [apiInvokerId1].
- supportedFeatures: C
- Subscribe to events:
- Subscription3
- Events: ACCESS_CONTROL_POLICY_UPDATE
- EventFilter: [apiInvokerId2] and [apiId2].
- supportedFeatures: C
- Create Security Context Between Invoker 1 and provider 1 exposed API.
- Store acl_provider_1
- Create Security Context Between Invoker 2 and provider 1 exposed API.
- Store acl_provider_1 (array will contain 2 values)
- Create Security Context Between Invoker 1 and provider 2 exposed API.
- Store acl_provider_2 (array will contain 2 values)
- Create Security Context Between Invoker 2 and provider 2 exposed API.
- Store acl_provider_2 (array will contain 2 values)
Expected Results:
- Eight Events have been received for 3 different subscriptions.
- Validate received events follow EventNotification data structure
- Subcription 1:
- ACCESS_CONTROL_POLICY_UPDATE:
- EventDetail include accCtrlPolList with apiId1 and apiInvokerPolicies with Security Context between invoker 1 and provider 1 (acl_provider_1[0])
- ACCESS_CONTROL_POLICY_UPDATE:
- EventDetail include accCtrlPolList with apiId1 and apiInvokerPolicies with Security Context between invoker 2 and provider 1 (acl_provider_1[1])
- ACCESS_CONTROL_POLICY_UPDATE:
- EventDetail include accCtrlPolList with apiId2 and apiInvokerPolicies with Security Context between invoker 1 and provider 2 (acl_provider_2[0])
- ACCESS_CONTROL_POLICY_UPDATE:
- EventDetail include accCtrlPolList with apiId1 and apiInvokerPolicies with Security Context between invoker 2 and provider 2 (acl_provider_2[1])
- ACCESS_CONTROL_POLICY_UPDATE:
- Subcription 2:
- ACCESS_CONTROL_POLICY_UPDATE:
- EventDetail include accCtrlPolList with apiId1 and apiInvokerPolicies with Security Context between invoker 1 and provider 1 (acl_provider_1[0])
- ACCESS_CONTROL_POLICY_UPDATE:
- EventDetail include accCtrlPolList with apiId1 and apiInvokerPolicies with Security Context between invoker 1 and provider 1 (acl_provider_1[0])
- ACCESS_CONTROL_POLICY_UPDATE:
- EventDetail include accCtrlPolList with apiId2 and apiInvokerPolicies with Security Context between invoker 1 and provider 2 (acl_provider_2[0])
- ACCESS_CONTROL_POLICY_UPDATE:
- Subcription 3:
- ACCESS_CONTROL_POLICY_UPDATE:
- EventDetail include accCtrlPolList with apiId2 and apiInvokerPolicies with Security Context between invoker 2 and provider 2 (acl_provider_2[1])
- ACCESS_CONTROL_POLICY_UPDATE:
Test Case 6: Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE event filtered by aefId
Test ID: event_filter-6 Additional Tags:
Description:
This test will check ACCESS_CONTROL_POLICY_UPDATE event subscription by Provider with not valid filters.
Pre-Conditions:
- One Provider is previously registered.
Execution Steps:
- Register Provider 1.
- Subscribe to events:
- Subscription1
- Events: ACCESS_CONTROL_POLICY_UPDATE
- EventFilter: [aef_ids].
- supportedFeatures: C
Expected Results:
- Response to subscription:
- 400 Bad Request
- ProblemDetails Body with:
- title: Bad Request
- status: 400
- detail: Bad Param
- cause: Invalid eventFilter for event ACCESS_CONTROL_POLICY_UPDATE
- invalidParams: [{ param:eventFilter, reason: The eventFilter aef_ids for event ACCESS_CONTROL_POLICY_UPDATE are not applicable }]
Test Case 7: Provider subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE filtered by apiId, invokerId, aefId and all of them
Test ID: event_filter-7 Additional Tags: smoke, mockserver
Description:
This test will check all possible filters options allowed for SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE.
Pre-Conditions:
- Two Providers are previously registered and published APIs
- Two invoker are previously registered.
- Mock Server is up and running to receive requests.
- Mock Server is clean.
Execution Steps:
- Register Provider 1 and publish service_1 api:
- Store apiId1
- Store aefId1
- Register Provider 2 and publish service_2 api:
- Store apiId2
- Store aefId2
- Register and onboard Invoker 1
- apiInvokerId1
- Register and onboard Invoker 2
- apiInvokerId2
- Subscribe provider 1 to events:
- Subscription 1
- Events: SERVICE_API_INVOCATION_SUCCESS, SERVICE_API_INVOCATION_FAILURE.
- EventFilter: [apiId1], [apiId1].
- supportedFeatures: C
- Subscribe provider 1 to events:
- Subscription 2
- Events: SERVICE_API_INVOCATION_SUCCESS, SERVICE_API_INVOCATION_FAILURE.
- EventFilter: [apiId1], [apiId1].
- supportedFeatures: C
- Subscribe provider 1 to events:
- Subscription 3
- Events: SERVICE_API_INVOCATION_SUCCESS, SERVICE_API_INVOCATION_FAILURE.
- EventFilter: [apiId1], [apiId1].
- supportedFeatures: C
- Subscribe provider 1 to events:
- Subscription 4
- Events: SERVICE_API_INVOCATION_SUCCESS, SERVICE_API_INVOCATION_FAILURE.
- EventFilter: [apiId1], [apiId1].
- supportedFeatures: C
- Subscribe provider 1 to events:
- Subscription 5
- Events: SERVICE_API_INVOCATION_SUCCESS, SERVICE_API_INVOCATION_FAILURE.
- EventFilter: [apiId1], [apiId1].
- supportedFeatures: C
- Subscribe provider 1 to events:
- Subscription 6
- Events: SERVICE_API_INVOCATION_SUCCESS, SERVICE_API_INVOCATION_FAILURE.
- EventFilter: [apiId1], [apiId1].
- supportedFeatures: C
- Subscribe provider 1 to events:
- Subscription 7
- Events: SERVICE_API_INVOCATION_SUCCESS, SERVICE_API_INVOCATION_FAILURE.
- EventFilter: [apiId1], [apiId1].
- supportedFeatures: C
- Send Log entry by provider1:
- apiNames: [service_1]
- apiIds: [apiId1]
- aefId: aefId1
- apiInvokerId: apiInvokerId1
- results: [200, 400]
- Store body to request_body_log_1
- Send Log entry by provider2:
- apiNames: [service_2]
- apiIds: [apiId2]
- aefId: aefId2
- apiInvokerId: apiInvokerId1
- results: [200]
- Store body to request_body_log_2
- Send Log entry by provider2:
- apiNames: [service_2]
- apiIds: [apiId2]
- aefId: aefId2
- apiInvokerId: apiInvokerId2
- results: [200]
- Store body to request_body_log_3
- Send Log entry by provider1:
- apiNames: [service_1]
- apiIds: [apiId1]
- aefId: aefId1
- apiInvokerId: apiInvokerId2
- results: [400]
- Store body to request_body_log_4
Expected Results:
- Thirteen Events have been received for 7 different subscriptions.
- Validate received events follow EventNotification data structure
- Subcription 1:
- SERVICE_API_INVOCATION_SUCCESS:
- EventDetail include invocationLogs with request_body_log_1
- SERVICE_API_INVOCATION_FAILURE:
- EventDetail include invocationLogs with request_body_log_1
- SERVICE_API_INVOCATION_FAILURE:
- EventDetail include invocationLogs with request_body_log_4
- SERVICE_API_INVOCATION_SUCCESS:
- Subcription 2:
- SERVICE_API_INVOCATION_SUCCESS:
- EventDetail include invocationLogs with request_body_log_2
- SERVICE_API_INVOCATION_SUCCESS:
- EventDetail include invocationLogs with request_body_log_3
- SERVICE_API_INVOCATION_SUCCESS:
- Subcription 3:
- SERVICE_API_INVOCATION_SUCCESS:
- EventDetail include invocationLogs with request_body_log_1
- SERVICE_API_INVOCATION_SUCCESS:
- EventDetail include invocationLogs with request_body_log_1
- SERVICE_API_INVOCATION_SUCCESS:
- EventDetail include invocationLogs with request_body_log_2
- SERVICE_API_INVOCATION_SUCCESS:
- Subcription 4:
- SERVICE_API_INVOCATION_SUCCESS:
- EventDetail include invocationLogs with request_body_log_2
- SERVICE_API_INVOCATION_SUCCESS:
- EventDetail include invocationLogs with request_body_log_3
- SERVICE_API_INVOCATION_SUCCESS:
- Subcription 5:
- SERVICE_API_INVOCATION_SUCCESS:
- EventDetail include invocationLogs with request_body_log_3
- SERVICE_API_INVOCATION_SUCCESS:
- Subcription 6:
- SERVICE_API_INVOCATION_FAILURE:
- EventDetail include invocationLogs with request_body_log_4
- SERVICE_API_INVOCATION_FAILURE:
- Subcription 7:
- SERVICE_API_INVOCATION_SUCCESS:
- EventDetail include invocationLogs with request_body_log_3
- SERVICE_API_INVOCATION_SUCCESS:
Test Case 8: Event Filter present with Enhanced_event_report feature not active.
Test ID: event_filter-8 Additional Tags: smoke
Description:
This test will check event subscription by Invoker with eventFilter attribute but without Enhanced_event_report feature active.
Pre-Conditions:
- Invoker is previously registered and onboarded.
Execution Steps:
- Register and onboard Invoker
- Subscribe to events:
- Events: SERVICE_API_AVAILABLE, SERVICE_API_UNAVAILABLE, SERVICE_API_UPDATE
- EventFilter: [empty], [empty], [empty].
- supportedFeatures: 0
Expected Results:
- Response to subscription:
- 400 Bad Request
- ProblemDetails Body with:
- title: Bad Request
- status: 400
- detail: Bad Param
- cause: Event filters provided but EnhancedEventReport is not enabled
- invalidParams: [{ param:eventFilter, reason: EnhancedEventReport is not enabled }]