Commit fd776019 authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Add information related with test plan for apiName fix

parent 30354ecb
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
## **Release X.X.X**

### **Allow same apiName across different AEFs**
### **Technical Debt Solved**

#### **Allow same apiName across different AEFs**

Publish Service now enforces uniqueness by aefId/apiName instead of global apiName, allowing different AEFs to publish the same apiName while rejecting duplicates from the same AEF on POST, PUT, and PATCH.

### **Testing**

- 2 New tests related with use of same apiName across different AEFs.

### **Documentation**

- 2 New tests added to [OCF Publish API test plan documentation], related with apiName.

## **Release 4.0.0**

### **Visibility Control**
@@ -515,6 +525,7 @@ This Release also includes a Robot Test Suite for all those services and a Postm
[New Registration Demo]: https://www.youtube.com/watch?v=sn-tN6eRvv8 "New Registration Demo"
[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/3GPP-Release-18-upgrade   "Upgrade Release 17 to 18 Wiki"
[OCF Publish API test plan documentation]: https://ocf.etsi.org/documentation/latest/testing/testplan/api_publish_service/ "OCF Publish API test plan documentation"

[How to Deploy Using Helm]: ./gettingstarted/howtodeploy.md  "How to Deploy Using Helm"
[Download Repository]: ./gettingstarted/download.md  "Download Repository"
+175 −1
Original line number Diff line number Diff line
# Test Plan for CAPIF Api Publish Service
At this documentation you will have all information and related files and examples of test plan for this API.

---

## Test Case 1: Publish API by Authorised API Publisher

**Test ID**: ***capif_api_publish_service-1***
@@ -80,6 +82,7 @@ At this documentation you will have all information and related files and exampl

  2. Service API is NOT stored in CAPIF Database

---

## Test Case 3: Retrieve all APIs Published by Authorised apfId 

@@ -144,6 +147,7 @@ At this documentation you will have all information and related files and exampl
     2. Response body must return an array of **ServiceAPIDescription** data.
     3. Array must contain all previously published APIs.

---

## Test Case 4: Retrieve all APIs Published by NON Authorised apfId 

@@ -182,6 +186,7 @@ At this documentation you will have all information and related files and exampl

  2. Service API is NOT stored in CAPIF Database

---

## Test Case 5: Retrieve single APIs Published by Authorised apfId

@@ -256,6 +261,7 @@ At this documentation you will have all information and related files and exampl
     2. Response body must return a **ServiceAPIDescription** data.
     3. Array must contain same information than **service_2** published registration response.

---

## Test Case 6: Retrieve single APIs non Published by Authorised apfId 

@@ -292,6 +298,7 @@ At this documentation you will have all information and related files and exampl
        * detail with message "Service API not found".
        * cause with message "No Service with specific credentials exists".

---

## Test Case 7: Retrieve single APIs Published by NON Authorised apfId 

@@ -340,6 +347,7 @@ At this documentation you will have all information and related files and exampl

  2. Service API is NOT stored in CAPIF Database

---

## Test Case 8: Update API Published by Authorised apfId with valid serviceApiId

@@ -401,6 +409,7 @@ At this documentation you will have all information and related files and exampl
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiName **service_1**_modified.

---

## Test Case 9: Update APIs Published by Authorised apfId with invalid serviceApiId  

@@ -450,6 +459,8 @@ At this documentation you will have all information and related files and exampl
        * detail with message "Service API not found".
        * cause with message "Service API id not found".

---

## Test Case 10: Update APIs Published by NON Authorised apfId  

**Test ID**: ***capif_api_publish_service-10***
@@ -507,6 +518,7 @@ At this documentation you will have all information and related files and exampl
     2. Response Body must follow **ServiceAPIDescription** data structure with:
        * apiName **service_1**.

---

## Test Case 11: Delete API Published by Authorised apfId with valid serviceApiId

@@ -567,6 +579,7 @@ At this documentation you will have all information and related files and exampl
        * detail with message "Service API not found".
        * cause with message "No Service with specific credentials exists".

---

## Test Case 12: Delete APIs Published by Authorised apfId with invalid serviceApiId

@@ -603,6 +616,7 @@ At this documentation you will have all information and related files and exampl
        * detail with message "Service API not found".
        * cause with message "Service API id not found".

---

## Test Case 13: Delete APIs Published by NON Authorised apfId

@@ -646,9 +660,11 @@ 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***
**Test ID**: ***capif_api_publish_service-14***

**Description**:

@@ -721,6 +737,164 @@ At this documentation you will have all information and related files and exampl
  6. Check two APIs where removed after remove provider:
     1. **services_present_on_ccf_after_publish** - **services_present_on_ccf_after_delete_provider** = 2

---

## Test Case 15: Publish API same apiName but different AEF

**Test ID**: ***capif_api_publish_service-15***, ***smoke***

**Description**:

  This test case will check that different AEFs can publish APIs with same apiName.

**Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority)

