From 6c1e79883c82f797cc165abc738c3d2b0cd48558 Mon Sep 17 00:00:00 2001 From: Jose Luis Urien Date: Fri, 30 Aug 2024 10:47:26 +0200 Subject: [PATCH] Updated test for extending sessions not available --- code/Test_definitions/README.md | 1 - ...on-demand-extendQosSessionDuration.feature | 37 ++++++++----------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/code/Test_definitions/README.md b/code/Test_definitions/README.md index 0df81c02d1..01a2888348 100644 --- a/code/Test_definitions/README.md +++ b/code/Test_definitions/README.md @@ -12,7 +12,6 @@ The test plan has to be enhanced and some scenarios still contains comments and * Now that QoS Profiles may be restricted to certain devices, what code to return when the provided device in createSession is not suitable for the provided qosProfile. We may reuse 422 DEVICE_NOT_APPLICABLE * When providing a path parameter, such sessionId or provisioningId, which is not compliant with the spec format (UUID), what code to return? Options are 400 INVALID_ARGUMENT or 404 NOT_FOUND if path parameter format is not checked previously * 422 UNSUPPORTED_DEVICE_IDENTIFIERS is in the Commonalities guidelines (document) but it is not yet in the artifact and it not yet considered in the quality-on-demand or qos-profiles API specs, but it is in qod-provisioning API spec -* It is not defined the expected behavior when extending the duration of a session in qosStatus REQUESTED or UNAVAILABLE * For QoS Profile response validations, it is pending to check additional constraints, such as minDuration being less or equal than maxDuration, etc * When accessing a session or provisioning created by a different client, both 403 INVALID_TOKEN_CONTEXT and the generic 403 PERMISSION_DENIED codes could make sense. diff --git a/code/Test_definitions/quality-on-demand-extendQosSessionDuration.feature b/code/Test_definitions/quality-on-demand-extendQosSessionDuration.feature index c14f1b360c..80ab9a1bba 100644 --- a/code/Test_definitions/quality-on-demand-extendQosSessionDuration.feature +++ b/code/Test_definitions/quality-on-demand-extendQosSessionDuration.feature @@ -58,28 +58,6 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation extendQosSessionDurat And the response body complies with the OAS schema at "/components/schemas/SessionInfo" And the response property "$.duration" does not exceed the "maxDuration" for the QoS Profile - # To be discussed. Behaviour when the qosStatus of the session is REQUESTED - @quality_on_demand_extendQosSessionDuration_03_requestedSession - Scenario: Response extending duration for requested session - Given an existing QoS session created by operation createSession with qosStatus "REQUESTED" - And the path parameter "sessionId" is set to the value for that QoS session - And the request body is set to a valid request body - When the request "extendQosSessionDuration" is sent - Then the response status code is TBD - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response header "Content-Type" is "application/json" - - # To be discussed. Behaviour when the qosStatus of the session is UNAVAILABLE - @quality_on_demand_extendQosSessionDuration_04_unavailableSession - Scenario: Response extending duration for unavailable session - Given an existing QoS session created by operation createSession with qosStatus "UNAVAILABLE" - And the path parameter "sessionId" is set to the value for that QoS session - And the request body is set to a valid request body - When the request "extendQosSessionDuration" is sent - Then the response status code is TBD - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response header "Content-Type" is "application/json" - # Errors 400 @quality_on_demand_extendQosSessionDuration_400.1_schema_not_compliant @@ -192,3 +170,18 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation extendQosSessionDurat And the response property "$.status" is 404 And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text + + # Errors 409 + + @quality_on_demand_extendQosSessionDuration_409.1_session_not_available + Scenario: Extending duration for session with qosStatus not available + Given an existing QoS session with qosStatus not "AVAILABLE" + And the path parameter "sessionId" is set to the value for that QoS session + And the request body is set to a valid request body + When the request "extendQosSessionDuration" is sent + Then the response status code is 409 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 409 + And the response property "$.code" is "QUALITY_ON_DEMAND.SESSION_EXTENSION_NOT_ALLOWED" + And the response property "$.message" contains a user friendly text