Skip to content

Commit

Permalink
Correcting relevant linting issues
Browse files Browse the repository at this point in the history
Scenario Outline without examples, totally
Step too long was really due to a previous step appended which had to be removed
Repeated scenario names
Multiple empty lines, not really wrong but same as trailing spaces
The 2 When in an scenario is not really an error, but a common best practice. I have rephrase it a bit because for that specific scenario makes sense (first you delete and then when the async deletion is effective you received an event)
  • Loading branch information
jlurien committed Aug 30, 2024
1 parent a144056 commit 9146b15
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Feature: CAMARA QoD Provisioning API, v0.1.0 - Operation createProvisioning
And the response property "$.message" contains a user friendly text

@qod_provisioning_createProvisioning_400.4_device_empty
Scenario Outline: The device value is an empty object
Scenario: The device value is an empty object
Given the request body property "$.device" is set to: {}
When the request "createProvisioning" is sent
Then the response status code is 400
Expand Down Expand Up @@ -184,7 +184,6 @@ Feature: CAMARA QoD Provisioning API, v0.1.0 - Operation createProvisioning
And the response property "$.code" is "INVALID_TOKEN" or "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text


# TBD if we neeed a dedicated code
@qod_provisioning_createProvisioning_400.9_non_existent_qos_profile
Scenario: Non existent QoS profile
Expand Down Expand Up @@ -263,7 +262,6 @@ Feature: CAMARA QoD Provisioning API, v0.1.0 - Operation createProvisioning
And the response property "$.code" is "DEVICE_NOT_FOUND"
And the response property "$.message" contains a user friendly text


# Errors 409

@qod_provisioning_createProvisioning_409.1_provisioning_conflict
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Feature: CAMARA QoD Provisioning API, v0.1.0 - Operation deleteProvisioning
And the path parameter "provisoningId" is set to the value for that QoD provisioning
When the request "deleteProvisioning" is sent
Then the response status code is 202
When the asynchronous deletion process is completed
And when the asynchronous deletion process is completed
Then an event is received at the address of the "$.sink" provided for createProvisioning
And the event header "Authorization" is set to "Bearer: " + the value of "$.sinkCredentials.accessToken" provided for createProvisioning
And the event header "Content-Type" is set to "application/cloudevents+json"
Expand Down Expand Up @@ -164,4 +164,3 @@ Feature: CAMARA QoD Provisioning API, v0.1.0 - Operation deleteProvisioning
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

Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Feature: CAMARA QoD Provisioning API, v0.1.0 - Operation retrieveProvisioningByD
And the response property "$.message" contains a user friendly text

@qod_provisioning_retrieveProvisioningByDevice_400.4_device_empty
Scenario Outline: The device value is an empty object
Scenario: The device value is an empty object
Given the request body property "$.device" is set to: {}
When the request "retrieveProvisioningByDevice" is sent
Then the response status code is 400
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Feature: CAMARA QoS Profiles API, v0.11.0 - Operation retrieveQoSProfiles
# * If some QoS Profile is restricted for some devices, provide the QoS profile name and device
# * A device object identifying a device commercialized by the implementation for which the service is not applicable, if any


# References to OAS spec schemas refer to schemas specifies in qos-profiles.yaml, version 0.11.0

Background: Common retrieveQoSProfiles setup
Expand Down Expand Up @@ -97,7 +96,6 @@ Feature: CAMARA QoS Profiles API, v0.11.0 - Operation retrieveQoSProfiles
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response body is []


# Errors 400

@qos_profiles_retrieveQoSProfiles_400.1_schema_not_compliant
Expand Down Expand Up @@ -179,7 +177,6 @@ Feature: CAMARA QoS Profiles API, v0.11.0 - Operation retrieveQoSProfiles
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


# Errors 403

@qos_profiles_retrieveQoSProfiles_403.1_device_token_mismatch
Expand Down
3 changes: 0 additions & 3 deletions code/Test_definitions/quality-on-demand-createSession.feature
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation createSession
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text


@quality_on_demand_createSession_400.2_no_request_body
Scenario: Missing request body
Given the request body is not included
Expand Down Expand Up @@ -274,7 +273,6 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation createSession
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


