Test Plan for CAPIF Api Logging Service
At this documentation you will have all information and related files and examples of test plan for this API.
Test Case 1: Creates a new individual CAPIF Log Entry.
Test ID: capif_api_logging-1
Description:
This test case will check that a CAPIF AEF can create log entry to Logging Service
Pre-Conditions:
- CAPIF provider is pre-authorised (has valid aefId from CAPIF Authority)
- Service exist in CAPIF
- Invoker exist in CAPIF
Information of Test:
-
Perform provider onboarding and invoker onboarding
-
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
-
Log Entry:
- Send POST to https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs
- body log entry request body
- Use AEF Certificate
Execution Steps: 1. Register Provider and Invoker CCF 2. Publish Service 3. Create Log Entry
Expected Result:
- Response to Logging Service must accomplish:
- 201 Created
- Response Body must follow InvocationLog data structure with:
- aefId
- apiInvokerId
- logs
- Response Header Location must be received with URI to new resource created, following this structure: {apiRoot}/api-invocation-logs/v1/{aefId}/logs/{logId}
Test Case 2: Creates a new individual CAPIF Log Entry with Invalid aefId
Test ID: capif_api_logging-2
Description:
This test case will check that a CAPIF subscriber (AEF) cannot create Log Entry without valid aefId
Pre-Conditions:
- CAPIF provider is not pre-authorised (has not valid aefId from CAPIF Authority)
- Service exist in CAPIF
- Invoker exist in CAPIF
Information of Test:
-
Perform provider onboarding and invoker onboarding
-
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
-
Log Entry:
- Send POST to https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{not-valid-aefId}/logs
- body log entry request body
- Use AEF Certificate
Execution Steps: 1. Register Provider and Invoker CCF 2. Publish Service 3. Create Log Entry
Expected Result:
- Response to Logging Service must accomplish:
- 404 Not Found
- Error Response Body must accomplish with ProblemDetails data structure with:
- status 404
- title with message "Not Found"
- detail with message "Exposer not exist".
- cause with message "Exposer id not found".
Test Case 3: Creates a new individual CAPIF Log Entry with Invalid serviceAPI
Test ID: capif_api_logging-3
Description:
This test case will check that a CAPIF subscriber (AEF) cannot create Log Entry without valid aefId
Pre-Conditions:
- CAPIF subscriber is pre-authorised (has valid aefId from CAPIF Authority)
Information of Test:
-
Perform provider onboarding and invoker onboarding
-
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
-
Log Entry:
- Send POST to https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs
- body [log entry request body with serviceAPI apiName apiId not valid]
- Use AEF Certificate
Execution Steps: 1. Register Provider and Invoker CCF 2. Publish Service 3. Create Log Entry
Expected Result:
- Response to Logging Service must accomplish:
- 404 Not Found
- Error Response Body must accomplish with ProblemDetails data structure with:
- status 404
- title with message "Not Found"
- detail with message "Invoker not exist".
- cause with message "Invoker id not found".
Test Case 4: Creates a new individual CAPIF Log Entry with Invalid apiInvokerId
Test ID: capif_api_logging-4
Description:
This test case will check that a CAPIF subscriber (AEF) cannot create Log Entry without valid aefId
Pre-Conditions:
- CAPIF subscriber is pre-authorised (has valid aefId from CAPIF Authority)
Information of Test:
-
Perform provider onboarding and invoker onboarding
-
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
-
Log Entry:
- Send POST to https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs
- body [log entry request body with invokerId not valid]
- Use AEF Certificate
Execution Steps: 1. Register Provider and Invoker CCF 2. Publish Service 3. Create Log Entry
Expected Result:
-
Response to Onboard request must accomplish:
- 201 Created response.
- body returned must accomplish APIProviderEnrolmentDetails data structure.
- For each apiProvFuncs, we must check:
- apiProvFuncId is set
- apiProvCert under regInfo is set properly
- Location Header must contain the new resource URL {apiRoot}/api-provider-management/v1/registrations/{registrationId}
-
Response to Logging Service must accomplish:
- 404 Not Found
- Error Response Body must accomplish with ProblemDetails data structure with:
- status 404
- title with message "Not Found"
- detail with message "Invoker not exist".
- cause with message "Invoker id not found".
-
Log Entry are not stored in CAPIF Database
Test Case 5: Creates a new individual CAPIF Log Entry with Invalid aefId in body
Test ID: capif_api_logging-5
Description:
This test case will check that a CAPIF subscriber (AEF) cannot create Log Entry without valid aefId in body
Pre-Conditions:
- CAPIF provider is pre-authorised (has valid apfId from CAPIF Authority)
- Service exist in CAPIF
- Invoker exist in CAPIF
Information of Test:
-
Perform provider onboarding and invoker onboarding
-
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
-
Log Entry:
- Send POST to https://{CAPIF_HOSTNAME}/api-invocation-logs/v1/{aefId}/logs
- body [log entry request body with bad aefId]
- Use AEF Certificate
Execution Steps: 1. Register Provider and Invoker CCF 2. Publish Service 3. Create Log Entry
Expected Result:
- Response to Logging Service must accomplish:
- 401 Unauthorized
- Error Response Body must accomplish with ProblemDetails data structure with:
- status 401
- title with message "Unauthorized"
- detail with message "AEF id not matching in request and body".
- cause with message "Not identical AEF id".