diff --git a/doc/releasenotes.md b/doc/releasenotes.md index 7ea641d6b045b6983caaac543071fa35d7c09acd..b0a7aada77e9be8c1053d08b6088476eaac7637c 100644 --- a/doc/releasenotes.md +++ b/doc/releasenotes.md @@ -1,3 +1,85 @@ +## **Release 2.0.0** + +### **New Features** + +#### 3GPP CAPIF release 18 + +- New endpoints included in new release 18 with new logic. +- New logic to support ***Vendor Extensibility*** on Publish Service. +- New logic to support ***API Status*** feature on Publish and Events Services. +- Supported Features now are mandatory for all POST and PUT Requests as is described on TS 29.222. + - **Possible Breaking change**, all POST request now must include supported features attribute, default can me set to "0" to keep all features inactive. + - **Possible Breaking change** on Events API, if you need eventDetails information on notification you must activate **Enhanced Event Report** feature by setting properly the supported features flag. + +### **Technical Debt Solved** + +#### **Api Status feature** + +- Events API: + - Event internal notifications between services improved to accomplish specification. + - On event subscription **SupportedFeatures** is readed and stored in db to accomplish specification. + - Also **SupportedFeatures** is checked before send event notification, in order to accomplish specification, sending **eventDetails** and related information according to ***enhanced_event_report*** and ***apiStatusMonitoring*** supported features activated. + +#### **Issues** + +- Solved issue to get ready REDIS on deployment: REDIS scheduled on start to allow receive notification since service is deployed. +- Solved problem removing service APIs published is provider register more than one APF. +- Solved Superadmin problem deleting service API published through helper service if provider is not present. +- Increased the overall stability, fixing some corner cases. +- Location headers now are filled in same way at all services that needs it. +- Security issues solved. +- Base docker images present on ETSI registry. +- Robot image uploaded to ETSI Registry. + +#### Local Scripts + +- All scripts were reviewed and improved. +- New scripts to manage users on local deployment added: + - create_users.sh: helps developer to create new users in local deployment. + - remove_users.sh: helps developer to remove users from db in local deployment. + +#### Remote Scripts + +New scripts developed to help on remote deployment, configuration and testing. All this script are stored under helm/scripts in capif repository. + +***variables.sh*** contains all configuration that will be used on remote operation. This file must be filled carefully before run remote scripts. + +- Deployment Scripts: + - ***install_vault.sh***: Deploy Vault component from k8s cluster, only needed if vault is not previously deployed. If it’s deployed you can setup vault token on variables.sh. + - ***install_monitoring.sh***: Deploy monitoring on k8s cluster. + - ***install_capif.sh***: Deploy OpenCAPIF on k8s cluster. It will be deployed on configured namespace with domain and hostnames configured under variables.sh. + - ***uninstall_vault.sh***: Rollback Vault component from k8s cluster. + - ***uninstall_monitoring.sh***: Rollback monitoring components from k8s cluster. + - ***uninstall_capif.sh***: Rollback OpenCAPIF from k8s cluster. + +- Manage remote users: + - ***create_remote_users.sh***: This script create users setup by parameters on deployed OpenCAPIF. Those users are created by administrator. + - ***remove_remote_users.sh***: This script removes user from deployed OpenCAPIF. + - ***remove_remote_users_by_prefix.sh***:: This script removes users by prefix. + +- Configuration of bastion machine, this simplify DNS fixed resolution: + - ***get_ingress.sh***: This create a configuration for dns fixed resolution for ingress configured in namespace passed by parameters. + - ***set_ingress.sh***: This scripts adds to /etc/hosts the fixed DNS resolution for ingress setup for namespace passed by parameters. + +- Execute robot tests over remote deployment. + - ***run_remote_capif_tests.sh***: This scripts launch Robot Test docker image on current machine to reach deployed OpenCAPIF. Is useful to launch with “--include smoke” in order to ensure all is deployed properly. + +- Just for testing, next scripts upload dummy information to deployed OpenCAPIF: + - ***populate_create_remote_dummy_users.sh***: : Create Dummy providers and invokers, publish service APIs and creates security context for invokers. + - ***populate_remove_remote_dummy_users.sh***: Remove dummy information created. + + +### **Documentation** + +#### New test included on documentation + +- New Vendor Extensibility test suite with 9 tests. [Api Events Service](./testing/testplan/vendor_extensibility/README.md) +- New [API Status feature](./testing/testplan/api_status/README.md) test suite. +- Improved [Events test suite](./testing/testplan/api_events_service/README.md) with 8 new tests. +- Test plan updated with default supported features for all request set to "0" (all inactive by default) [See common operations](./testing/testplan/common_operations/README.md). + +--- + ## **Release 1.0.0** ### **New Features** @@ -179,5 +261,5 @@ This Release also includes a Robot Test Suite for all those services and a Postm [OCF Event test plan documentation]: https://ocf.etsi.org/documentation/latest/testing/testplan/api_events_service/ "OCF Event test plan documentation" [OCF Registration Flow]: https://ocf.etsi.org/documentation/latest/testing/testplan/common_operations/ "OCF Registration Flow" [New Registration Demo]: https://www.youtube.com/watch?v=sn-tN6eRvv8 "New Registration Demo" -[CICD Wiki]: [https://](https://labs.etsi.org/rep/ocf/community/-/wikis/OCF-CICD) "CI/CD Wiki" -[Upgrade Release 17 to 18 Wiki]: [https://](https://labs.etsi.org/rep/ocf/community/-/wikis/?¿?¿?¿?¿?) "Upgrade Release 17 to 18 Wiki" +[CICD Wiki]: https://labs.etsi.org/rep/ocf/community/-/wikis/OCF-CICD "CI/CD Wiki" +[Upgrade Release 17 to 18 Wiki]: https://labs.etsi.org/rep/ocf/community/-/wikis/?¿?¿?¿?¿? "Upgrade Release 17 to 18 Wiki" diff --git a/doc/testing/testplan/README.md b/doc/testing/testplan/README.md index 33301ea3d69e153a2eeac5b52bac5b12a6352ff1..11b19c8367e73fdd96988192201a7f214ac06257 100644 --- a/doc/testing/testplan/README.md +++ b/doc/testing/testplan/README.md @@ -14,3 +14,4 @@ List of Common API Services implemented: ## Features * [Vendor Extensibility](./vendor_extensibility/README.md) +* [Api Status](./api_status/README.md) diff --git a/doc/testing/testplan/api_access_control_policy/service_api_description_post_example.json b/doc/testing/testplan/api_access_control_policy/service_api_description_post_example.json index b725b428629509bf39a79c030f1bf93f4b6f18f6..10022ce8072b83cc302647a2fda42095d57e7d4e 100644 --- a/doc/testing/testplan/api_access_control_policy/service_api_description_post_example.json +++ b/doc/testing/testplan/api_access_control_policy/service_api_description_post_example.json @@ -95,7 +95,7 @@ } ], "description": "string", - "supportedFeatures": "fffff", + "supportedFeatures": "0", "shareableInfo": { "isShareable": true, "capifProvDoms": [ diff --git a/doc/testing/testplan/api_events_service/README.md b/doc/testing/testplan/api_events_service/README.md index 73106b7145ca7600a988601d0fa624903e26d087..6ecb183a9f6010eee14e7941763dc47535b0ad5b 100644 --- a/doc/testing/testplan/api_events_service/README.md +++ b/doc/testing/testplan/api_events_service/README.md @@ -264,6 +264,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Invoker subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE, receive the notification when AEF Send **TO** logging service result of invocations to their APIs. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -278,7 +279,7 @@ At this documentation you will have all information and related files and exampl 1. Register provider and publish one API at CCF 2. Register Invoker and Onboard Invoker at CCF 3. Discover published APIs and extract apiIds and apiNames - 4. Subscribe to **SERVICE_API_INVOCATION_SUCCESS** and **SERVICE_API_INVOCATION_FAILURE** event filtering by aefId. + 4. Subscribe to **SERVICE_API_INVOCATION_SUCCESS** and **SERVICE_API_INVOCATION_FAILURE** event filtering by aefId. Enhanced_event_report active at supported features. 5. Retrieve {subscriberId} and {subscriptionId} from Location Header 6. Emulate Success and Failure on API invocation of provider by Invoker, using Invocation Logs API. @@ -302,9 +303,10 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['SERVICE_API_INVOCATION_SUCCESS','SERVICE_API_INVOCATION_FAILURE']** 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Invoker Certificate** - 7. Create Log Entry emulating provider receive Success and Failure api invocation from invoker: + 6. Create Log Entry emulating provider receive Success and Failure api invocation from invoker: 1. Send **POST** to **https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs** 2. body [log entry request body] with: 1. aefId from provider published. @@ -336,7 +338,8 @@ At this documentation you will have all information and related files and exampl **Description**: - This test case will check that a CAPIF Invoker subscribed to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE, receive the notification when AEF publish and remove it. + This test case will check that a CAPIF Invoker subscribed to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE, receive the notification when AEF publish and remove it. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -350,7 +353,7 @@ At this documentation you will have all information and related files and exampl 1. Register provider and publish one API at CCF 2. Register Invoker and Onboard Invoker at CCF 3. Discover published APIs and extract apiIds and apiNames - 4. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE** event filtering by aefId. + 4. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE** event filtering by aefId. Enhanced_event_report active at supported features. 5. Retrieve {subscriberId} and {subscriptionId} from Location Header 6. Provider publish new API. 7. Provider remove published API. @@ -375,6 +378,7 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Invoker Certificate** 6. Publish new Service API at CCF: @@ -410,6 +414,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Invoker subscribed to SERVICE_API_UPDATE, receive the notification when AEF Update some information on API Published. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -424,7 +429,7 @@ At this documentation you will have all information and related files and exampl 1. Register Provider and publish one API at CCF 2. Register Invoker and Onboard Invoker at CCF 3. Discover published APIs and extract apiIds and apiNames - 4. Subscribe to **SERVICE_API_UPDATE** event filtering by aefId. + 4. Subscribe to **SERVICE_API_UPDATE** event filtering by aefId. Enhanced_event_report active at supported features. 5. Retrieve {subscriberId} and {subscriptionId} from Location Header at event subscription 6. Provider update information of Service API Published. @@ -449,6 +454,7 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['SERVICE_API_UPDATE']** 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Invoker Certificate** 7. Update published API at CCF: @@ -479,6 +485,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Provider subscribed to API Invoker events (API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED), receive the notifications when Invoker is onboarded, updated and removed respectively. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -490,7 +497,7 @@ At this documentation you will have all information and related files and exampl **Execution Steps**: 1. Register Provider at CCF - 2. Subscribe Provider to **API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED** events. + 2. Subscribe Provider to **API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED** events. Enhanced_event_report active at supported features. 3. Register Invoker and Onboard Invoker at CCF 4. Update Onboarding Information at CCF with a minor change on "notificationDestination" 5. Offboard Invoker @@ -503,6 +510,7 @@ At this documentation you will have all information and related files and exampl 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** 2. body [event subscription request body] with: 1. events: **['API_INVOKER_ONBOARDED', 'API_INVOKER_UPDATED', 'API_INVOKER_OFFBOARDED']** + 2. supportedFeatures: binary 0100 -> string **4** 3. Use **Provider AMF Certificate** 4. Perform [invoker onboarding] 5. Update information of previously onboarded Invoker: @@ -543,6 +551,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE receive a notification when ACL Changes. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -558,7 +567,7 @@ At this documentation you will have all information and related files and exampl 1. Register Provider at CCF. 2. Publish a provider API with name **service_1**. 3. Register Invoker and Onboard Invoker at CCF. - 4. Subscribe Provider to **ACCESS_CONTROL_POLICY_UPDATE** event. + 4. Subscribe Provider to **ACCESS_CONTROL_POLICY_UPDATE** event. Enhanced_event_report active at supported features. 5. Discover APIs filtered by **aef_id** 6. Create Security Context for Invoker. 7. Provider Retrieve ACL @@ -573,6 +582,7 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['ACCESS_CONTROL_POLICY_UPDATE']** 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Provider AMF Certificate** 5. Discover published APIs 6. Create Security Context for Invoker @@ -613,6 +623,7 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Invoker subscribed to ACCESS_CONTROL_POLICY_UNAVAILABLE will receive the notification when AEF remove Security Context created previously. + Enhanced Event Report feature must be active. **Pre-Conditions**: @@ -627,7 +638,7 @@ At this documentation you will have all information and related files and exampl 1. Register Provider at CCF. 2. Publish a provider API with name **service_1**. 3. Register Invoker and Onboard Invoker at CCF. - 4. Subscribe Invoker to **ACCESS_CONTROL_POLICY_UNAVAILABLE** event. + 4. Subscribe Invoker to **ACCESS_CONTROL_POLICY_UNAVAILABLE** event. Enhanced_event_report active at supported features. 5. Discover APIs filtered by **aef_id** 6. Create Security Context for Invoker. 7. Provider Retrieve ACL. @@ -643,6 +654,7 @@ At this documentation you will have all information and related files and exampl 2. body [event subscription request body] with: 1. events: **['ACCESS_CONTROL_POLICY_UNAVAILABLE']** 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. supportedFeatures: binary 0100 -> string **4** 3. Use **Invoker Certificate** 5. Discover published APIs 6. Create Security Context for Invoker @@ -653,7 +665,7 @@ At this documentation you will have all information and related files and exampl * Send **GET** **https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}** * Use **serviceApiId** and **aefId** * Use **AEF Provider Certificate** - 3. Delete Security Context of Invoker by Provider: + 8. Delete Security Context of Invoker by Provider: * Send **DELETE** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}** * Use **AEF Certificate** @@ -687,6 +699,557 @@ At this documentation you will have all information and related files and exampl **Description**: This test case will check that a CAPIF Invoker subscribed to API_INVOKER_AUTHORIZATION_REVOKED and ACCESS_CONTROL_POLICY_UNAVAILABLE receive both notification when AEF revoke invoker's authorization. + Enhanced Event Report feature must be active. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered. + * API Provider had one Service API Published on CAPIF + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Provider at CCF. + 2. Publish a provider API with name **service_1**. + 3. Register Invoker and Onboard Invoker at CCF. + 4. Subscribe Invoker to **ACCESS_CONTROL_POLICY_UNAVAILABLE and API_INVOKER_AUTHORIZATION_REVOKED** events. Enhanced_event_report active at supported features. + 5. Discover APIs filtered by **aef_id** + 6. Create Security Context for Invoker. + 7. Revoke Authorization by Provider. + +**Information of Test**: + + 1. Check and Clean Mock Server + 2. Perform [provider registration] + 3. Perform [invoker onboarding] + 4. Event Subscription to **ACCESS_CONTROL_POLICY_UNAVAILABLE and API_INVOKER_AUTHORIZATION_REVOKED** event: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['ACCESS_CONTROL_POLICY_UNAVAILABLE','API_INVOKER_AUTHORIZATION_REVOKED']** + 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. supportedFeatures: binary 0100 -> string **4** + 3. Use **Invoker Certificate** + 5. Discover published APIs + 6. Create Security Context for Invoker + * Send **PUT** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}** + * body [service security body] + * Use **Invoker Certificate** + 7. Revoke Authorization by Provider: + * Send **POST** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}/delete** + * body [security notification body] + * Using **AEF Certificate**. + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Create security context: + 1. **201 Created** response. + 2. body returned must accomplish **ServiceSecurity** data structure. + 3. Location Header must contain the new resource URL **{apiRoot}/capif-security/v1/trustedInvokers/{apiInvokerId}** + 4. Revoke Authorization: + 1. **204 No Content** response. + 5. Mock Server received messages must accomplish: + 1. **Two Events has been received**. + 2. Validate received event follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One Event should be **ACCESS_CONTROL_POLICY_UNAVAILABLE** without **eventDetail**. + 2. One Event should be **API_INVOKER_AUTHORIZATION_REVOKED** without **eventDetail**. + +--- +## Test Case 13: Creates a new individual CAPIF Event Subscription without supported features attribute. + +**Test ID**: ***capif_api_events-13*** + +**Description**: + + This test case will check error when CAPIF subscriber (Invoker or Publisher) Subscribe to Events without supported features attribute. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF + 2. Subscribe to Events without supported features + 3. Retrieve {subscriberId} and {subscriptionId} from Location Header + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + + 2. Event Subscription: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] + 1. supportedFeatures NOT PRESENT. + 3. Use **Invoker Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + + 1. Response to Event Subscription must accomplish: + 1. **400 Bad Request** + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 400 + * title with message "Bad Request" + * detail with message "supportedFeatures not present in request". + * cause with message "supportedFeatures not present". + +--- + +## Test Case 14: Invoker receives Service API Invocation events without Enhanced Event Report + +**Test ID**: ***capif_api_events-14***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Invoker subscribed to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE, receive the notification when AEF Send **TO** logging service result of invocations to their APIs. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered and published APIs. + * API Provider had a Service API Published on CAPIF + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register provider and publish one API at CCF + 2. Register Invoker and Onboard Invoker at CCF + 3. Discover published APIs and extract apiIds and apiNames + 4. Subscribe to **SERVICE_API_INVOCATION_SUCCESS** and **SERVICE_API_INVOCATION_FAILURE** event filtering by aefId. Enhanced_event_report inactive at supported features. + 5. Retrieve {subscriberId} and {subscriptionId} from Location Header + 6. Emulate Success and Failure on API invocation of provider by Invoker, using Invocation Logs API. + +**Information of Test**: + + 1. Perform [provider registration] + 2. Publish Service API at CCF: + + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with apiName **service_1** + * Store **serviceApiId** + * Use **APF Certificate** + + 3. Perform [invoker onboarding] + 4. Discover published APIs: + + * Get **Api Ids** And **Api Names** from response. + + 5. Event Subscription to SERVICE_API_INVOCATION_SUCCESS and SERVICE_API_INVOCATION_FAILURE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_INVOCATION_SUCCESS','SERVICE_API_INVOCATION_FAILURE']** + 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + + 6. Create Log Entry emulating provider receive Success and Failure api invocation from invoker: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs** + 2. body [log entry request body] with: + 1. aefId from provider published. + 2. apiInvokerId from invoker onboarded. + 3. apiId of published API + 4. apiName of published API + 5. 200 and 400 results in two logs. + 3. Use **AEF Certificate** + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Response to creation of log entry on CCF must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/api-invocation-logs/{apiVersion}/{aefId}/subscriptions/{logId}** + 3. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_INVOCATION_SUCCESS** related with **200** result at Log. + 2. The other one must be **SERVICE_API_INVOCATION_FAILURE** related with **400** result at Log. + +--- +## Test Case 15: Invoker subscribe to Service API Available and Unavailable events without Enhanced Event Report + +**Test ID**: ***capif_api_events-15***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Invoker subscribed to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE, receive the notification when AEF publish and remove it. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered and published APIs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register provider and publish one API at CCF + 2. Register Invoker and Onboard Invoker at CCF + 3. Discover published APIs and extract apiIds and apiNames + 4. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE** event filtering by aefId. Enhanced_event_report inactive at supported features. + 5. Retrieve {subscriberId} and {subscriptionId} from Location Header + 6. Provider publish new API. + 7. Provider remove published API. + +**Information of Test**: + + 1. Perform [provider registration] + 2. Publish Service API at CCF: + + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with apiName **service_1** + * Store **serviceApiId** + * Use **APF Certificate** + + 3. Perform [invoker onboarding] + 4. Discover published APIs: + + * Get **Api Ids** And **Api Names** from response. + + 5. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + + 6. Publish new Service API at CCF: + + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with apiName **service_2** + * Store **serviceApiId** + * Use **APF Certificate** + + 7. Remove published Service API at CCF: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + + 2. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of **service_2** published API. + 2. The other one must be **SERVICE_API_UNAVAILABLE** apiId of **service_1** published API. + +--- +## Test Case 16: Invoker subscribe to Service API Update without Enhanced Event Report + +**Test ID**: ***capif_api_events-16***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Invoker subscribed to SERVICE_API_UPDATE, receive the notification when AEF Update some information on API Published. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered and published APIs. + * API Provider had a Service API Published on CAPIF + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Provider and publish one API at CCF + 2. Register Invoker and Onboard Invoker at CCF + 3. Discover published APIs and extract apiIds and apiNames + 4. Subscribe to **SERVICE_API_UPDATE** event filtering by aefId. Enhanced_event_report inactive at supported features. + 5. Retrieve {subscriberId} and {subscriptionId} from Location Header at event subscription + 6. Provider update information of Service API Published. + +**Information of Test**: + + 1. Check and Clean Mock Server + 2. Perform [provider registration] + 3. Publish Service API at CCF: + + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with apiName **service_1** + * Use ***APF Certificate*** + * Store **serviceApiId** + + 4. Perform [invoker onboarding] + 5. Discover published APIs: + + * Get **Api Ids** And **Api Names** from response. + + 6. Event Subscription to SERVICE_API_UPDATE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_UPDATE']** + 2. eventFilter: only receive events from provider's aefId. + 3. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + + 7. Update published API at CCF: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{serivceApiId}** + * body [service api description] with overrided **apiName** to **service_1**_modified** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Response to Update Published Service API: + 1. **200 OK** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiName **service_1**_modified** + 3. Mock Server received messages must accomplish: + 1. **One Event has been received**. + 2. Validate received events follow **EventNotification** data structure, with **serviceAPIDescriptions** in **eventDetail** parameter. + 1. Event should be **SERVICE_API_UPDATE** with **eventDetail** with modified **apiName**. + +--- +## Test Case 17: Provider subscribe to API Invoker events without Enhanced Event Report + +**Test ID**: ***capif_api_events-17***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Provider subscribed to API Invoker events (API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED), receive the notifications when Invoker is onboarded, updated and removed respectively. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Provider at CCF + 2. Subscribe Provider to **API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED** events. Enhanced_event_report inactive at supported features. + 3. Register Invoker and Onboard Invoker at CCF + 4. Update Onboarding Information at CCF with a minor change on "notificationDestination" + 5. Offboard Invoker + +**Information of Test**: + + 1. Check and Clean Mock Server + 2. Perform [provider registration] + 3. Event Subscription to API_INVOKER_ONBOARDED, API_INVOKER_UPDATED and API_INVOKER_OFFBOARDED events: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['API_INVOKER_ONBOARDED', 'API_INVOKER_UPDATED', 'API_INVOKER_OFFBOARDED']** + 2. supportedFeatures: binary 0100 -> string **4** + 3. Use **Provider AMF Certificate** + 4. Perform [invoker onboarding] + 5. 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**", + 6. Offboard: + * Send **DELETE** to **https://{CAPIF_HOSTNAME}/api-invoker-management/v1/onboardedInvokers/{onboardingId}** + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 3. Response to Update Request (PUT) with minor change must contain: + 1. **200 OK** response. + 2. notificationDestination on response must contain the new value + 4. Response to Offboard Request (DELETE) must contain: + 1. **204 No Content** + 5. Mock Server received messages must accomplish: + 1. **Three Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One Event should be **API_INVOKER_ONBOARDED** + 2. One Event should be **API_INVOKER_UPDATED** + 3. One Event should be **API_INVOKER_OFFBOARDED** +--- +## Test Case 18: Provider subscribed to ACL update event without Enhanced Event Report + +**Test ID**: ***capif_api_events-18***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Provider subscribed to ACCESS_CONTROL_POLICY_UPDATE receive a notification when ACL Changes. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered. + * API Provider had one Service API Published on CAPIF + * API Invoker had a Security Context for the Service API published by provider. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Provider at CCF. + 2. Publish a provider API with name **service_1**. + 3. Register Invoker and Onboard Invoker at CCF. + 4. Subscribe Provider to **ACCESS_CONTROL_POLICY_UPDATE** event. Enhanced_event_report inactive at supported features. + 5. Discover APIs filtered by **aef_id** + 6. Create Security Context for Invoker. + 7. Provider Retrieve ACL + +**Information of Test**: + + 1. Check and Clean Mock Server + 2. Perform [provider registration] + 3. Perform [invoker onboarding] + 4. Event Subscription to **ACCESS_CONTROL_POLICY_UPDATE** event: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['ACCESS_CONTROL_POLICY_UPDATE']** + 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. supportedFeatures: binary 0000 -> string **0** + 3. Use **Provider AMF Certificate** + 5. Discover published APIs + 6. Create Security Context for Invoker + * Send **PUT** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}** + * body [service security body] + * Use **Invoker Certificate** + 7. Provider Retrieve ACL + * Send **GET** **https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}** + * Use **serviceApiId** and **aefId** + * Use AEF Provider Certificate + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Create security context: + 1. **201 Created** response. + 2. body returned must accomplish **ServiceSecurity** data structure. + 3. Location Header must contain the new resource URL **{apiRoot}/capif-security/v1/trustedInvokers/{apiInvokerId}** + 3. ACL Response: + 1. **200 OK** Response. + 2. body returned must accomplish **AccessControlPolicyList** data structure. + 3. apiInvokerPolicies must: + 1. contain only one object. + 2. apiInvokerId must match apiInvokerId registered previously. + 4. Mock Server received messages must accomplish: + 1. **One Event has been received**. + 2. Validate received event follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One Event should be **ACCESS_CONTROL_POLICY_UPDATE**. + +--- +## Test Case 19: Provider receives an ACL unavailable event when invoker remove Security Context without Enhanced Event Report + +**Test ID**: ***capif_api_events-19***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Invoker subscribed to ACCESS_CONTROL_POLICY_UNAVAILABLE will receive the notification when AEF remove Security Context created previously. + Enhanced Event Report feature must be inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered. + * API Provider had one Service API Published on CAPIF + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Provider at CCF. + 2. Publish a provider API with name **service_1**. + 3. Register Invoker and Onboard Invoker at CCF. + 4. Subscribe Invoker to **ACCESS_CONTROL_POLICY_UNAVAILABLE** event. Enhanced_event_report inactive at supported features. + 5. Discover APIs filtered by **aef_id** + 6. Create Security Context for Invoker. + 7. Provider Retrieve ACL. + 8. Remove Security Context for Invoker. + +**Information of Test**: + + 1. Check and Clean Mock Server + 2. Perform [provider registration] + 3. Perform [invoker onboarding] + 4. Event Subscription to **ACCESS_CONTROL_POLICY_UNAVAILABLE** event: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['ACCESS_CONTROL_POLICY_UNAVAILABLE']** + 2. eventFilters: apiInvokerIds array with apiInvokerId of invoker + 3. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + 5. Discover published APIs + 6. Create Security Context for Invoker + * Send **PUT** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}** + * body [service security body] + * Use **Invoker Certificate** + 7. Provider Retrieve ACL + * Send **GET** **https://{CAPIF_HOSTNAME}/access-control-policy/v1/accessControlPolicyList/${serviceApiId}?aef-id=${aef_id}** + * Use **serviceApiId** and **aefId** + * Use **AEF Provider Certificate** + 8. Delete Security Context of Invoker by Provider: + * Send **DELETE** **https://{CAPIF_HOSTNAME}/trustedInvokers/{apiInvokerId}** + * Use **AEF Certificate** + +**Expected Result**: + + 1. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 2. Create security context: + 1. **201 Created** response. + 2. body returned must accomplish **ServiceSecurity** data structure. + 3. Location Header must contain the new resource URL **{apiRoot}/capif-security/v1/trustedInvokers/{apiInvokerId}** + 3. ACL Response: + 1. **200 OK** Response. + 2. body returned must accomplish **AccessControlPolicyList** data structure. + 3. apiInvokerPolicies must: + 1. contain only one object. + 2. apiInvokerId must match apiInvokerId registered previously. + 4. Delete security context: + 1. **204 No Content** response. + 5. Mock Server received messages must accomplish: + 1. **One Event has been received**. + 2. Validate received event follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One Event should be **ACCESS_CONTROL_POLICY_UNAVAILABLE** without **eventDetail**. +--- +## Test Case 20: Invoker receives an Invoker Authorization Revoked and ACL unavailable event when Provider revoke Invoker Authorization without Enhanced Event Report + +**Test ID**: ***capif_api_events-20***, ***mockserver*** + +**Description**: + + This test case will check that a CAPIF Invoker subscribed to API_INVOKER_AUTHORIZATION_REVOKED and ACCESS_CONTROL_POLICY_UNAVAILABLE receive both notification when AEF revoke invoker's authorization. + Enhanced Event Report feature must be inactive. **Pre-Conditions**: @@ -747,6 +1310,7 @@ At this documentation you will have all information and related files and exampl --- + [invoker onboard request body]: ../api_invoker_management/invoker_details_post_example.json "API Invoker Request" [event subscription request body]: ./event_subscription.json "Event Subscription Request" [invoker onboarding]: ../common_operations/README.md#onboard-an-invoker "Invoker Onboarding" @@ -754,6 +1318,6 @@ At this documentation you will have all information and related files and exampl [log entry request body]: ../api_logging_service/invocation_log.json "Log Request Body" [put register body]: ./invoker_details_put_example.json "API Invoker Update Request" [service security body]: ../api_security_service/service_security.json "Service Security Request" -[security notification body]: ./security_notification.json "Security Notification Request" +[security notification body]: ../api_security_service/security_notification.json "Security Notification Request" [Return To All Test Plans]: ../README.md diff --git a/doc/testing/testplan/api_events_service/event_subscription.json b/doc/testing/testplan/api_events_service/event_subscription.json index 40dc09bb1ca5236fa9cb23ff1a25ad5dccd28844..6614530eef0e4f3b0476fe46ea5ea01a8bf0d65b 100644 --- a/doc/testing/testplan/api_events_service/event_subscription.json +++ b/doc/testing/testplan/api_events_service/event_subscription.json @@ -23,7 +23,7 @@ "events": ["SERVICE_API_AVAILABLE", "API_INVOKER_ONBOARDED"], "notificationDestination": "http://robot.testing", "requestTestNotification": true, - "supportedFeatures": "aaa", + "supportedFeatures": "0", "websockNotifConfig": { "requestWebsocketUri": true, "websocketUri": "websocketUri" diff --git a/doc/testing/testplan/api_invoker_management/invoker_details_post_example.json b/doc/testing/testplan/api_invoker_management/invoker_details_post_example.json index c306a17e2d04f55da35a5b3638775af9d63e769f..8eb75144dfc964d64ab2e33f4ebe399b9606095a 100644 --- a/doc/testing/testplan/api_invoker_management/invoker_details_post_example.json +++ b/doc/testing/testplan/api_invoker_management/invoker_details_post_example.json @@ -1,6 +1,6 @@ { "notificationDestination": "http://host.docker.internal:8086/netapp_callback", - "supportedFeatures": "fffffff", + "supportedFeatures": "0", "apiInvokerInformation": "ROBOT_TESTING_INVOKER", "websockNotifConfig": { "requestWebsocketUri": true, diff --git a/doc/testing/testplan/api_invoker_management/invoker_details_put_example.json b/doc/testing/testplan/api_invoker_management/invoker_details_put_example.json index 37a1eefbb05a2df1058b20429477cbf17f412cb8..e96aa038958155b1b5170e112233a05582650579 100644 --- a/doc/testing/testplan/api_invoker_management/invoker_details_put_example.json +++ b/doc/testing/testplan/api_invoker_management/invoker_details_put_example.json @@ -1,6 +1,6 @@ { "notificationDestination": "http://host.docker.internal:8086/netapp_new_callback", - "supportedFeatures": "fffffff", + "supportedFeatures": "0", "apiInvokerInformation": "ROBOT_TESTING_INVOKER", "websockNotifConfig": { "requestWebsocketUri": true, @@ -21,7 +21,7 @@ "capifProvDoms": ["capifProvDoms", "capifProvDoms"], "isShareable": true }, - "supportedFeatures": "fffffff", + "supportedFeatures": "0", "description": "description", "apiSuppFeats": "fffffff", "apiId": "apiId", @@ -209,7 +209,7 @@ "capifProvDoms": ["capifProvDoms", "capifProvDoms"], "isShareable": true }, - "supportedFeatures": "fffffff", + "supportedFeatures": "0", "description": "description", "apiSuppFeats": "fffffff", "apiId": "apiId", diff --git a/doc/testing/testplan/api_publish_service/README.md b/doc/testing/testplan/api_publish_service/README.md index 928c95e7e0342ccb2b01ca54df318c2d47ae2fc2..86b8c670896d30df53d242138754da2dfbc70fe8 100644 --- a/doc/testing/testplan/api_publish_service/README.md +++ b/doc/testing/testplan/api_publish_service/README.md @@ -606,7 +606,7 @@ At this documentation you will have all information and related files and exampl ## Test Case 13: Delete APIs Published by NON Authorised apfId -**Test ID**: ***capif_api_publish_service-12*** +**Test ID**: ***capif_api_publish_service-13*** **Description**: @@ -646,6 +646,81 @@ At this documentation you will have all information and related files and exampl * detail with message "User not authorized". * cause with message "Certificate not authorized". +## Test Case 14: Check Two Published APIs with different APFs are removed when Provider is deleted + +**Test ID**: ***capif_api_publish_service-13*** + +**Description**: + + This test case will check that a Provider registered with two APFs, with one API published with each APF are removed properly when provider is removed. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority). + +**Execution Steps**: + + 1. Register Provider with 2 APFs at CCF and store certificates. + 2. Publish **service_1** API with **APF_1** + 3. Publish **service_2** API with **APF_2** + 4. Retrieve APIs published by **APF_1** + 5. Retrieve APIs published by **APF_2** + 6. Remove Provider by **AMF** + +**Information of Test**: + + 1. Perform [Provider Registration] and [Invoker Onboarding] + + 2. Publish **service_1** Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId1}/service-apis** + * body [service api description] with apiName **service_1** + * Get apiId + * Use **APF_1 Certificate** + 3. Publish **service_2** Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId2}/service-apis** + * body [service api description] with apiName **service_2** + * Get apiId + * Use **APF_2 Certificate** + 4. Retrieve all published APIs by **APF_1**: + * Send **GET** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId1}/service-apis** + * Use **APF_1 Certificate** + 5. Retrieve all published APIs by **APF_2**: + * Send **GET** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId2}/service-apis** + * Use **APF_2 Certificate** + 6. Get Number of services published by superadmin: + 1. Store value obtained in **services_present_on_ccf_after_publish** + 7. Delete registered provider: + * Send **DELETE** **https://{CAPIF_HOSTNAME}/api-provider-management/v1/registrations/{registrationId}** + * Use AMF Certificate. + 8. Get Number of services published by superadmin: + 1. Store value obtained in **services_present_on_ccf_after_delete_provider** + + +**Expected Result**: + + 1. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + 1. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId1}/service-apis/{serviceApiId}** + 2. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId2}/service-apis/{serviceApiId}** + 3. Response to Retrieve all published APIs by **APF_1**: + 1. **200 OK** + 2. Response body must return an array of **ServiceAPIDescription** data. + 3. Array must contain all previously published APIs by **APF_1**. + 4. Response to Retrieve all published APIs by **APF_2**: + 1. **200 OK** + 2. Response body must return an array of **ServiceAPIDescription** data. + 3. Array must contain all previously published APIs by **APF_2**. + 5. Delete Provider: + 1. **204 No Content** response. + 6. Check two APIs where removed after remove provider: + 1. **services_present_on_ccf_after_publish** - **services_present_on_ccf_after_delete_provider** = 2 + [service api description]: ./service_api_description_post_example.json "Service API Description Request" [publisher register body]: ./publisher_register_body.json "Publish register Body" diff --git a/doc/testing/testplan/api_publish_service/service_api_description_patch_example.json b/doc/testing/testplan/api_publish_service/service_api_description_patch_example.json new file mode 100644 index 0000000000000000000000000000000000000000..482d06403f6274131eddf909af246573954e5dfc --- /dev/null +++ b/doc/testing/testplan/api_publish_service/service_api_description_patch_example.json @@ -0,0 +1,336 @@ +{ + "apiStatus": { + "aefIds": [ + "string" + ] + }, + "aefProfiles": [ + { + "aefId": "string", + "versions": [ + { + "apiVersion": "string", + "expiry": "2024-12-18T13:36:19.754Z", + "resources": [ + { + "resourceName": "string", + "commType": "REQUEST_RESPONSE", + "uri": "string", + "custOpName": "string", + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ], + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ] + } + ], + "protocol": "HTTP_1_1", + "dataFormat": "JSON", + "securityMethods": [ + "PSK", + "string" + ], + "domainName": "string", + "interfaceDescriptions": [ + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + }, + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + }, + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + } + ], + "aefLocation": { + "civicAddr": { + "country": "string", + "A1": "string", + "A2": "string", + "A3": "string", + "A4": "string", + "A5": "string", + "A6": "string", + "PRD": "string", + "POD": "string", + "STS": "string", + "HNO": "string", + "HNS": "string", + "LMK": "string", + "LOC": "string", + "NAM": "string", + "PC": "string", + "BLD": "string", + "UNIT": "string", + "FLR": "string", + "ROOM": "string", + "PLC": "string", + "PCN": "string", + "POBOX": "string", + "ADDCODE": "string", + "SEAT": "string", + "RD": "string", + "RDSEC": "string", + "RDBR": "string", + "RDSUBBR": "string", + "PRM": "string", + "POM": "string", + "usageRules": "string", + "method": "string", + "providedBy": "string" + }, + "geoArea": { + "shape": "POINT", + "point": { + "lon": 180, + "lat": 90 + } + }, + "dcId": "string" + }, + "serviceKpis": { + "maxReqRate": 0, + "maxRestime": 0, + "availability": 0, + "avalComp": "string", + "avalGraComp": "string", + "avalMem": "string", + "avalStor": "string", + "conBand": 0 + }, + "ueIpRange": { + "ueIpv4AddrRanges": [ + { + "start": "198.51.100.1", + "end": "198.51.100.1" + } + ], + "ueIpv6AddrRanges": [ + { + "start": "2001:db8:85a3::8a2e:370:7334", + "end": "2001:db8:85a3::8a2e:370:7334" + } + ] + } + }, + { + "aefId": "string", + "versions": [ + { + "apiVersion": "string", + "expiry": "2024-12-18T13:36:19.754Z", + "resources": [ + { + "resourceName": "string", + "commType": "REQUEST_RESPONSE", + "uri": "string", + "custOpName": "string", + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ], + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ], + "custOperations": [ + { + "commType": "REQUEST_RESPONSE", + "custOpName": "string", + "operations": [ + "GET", + "string" + ], + "description": "string" + } + ] + } + ], + "protocol": "HTTP_1_1", + "dataFormat": "JSON", + "securityMethods": [ + "PSK", + "string" + ], + "domainName": "string", + "interfaceDescriptions": [ + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + }, + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + }, + { + "ipv4Addr": "string", + "ipv6Addr": "string", + "fqdn": "string", + "port": 65535, + "apiPrefix": "string", + "securityMethods": [ + "PSK", + "string" + ] + } + ], + "aefLocation": { + "civicAddr": { + "country": "string", + "A1": "string", + "A2": "string", + "A3": "string", + "A4": "string", + "A5": "string", + "A6": "string", + "PRD": "string", + "POD": "string", + "STS": "string", + "HNO": "string", + "HNS": "string", + "LMK": "string", + "LOC": "string", + "NAM": "string", + "PC": "string", + "BLD": "string", + "UNIT": "string", + "FLR": "string", + "ROOM": "string", + "PLC": "string", + "PCN": "string", + "POBOX": "string", + "ADDCODE": "string", + "SEAT": "string", + "RD": "string", + "RDSEC": "string", + "RDBR": "string", + "RDSUBBR": "string", + "PRM": "string", + "POM": "string", + "usageRules": "string", + "method": "string", + "providedBy": "string" + }, + "geoArea": { + "shape": "POINT", + "point": { + "lon": 180, + "lat": 90 + } + }, + "dcId": "string" + }, + "serviceKpis": { + "maxReqRate": 0, + "maxRestime": 0, + "availability": 0, + "avalComp": "string", + "avalGraComp": "string", + "avalMem": "string", + "avalStor": "string", + "conBand": 0 + }, + "ueIpRange": { + "ueIpv4AddrRanges": [ + { + "start": "198.51.100.1", + "end": "198.51.100.1" + } + ], + "ueIpv6AddrRanges": [ + { + "start": "2001:db8:85a3::8a2e:370:7334", + "end": "2001:db8:85a3::8a2e:370:7334" + } + ] + } + } + ], + "description": "string", + "shareableInfo": { + "isShareable": true, + "capifProvDoms": [ + "string" + ] + }, + "serviceAPICategory": "string", + "apiSuppFeats": "string", + "pubApiPath": { + "ccfIds": [ + "string" + ] + }, + "ccfId": "string" +} \ No newline at end of file diff --git a/doc/testing/testplan/api_publish_service/service_api_description_post_example.json b/doc/testing/testplan/api_publish_service/service_api_description_post_example.json index b725b428629509bf39a79c030f1bf93f4b6f18f6..10022ce8072b83cc302647a2fda42095d57e7d4e 100644 --- a/doc/testing/testplan/api_publish_service/service_api_description_post_example.json +++ b/doc/testing/testplan/api_publish_service/service_api_description_post_example.json @@ -95,7 +95,7 @@ } ], "description": "string", - "supportedFeatures": "fffff", + "supportedFeatures": "0", "shareableInfo": { "isShareable": true, "capifProvDoms": [ diff --git a/doc/testing/testplan/api_security_service/service_security.json b/doc/testing/testplan/api_security_service/service_security.json index ad7bc1ad5c64f6dc979a294044b5b44f5f43c68a..2798067f8cc700e9643b52a6f7cd6e7bbeafd03c 100644 --- a/doc/testing/testplan/api_security_service/service_security.json +++ b/doc/testing/testplan/api_security_service/service_security.json @@ -1,6 +1,6 @@ { "notificationDestination": "http://robot.testing", - "supportedFeatures": "fffffff", + "supportedFeatures": "0", "securityInfo": [{ "authenticationInfo": "authenticationInfo", "authorizationInfo": "authorizationInfo", diff --git a/doc/testing/testplan/api_status/README.md b/doc/testing/testplan/api_status/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4938884151694782935bce98386b7a6f97e97897 --- /dev/null +++ b/doc/testing/testplan/api_status/README.md @@ -0,0 +1,1781 @@ +# Test Plan for API Status Feature +At this documentation you will have all information and related files and examples of test plan for this feature. + +--- +## Test Case 1: Publish without apiStatus feature receive eventDetails with serviceAPIDescription + +**Test ID**: ***api_status-1*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing apiIds and serviceAPIDescription at eventDetails, and the same when api is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** and ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 2: Publish without apiStatus feature receive eventDetails without serviceAPIDescription + +**Test ID**: ***api_status-2*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with only ***Enhanced_event_report*** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing apiIds at eventDetails, and the same when api is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** **active** at supported features (binary 0100-> string **4**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 0100 -> string **4** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 3: Publish without apiStatus feature receive eventDetails without eventDetails (apiMonitoringStatus active) + +**Test ID**: ***api_status-3*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with only ***apiStatusMonitoring*** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, not containing eventDetails, and the same when api is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 1000-> string **8**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1000 -> string **8** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 4: Publish without apiStatus feature receive eventDetails without eventDetails + +**Test ID**: ***api_status-4*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** not active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, not containing eventDetails, and the same when api is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 0000-> string **0**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if **NOT** contains the **apiStatus** keys + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 5: Publish with apiStatus present but apiStatusMonitoring inactive receive bad Request + +**Test ID**: ***api_status-5*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** not active, receive Bad Request when api is published by a provider. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** and ***Enhanced_event_report*** **inactive** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag inactive (binary 0 0000 0000 -> string **000**) + 2. This API includes "API Status" information at **service API Description** with aefId1 inside array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **0** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **400 Bad Request** + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 400 + * title with message "Bad Request" + * detail with message "Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed". + * cause with message "apiStatus can't be set if apiStatusMonitoring is inactive". + 4. Response to Discover Request By Invoker: + 1. **404 Not Found** response. + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 404 + * title with message "Not Found" + * detail with message "API Invoker {api_invoker_id} has no API Published that accomplish filter conditions". + * cause with message "No API Published accomplish filter conditions". + 5. Mock Server received messages must accomplish: + 1. **No Events have been received**. + +--- +## Test Case 6: Publish with apiStatus feature active receive eventDetails with serviceAPIDescription + +**Test ID**: ***api_status-6*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** active, receive event notification including apiIds and serviceAPIDescriptions. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with aefId1 inside array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 7: Publish with apiStatus active feature receive eventDetails without serviceAPIDescription + +**Test ID**: ***api_status-7*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** inactive and ***Enhanced_event_report*** active, receive event notification including only apiIds. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** **active** and ***apiStatusMonitoring*** **inactive** at supported features (binary 0100-> string **4**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with aefId1 inside array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 0100 -> string **4** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with only **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 8: Publish with apiStatus active feature receive eventDetails without eventDetails with apiStatus (apiMonitoringStatus active) + +**Test ID**: ***api_status-8*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** active and ***Enhanced_event_report*** inactive, receive event notification without eventDetails. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** **inactive** and ***apiStatusMonitoring*** **active** at supported features (binary 1000-> string **8**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with aefId1 inside array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1000 -> string **8** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 9: Publish with apiStatus active feature receive eventDetails without eventDetails + +**Test ID**: ***api_status-9*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** inactive, receive event notification without eventDetails. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***Enhanced_event_report*** and ***apiStatusMonitoring*** **inactive** at supported features (binary 0000-> string **0**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with aefId1 inside array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 0000 -> string **0** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, without **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. The other one must be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 10: Publish with apiStatus feature active no aefId active receive eventDetails with serviceAPIDescription with apiStatus empty array + +**Test ID**: ***api_status-10*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** active, receive event notification **SERVICE_API_UNAVAILABLE** including apiIds and serviceAPIDescriptions when API is published containing ***apiStatus*** with empty array. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with empty aefIds array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with empty aefIds array. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **One Event has been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. Only one **SERVICE_API_UNAVAILABLE** event. + +--- +## Test Case 11: Publish with apiStatus not present but apiStatusMonitoring feature active receive eventDetails with serviceAPIDescription without apiStatus + +**Test ID**: ***api_status-11*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**, with ***apiStatusMonitoring*** and ***Enhanced_event_report*** active, receive event notification **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE** including apiIds and serviceAPIDescriptions when API is published wihtout ***apiStatus***. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE** and **SERVICE_API_UNAVAILABLE**. ***apiStatusMonitoring*** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API not includes "API Status" information at **service API Description**. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus not present. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** key. + 5. Response to Remove published Service API at CCF: + 1. **204 No Content** + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. First **SERVICE_API_AVAILABLE** event. + 2. Other with **SERVICE_API_UNAVAILABLE** event. + +--- +## Test Case 12: Update published API without apiStatus and apiStatusMonitoring inactive + +**Test ID**: ***api_status-12*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, and SERVICE_API_UPDATE after update apiStatus to not present. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Update Published API: + 1. apiStatus Not present + 2. aipStatusMonitoring feature not active (binary 0 0000 0000 -> string **0**) + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **0** + * 2 profiles, one with each aef. + * apiStatus not present. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Update published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetail** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetail** containing serviceAPIDescription updated. + +--- +## Test Case 13: Update published API with apiStatus empty and apiStatusMonitoring inactive + +**Test ID**: ***api_status-13*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, and SERVICE_API_UPDATE after update apiStatus to empty aefIds array with **ApiStatusMonitoring** inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Update Published API: + 1. apiStatus present with empty aefIds array. + 2. apiStatusMonitoring feature not active (binary 0 0000 0000 -> string **0**) + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **0** + * 2 profiles, one with each aef. + * apiStatus present with empty aefIds array. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + + 5. Response to Update request must accomplish: + 1. **400 Bad Request** + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 400 + * title with message "Bad Request" + * detail with message "Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed". + * cause with message "apiStatus can't be set if apiStatusMonitoring is inactive". + + 6. Mock Server received messages must accomplish: + 1. **One Event have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + +--- +## Test Case 14: Update published API with apiStatus empty and apiStatusMonitoring active + +**Test ID**: ***api_status-14*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails, SERVICE_API_UPDATE and SERVICE_API_UNAVAILABLE after update apiStatus to empty aefIds array with **ApiStatusMonitoring** active. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Update Published API: + 1. apiStatus present with empty aefIds array. + 2. apiStatusMonitoring feature active (binary 0 0010 0000 -> string **20**) + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **20** + * 2 profiles, one with each aef. + * apiStatus present with empty aefIds array. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Update published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Event have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. One should be **SERVICE_API_UPDATE**. + 3. One should be **SERVICE_API_UNAVAILABLE**. + +--- +## Test Case 15: Update published API with apiStatus only aef2 and apiStatusMonitoring active + +**Test ID**: ***api_status-15*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider, containing eventDetails and SERVICE_API_UPDATE after update apiStatus to aefId2 array with **ApiStatusMonitoring** active. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Update Published API: + 1. apiStatus present with empty aefIds array. + 2. apiStatusMonitoring feature active (binary 0 0010 0000 -> string **20**) + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **20** + * 2 profiles, one with each aef. + * apiStatus present with aefId2 in aefIds array. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Update published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Event have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE**. + 2. One should be **SERVICE_API_UPDATE**. + +--- +## Test Case 16: Published API without aefs available updated to one aef available + +**Test ID**: ***api_status-16*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_UNAVAILABLE in mockserver when api is published with apiStatus empty by a provider containing eventDetails, SERVICE_API_UPDATE and SERVICE_API_AVAILABLE after update apiStatus to aefId2 array with **ApiStatusMonitoring** active, and SERVICE_API_UNAVAILABLE when API is unpublished. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with empty aefIds array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Update Published API: + 1. apiStatus present with aefId2 in aefIds array. + 2. apiStatusMonitoring feature active (binary 0 0010 0000 -> string **20**) + 7. Provider remove published API. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with empty aefIds array. + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PUT** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **20** + * 2 profiles, one with each aef. + * apiStatus present with aefId2 in aefIds array. + 7. Remove published Service API: + * Send **DELETE** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Update published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Event have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** and **serviceAPIDescription** in **eventDetail** parameter. + 1. One should be **SERVICE_API_UNAVAILABLE** aefIds array inside apiStatus empty. + 2. One should be **SERVICE_API_UPDATE** aefIds array inside apiStatus contains apfId2. + 3. One should be **SERVICE_API_AVAILABLE** aefIds array inside apiStatus contains apfId2. + 4. One should be **SERVICE_API_UNAVAILABLE** aefIds array inside apiStatus contains apfId2. + +--- +## Test Case 17: Patch published (apiStatusMonitoring active) API with apiStatus only aefId2 + +**Test ID**: ***api_status-17*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider (with apiStatusMonitoring active), containing eventDetails, and SERVICE_API_UPDATE after patch with apfId2 in apiStatus array. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Patch Published API: + 1. apiStatus present with aefId2 in array. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PATCH** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description patch] and realted with aefId1 and aefId2. + * apiStatus present with aefId2. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Patch published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. + +--- +## Test Case 18: Patch published (apiStatusMonitoring active) API with apiStatus aef1 and aef2 + +**Test ID**: ***api_status-18*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider (with apiStatusMonitoring active), containing eventDetails, and SERVICE_API_UPDATE after patch with apfId1 and apfId2 in apiStatus array. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Patch Published API: + 1. apiStatus present with aefId1 and aefId2 in array. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PATCH** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description patch] and realted with aefId1 and aefId2. + * apiStatus present with aefId1 and aefId2. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Patch published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. + +--- +## Test Case 19: Patch published (apiStatusMonitoring inactive) API with apiStatus aefId1 and aefId2 + +**Test ID**: ***api_status-19*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_AVAILABLE in mockserver when api is published by a provider (with apiStatusMonitoring inactive), containing eventDetails, and **NO SERVICE_API_UPDATE** after patch with apfId1 and apfId2 in apiStatus array, because **apiStatusMonitoring** in publish is inactive. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0000 0000 -> string **000**) + 2. This API includes "API Status" information at **service API Description** with only aefId1. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Patch Published API: + 1. apiStatus present with aefId1 and aefId2 in array. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **000** + * 2 profiles, one with each aef. + * apiStatus with aefId1 inside array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + + 3. Response to Publish request must accomplish: + 1. **400 Bad Request** + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 400 + * title with message "Bad Request" + * detail with message "Set apiStatus with apiStatusMonitoring feature inactive at supportedFeatures if not allowed". + * cause with message "apiStatus can't be set if apiStatusMonitoring is inactive". + + 4. Response to Discover Request By Invoker: + 1. **404 Not Found** response. + 2. Error Response Body must accomplish with **ProblemDetails** data structure with: + * status 404 + * title with message "Not Found" + * detail with message "API Invoker {api_invoker_id} has no API Published that accomplish filter conditions". + * cause with message "No API Published accomplish filter conditions". + 5. Mock Server received messages must accomplish: + 1. **No Events have been received**. + +--- +## Test Case 20: Patch published without aefs available API with apiStatus only aef2 + +**Test ID**: ***api_status-20*** + +**Description**: + + This test case will check if an invoker subscribed to events **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE** with ***apiStatusMonitoring*** and **Enhanced_event_report** active, receive SERVICE_API_UNAVAILABLE in mockserver when api is published by a provider (with **apiStatusMonitoring** active), containing eventDetails, and SERVICE_API_UPDATE and SERVICE_API_AVAILABLE after patch with apfId1 and apfId2 in apiStatus array, becasue change from unavailable to available and also serviceAPIDescription is updated. + +**Pre-Conditions**: + + * CAPIF subscriber is pre-authorised (has valid InvokerId or apfId from CAPIF Authority) + * CAPIF provider is correctly registered with 2 aefs. + * **Mock Server is up and running to receive requests.** + * **Mock Server is clean.** + +**Execution Steps**: + + 1. Register Invoker and Onboard Invoker at CCF. + 2. Register Provider at CCF with 2 aefs. + 3. Subscribe to **SERVICE_API_AVAILABLE**, **SERVICE_API_UNAVAILABLE** and **SERVICE_API_UPDATE**. **apiStatusMonitoring** and **Enhanced_event_report** **active** at supported features (binary 1100-> string **C**) + 4. Publish Service API at CCF: + 1. Supported Features with apiStatusMonitoring flag active (binary 0 0010 0000 -> string **020**) + 2. This API includes "API Status" information at **service API Description** with empty array. + 5. Discover Service APIs by Invoker + 1. includes filter by query parameter **aef-id** + 6. Patch Published API: + 1. apiStatus present with aefId1 and aefId2 in array. + +**Information of Test**: + + 1. Perform [Invoker Onboarding] + 2. Perform [Provider Registration] with 2 aefs + 3. Event Subscription to SERVICE_API_AVAILABLE and SERVICE_API_UNAVAILABLE of provider previously registered: + 1. Send **POST** to **https://{CAPIF_HOSTNAME}/capif-events/v1/{subscriberId}/subscriptions** + 2. body [event subscription request body] with: + 1. events: **['SERVICE_API_AVAILABLE','SERVICE_API_UNAVAILABLE','SERVICE_API_UPDATE']** + 2. supportedFeatures: binary 1100 -> string **C** + 3. Use **Invoker Certificate** + 4. Publish Service API at CCF: + * Send **POST** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis** + * body [service api description] with **service_1** and **service_2** apiNames and realted with aefId1 and aefId2. + * supportedFeatures **020** + * 2 profiles, one with each aef. + * apiStatus empty array + * Use **APF Certificate** + 5. Request Discover Published APIs: + * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&aef-id=${aefId}** + * Param api-invoker-id is mandatory + * Use **Invoker Certificate** + 6. Update published Service API: + * Send **PATCH** to resource URL **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId}/service-apis/{SERVICE_API_ID}** + * Use **APF Certificate** + * body [service api description patch] and realted with aefId1 and aefId2. + * apiStatus present with aefId1 and aefId2. + +**Expected Result**: + + 1. Response to Onboard request must accomplish: + 1. **201 Created** + 2. Response Body must follow **APIInvokerEnrolmentDetails** data structure with: + * apiInvokerId + * onboardingInformation->apiInvokerCertificate must contain the public key signed. + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/api-invoker-management/{apiVersion}/onboardedInvokers/{onboardingId}** + 2. Response to Event Subscription must accomplish: + 1. **201 Created** + 2. The URI of the created resource shall be returned in the "Location" HTTP header, following this structure: **{apiRoot}/capif-events/{apiVersion}/{subscriberId}/subscriptions/{subscriptionId}** + 3. Response Body must follow **EventSubscription** data structure. + 3. Response to Publish request must accomplish: + 1. **201 Created** + 2. Response Body must follow **ServiceAPIDescription** data structure with: + * apiId + * 2 profiles with: + * resourceName resource_1 and aefId1 + * resourceName resource_2 and aefId2 + 3. Response Header **Location** must be received with URI to new resource created, following this structure: **{apiRoot}/published-apis/v1/{apfId}/service-apis/{serviceApiId}** + 4. Response to Discover Request By Invoker: + 1. **200 OK** response. + 2. Response body must follow **DiscoveredAPIs** data structure: + * Check if DiscoveredAPIs contains the API Published previously + * Check if contains the **apiStatus** with aefId1 + 5. Response to Patch published Service API at CCF: + 1. **200 OK** + 2. Store response with updated serviceAPIDescription. + 6. Mock Server received messages must accomplish: + 1. **Two Events have been received**. + 2. Validate received events follow **EventNotification** data structure, with **apiIds** in **eventDetail** parameter. + 1. One should be **SERVICE_API_UNAVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + 2. The other one must be **SERVICE_API_UPDATE** apiId published API with **eventDetails** containing serviceAPIDescription patched. + 3. Last one should be **SERVICE_API_AVAILABLE** apiId of published API with **eventDetails** with apiIds and serviceAPIDescription. + + + + + [service api description]: ../api_publish_service/service_api_description_post_example.json "Service API Description Request" + [service api description patch]: ../api_publish_service/service_api_description_patch_example.json "Service API Description Patch Request" + [publisher register body]: ../api_publish_service/publisher_register_body.json "Publish register Body" + [invoker onboarding body]: ../api_invoker_management/invoker_details_post_example.json "API Invoker Request" + [provider request body]: ../api_provider_management/provider_details_post_example.json "API Provider Enrolment Request" + [provider request patch body]: ../api_provider_management/provider_details_enrolment_details_patch_example.json "API Provider Enrolment Patch Request" + + [invoker onboarding]: ../common_operations/README.md#onboard-an-invoker "Invoker Onboarding" + [provider registration]: ../common_operations/README.md#register-a-provider "Provider Registration" + [event subscription request body]: ../api_events_service/event_subscription.json "Event Subscription Request" diff --git a/doc/testing/testplan/common_operations/README.md b/doc/testing/testplan/common_operations/README.md index 48d31a83533b4880dbf7eaba12d06388e20e3f4a..eb145f86cc14b7495bbf803fb2ccba70c75624e0 100644 --- a/doc/testing/testplan/common_operations/README.md +++ b/doc/testing/testplan/common_operations/README.md @@ -1,5 +1,9 @@ # Common Operations +## Default Supported Features + +By default all required supported features on POST Request will be present and set to "0" unless test define it with other value. Also it can be set to NONE is we want to test supported features not present. + ## Register new user In order to use OpenCAPIF we must add a new user. This new user can onboard/register any Invokers or Providers. diff --git a/doc/testing/testplan/vendor_extensibility/README.md b/doc/testing/testplan/vendor_extensibility/README.md index 4cf359c952835704e5651686dab6cc2f875563d8..11697f9a5264614a19a686a9e742d7bfe18a3097 100644 --- a/doc/testing/testplan/vendor_extensibility/README.md +++ b/doc/testing/testplan/vendor_extensibility/README.md @@ -1,6 +1,7 @@ # Test Plan for Vendor Extensibility Feature At this documentation you will have all information and related files and examples of test plan for this feature. +--- ## Test Case 1: Published API with vendor extensibility **Test ID**: ***vendor_extensibility-1*** @@ -61,6 +62,7 @@ At this documentation you will have all information and related files and exampl * Check if DiscoveredAPIs contains the API Published previously * Check if contains the **vendorSpecific** keys +--- ## Test Case 2: Published API with vendor extensibility and discover with VendSpecQueryParams disabled **Test ID**: ***vendor_extensibility-2*** @@ -121,6 +123,7 @@ At this documentation you will have all information and related files and exampl * detail with message "API Invoker {api_invoker_id} has no API Published that accomplish filter conditions". * cause with message "No API Published accomplish filter conditions". +--- ## Test Case 3: Publish API with vendorExt active and discover without supported features filter **Test ID**: ***vendor_extensibility-3*** @@ -179,6 +182,7 @@ At this documentation you will have all information and related files and exampl * Check if DiscoveredAPIs contains the API Published previously * Check **NOT** contains the **vendorSpecific** keys +--- ## Test Case 4: Publish API with vendorExt active but without vendorSpecifics **Test ID**: ***vendor_extensibility-4*** @@ -222,6 +226,7 @@ At this documentation you will have all information and related files and exampl * detail with message "If and only if VendorExt feature is enabled, then vendor-specific fields should be defined". * cause with message "Vendor extensibility misconfiguration". +--- ## Test Case 5: Publish API with vendorExt inactive but with vendorSpecifics **Test ID**: ***vendor_extensibility-5*** @@ -265,7 +270,7 @@ At this documentation you will have all information and related files and exampl * detail with message "If and only if VendorExt feature is enabled, then vendor-specific fields should be defined". * cause with message "Vendor extensibility misconfiguration". - +--- ## Test Case 6: Published API without vendor extensibility discover with VendSpecQueryParams enabled **Test ID**: ***vendor_extensibility-6*** @@ -328,6 +333,7 @@ At this documentation you will have all information and related files and exampl * detail with message "API Invoker {api_invoker_id} has no API Published that accomplish filter conditions". * cause with message "No API Published accomplish filter conditions". +--- ## Test Case 7: Published API without vendor extensibility and discover with vendSpecQueryParams disabled **Test ID**: ***vendor_extensibility-7*** @@ -388,7 +394,7 @@ At this documentation you will have all information and related files and exampl * Check if DiscoveredAPIs contains the API Published previously * Check if **NOT** contains any **vendorSpecific** keys - +--- ## Test Case 8: Published API without vendor extensibility and discover without supported-features query parameter **Test ID**: ***vendor_extensibility-8*** @@ -449,6 +455,7 @@ At this documentation you will have all information and related files and exampl * Check if DiscoveredAPIs contains the API Published previously * Check if **NOT** contains any **vendorSpecific** keys +--- ## Test Case 9: Publish API without supportedFeatures **Test ID**: ***vendor_extensibility-9***