**Execution Steps**:

  1. Register Provider at CCF and store certificates.

  2. Publish Service API

  3. Retrieve {apiId} from body and Location header with new resource created from response

**Information of Test**:

  1. Perform [invoker onboarding]

  2. Perform [Provider Registration] of 2 providers, one with 2 AEFs and other with only 1 AEF.

  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 apiName **service_1** and **aef_1** from provider 1.
     * Use **APF Certificate**

  5. 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** and **aef_2** from provider 1.
     * Use **APF Certificate**

  6. 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** and **aef** from provider 2.
     * Use **APF Certificate**

  7. Retrieve all published APIs by **APF** from provider 1:
     * Send **GET** to ccf_publish_url **https://{CAPIF_HOSTNAME}/published-apis/v1/{apfId1}/service-apis**
     * Use **APF_1 Certificate**

  8. Request Discover Published APIs:
     * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&api_name=service_1**
     * Param api-invoker-id is mandatory
     * Use **Invoker Certificate**

**Expected Result**:

  1. Response to Publish first 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/{apfId}/service-apis/{serviceApiId}**

  2. Response to Publish second 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/{apfId}/service-apis/{serviceApiId}**

  3. Response to Publish third 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/{apfId}/service-apis/{serviceApiId}**

  4. Response to Retrieve all published APIs by **APF** of provider 1:
     1. **200 OK**
     2. Response body must return an array of **ServiceAPIDescription** data.
     3. Array must contain 2 APIs previously published APIs by **APF** of provider 1, one with **AEF_1** and other with **AEF_2**.

  5. Response to Discover Request By Invoker:
     1. **200 OK** response.
     2. Response body must follow **DiscoveredAPIs** data structure:
        * Check if DiscoveredAPIs contains 3 APIs published.

---

## Test Case 16: Publish API same apiName and same AEF

**Test ID**: ***capif_api_publish_service-16***, ***smoke***

**Description**:

  This test case will check that different AEFs can publish APIs with same apiName and if we use same AEF then error will be raised.

**Pre-Conditions**:

  * CAPIF subscriber is pre-authorised (has valid apfId from CAPIF Authority)

**Execution Steps**:

  1. Register Provider at CCF and store certificates.

  2. Publish Service API

  3. Retrieve {apiId} from body and Location header with new resource created from response

**Information of Test**:

  1. Perform [invoker onboarding]

  2. Perform [Provider Registration] of 2 providers, one with 2 AEFs and other with only 1 AEF.

  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 apiName **service_1** and **aef_1** from provider 1.
     * Use **APF Certificate**

  5. 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** and **aef_1** from provider 1.
     * Use **APF Certificate**

  6. 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** and **aef** from provider 2.
     * Use **APF Certificate**

  7. Request Discover Published APIs:
     * Send **GET** to **https://{CAPIF_HOSTNAME}/service-apis/v1/allServiceAPIs?api-invoker-id={apiInvokerId}&api_name=service_1**
     * Param api-invoker-id is mandatory
     * Use **Invoker Certificate**

**Expected Result**:

  1. Response to Publish first 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/{apfId}/service-apis/{serviceApiId}**

  2. Response to Publish second request must accomplish:
     1. **403 Forbidden**
     2. Error Response Body must accomplish with **ProblemDetails** data structure with:
        * status **403**
        * title with message "Forbidden"
        * detail with message "Already registered service with same api name and aef id".
        * cause with message "Found service with same api name and aef id".

  3. Response to Publish third 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/{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 2 APIs published.



   [service api description]: ./service_api_description_post_example.json  "Service API Description Request"
   [publisher register body]: ./publisher_register_body.json  "Publish register Body"