# Errors 403

@quality_on_demand_createSession_403.1_device_token_mismatch
Expand Down Expand Up @@ -305,7 +303,6 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation createSession
And the response property "$.code" is "DEVICE_NOT_FOUND"
And the response property "$.message" contains a user friendly text


# Errors 409

@quality_on_demand_createSession_409.1_session_conflict
Expand Down
5 changes: 2 additions & 3 deletions code/Test_definitions/quality-on-demand-deleteSession.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation deleteSession
# * The sessionId of an existing session with status "AVAILABLE", and with provided values for "sink" and "sinkCredential".
# * The sessionId of an existing session with status "UNAVAILABLE", and with provided values for "sink" and "sinkCredential".
#
# References to OAS spec schemas refer to schemas specifies in quality-on-demand.yaml, version 0.11.0
# References to OAS spec schemas refer to schemas specifies in quality-on-demand.yaml, version 0.11.0-rc.1

Background: Common deleteSession setup
Given an environment at "apiRoot"
Expand Down Expand Up @@ -97,14 +97,13 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation deleteSession
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


# Errors 403

# TBD which code is more appropriate for this scenario
@quality_on_demand_deleteSession_403.1_session_token_mismatch
Scenario: QoS session not created by the API client given in the access token
# To test this, a token have to be obtained for a different client
Given the header "Authorization" is set to a valid access token emitted to a client which did not created the QoS session And the header "Authorization" is set to a valid access token emitted for a different device
Given the header "Authorization" is set to a valid access token emitted to a client which did not created the QoS session
When the request "deleteSession" is sent
Then the response status code is 403
And the response header "x-correlator" has same value as the request header "x-correlator"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation extendQosSessionDurat

# To be discussed. Behaviour when the qosStatus of the session is REQUESTED
@quality_on_demand_extendQosSessionDuration_03_requestedSession
Scenario: Response extending duration for unavailable session
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
Expand Down Expand Up @@ -94,7 +94,7 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation extendQosSessionDurat

# 404 NOT_FOUND is an alternative if path parameter format is not validated
@quality_on_demand_extendQosSessionDuration_400.2_invalid_session_id
Scenario: Invalid Argument. Generic Syntax Exception
Scenario: Invalid sessionId
Given the path parameter "sessionId" has not a UUID format
When the request "extendQosSessionDuration" is sent
Then the response status code is 400
Expand Down Expand Up @@ -164,14 +164,13 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation extendQosSessionDurat
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


# Errors 403

# TBD which code is more appropriate for this scenario
@quality_on_demand_extendQosSessionDuration_403.1_session_token_mismatch
Scenario: QoS session not created by the API client given in the access token
# To test this, a token have to be obtained for a different client
Given the header "Authorization" is set to a valid access token emitted to a client which did not created the QoS session And the header "Authorization" is set to a valid access token emitted for a different device
Given the header "Authorization" is set to a valid access token emitted to a client which did not created the QoS session
When the request "extendQosSessionDuration" is sent
Then the response status code is 403
And the response header "x-correlator" has same value as the request header "x-correlator"
Expand Down
1 change: 0 additions & 1 deletion code/Test_definitions/quality-on-demand-getSession.feature
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation getSession
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


# Errors 403

# TBD which code is more appropriate for this scenario
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation retrieveSessionsByDev
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response body is []


# Errors 400

@quality_on_demand_retrieveSessionsByDevice_400.1_schema_not_compliant
Expand All @@ -69,7 +68,6 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation retrieveSessionsByDev
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text


@quality_on_demand_retrieveSessionsByDevice_400.2_no_request_body
Scenario: Missing request body
Given the request body is not included
Expand Down Expand Up @@ -174,7 +172,6 @@ Feature: CAMARA Quality On Demand API, v0.11.0 - Operation retrieveSessionsByDev
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


# Errors 403

@quality_on_demand_retrieveSessionsByDevice_403.1_device_token_mismatch
Expand Down

0 comments on commit 9146b15

Please sign in to comment.