generated from camaraproject/Template_API_Repository
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathC02-phoneNumber-errors.feature
68 lines (58 loc) · 4.11 KB
/
C02-phoneNumber-errors.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Feature: CAMARA Common Artifact C02 - Test scenarios for phoneNumber errors
Common error scenarios for POST operations with phoneNumber as input either in the request
body or implied from the access
NOTES:
* This is not a complete feature but a collection of scenarios that can be applied with minor
modifications to test plans. Test plans would have to copy and adapt the scenarios as part of
their own feature files, along with other scenarios.
* These scenarios assume that other properties not explicitly mentioned in the scenario
are set by default to a valid value. This can be specified in the feature Background.
* {{feature_identifier}} has to be substituted to the value corresponding to the feature file where
these scenarios are included.
# Error scenarios for management of input parameter phoneNumber
@{{feature_identifier}}_C02.01_phone_number_not_schema_compliant
Scenario: Phone number value does not comply with the schema
Given the header "Authorization" is set to a valid access token which does not identify a single phone number
And the request body property "$.phoneNumber" does not comply with the OAS schema at "/components/schemas/PhoneNumber"
When the HTTP "POST" request is sent
Then the response status code is 400
And the response property "$.status" is 400
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text
@{{feature_identifier}}_C02.02_phone_number_not_found
Scenario: Phone number not found
Given the header "Authorization" is set to a valid access token which does not identify a single phone number
And the request body property "$.phoneNumber" is compliant with the schema but does not identify a valid phone number
When the HTTP "POST" request is sent
Then the response status code is 404
And the response property "$.status" is 404
And the response property "$.code" is "IDENTIFIER_NOT_FOUND"
And the response property "$.message" contains a user friendly text
@{{feature_identifier}}_C02.03_unnecessary_phone_number
Scenario: Phone number not to be included when it can be deduced from the access token
Given the header "Authorization" is set to a valid access token identifying a phone number
And the request body property "$.phoneNumber" is set to a valid phone number
When the HTTP "POST" request is sent
Then the response status code is 422
And the response property "$.status" is 422
And the response property "$.code" is "UNNECESSARY_IDENTIFIER"
And the response property "$.message" contains a user friendly text
@{{feature_identifier}}_C02.04_missing_phone_number
Scenario: Phone number not included and cannot be deducted from the access token
Given the header "Authorization" is set to a valid access token which does not identify a single phone number
And the request body property "$.phoneNumber" is not included
When the HTTP "POST" request is sent
Then the response status code is 422
And the response property "$.status" is 422
And the response property "$.code" is "MISSING_IDENTIFIER"
And the response property "$.message" contains a user friendly text
# When the service is only offered to certain type of subscriptions, e.g. IoT, , B2C, etc
@{{feature_identifier}}_C02.05_phone_number_not_supported
Scenario: Service not available for the phone number
Given that the service is not available for all phone numbers commercialized by the operator
And a valid phone number, identified by the token or provided in the request body, for which the service is not applicable
When the HTTP "POST" request is sent
Then the response status code is 422
And the response property "$.status" is 422
And the response property "$.code" is "SERVICE_NOT_APPLICABLE"
And the response property "$.message" contains a user friendly text