Skip to content

Commit d274cfd

Browse files
Rework MultiPoint VPN feature tests (#40)
Replace legacy, high-level feature files with operation-specific specs and normalize scenarios.
1 parent 30cecfd commit d274cfd

11 files changed

Lines changed: 510 additions & 110 deletions

code/Test_definitions/assessment.feature

Lines changed: 0 additions & 21 deletions
This file was deleted.

code/Test_definitions/creation.feature

Lines changed: 0 additions & 16 deletions
This file was deleted.

code/Test_definitions/deletion.feature

Lines changed: 0 additions & 15 deletions
This file was deleted.

code/Test_definitions/modification.feature

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
Feature: CAMARA MultiPoint VPN API, vwip - Operation assessConnectionFeasibility
2+
3+
Background:
4+
Given an environment at "apiRoot"
5+
And the resource "/multi-point-vpn/vwip/assessment"
6+
And the header "Content-Type" is set to "application/json"
7+
And the header "Authorization" is set to a valid access token
8+
And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator"
9+
And the request body is compliant with the schema at "#/components/schemas/AssessmentRequest"
10+
11+
@multi_point_vpn_assessConnectionFeasibility_success_01_assessment_result
12+
Scenario: Successfully assess multipoint VPN connection feasibility
13+
Given the request body property "$.isProtected" is set to true
14+
And the request body property "$.connections" contains a valid connection with customerEdge and providerEdge
15+
And the request body property "$.guaranteeBandwidth" is set to 20
16+
And the request body property "$.duration" is set to a valid Duration object with value 6 and unit "days"
17+
When the request "assessConnectionFeasibility" is sent
18+
Then the response status code is 200
19+
And the response header "Content-Type" is "application/json"
20+
And the response header "x-correlator" has the same value as the request header "x-correlator"
21+
And the response body complies with the schema at "#/components/schemas/AssessmentResult"
22+
23+
@multi_point_vpn_assessConnectionFeasibility_error_400_01_invalid_request_body
24+
Scenario: Error 400 due to request body not complying with AssessmentRequest schema
25+
Given the request body does not comply with the schema at "#/components/schemas/AssessmentRequest"
26+
When the request "assessConnectionFeasibility" is sent
27+
Then the response status code is 400
28+
And the response header "Content-Type" is "application/json"
29+
And the response header "x-correlator" has the same value as the request header "x-correlator"
30+
And the response property "$.status" is 400
31+
And the response property "$.code" is "INVALID_ARGUMENT"
32+
And the response property "$.message" contains a user friendly text
33+
34+
@multi_point_vpn_assessConnectionFeasibility_error_400_02_out_of_range_bandwidth
35+
Scenario: Error 400 due to guaranteeBandwidth value out of allowed range
36+
Given the request body property "$.guaranteeBandwidth" is set to a value not between 1 and 1000000
37+
When the request "assessConnectionFeasibility" is sent
38+
Then the response status code is 400
39+
And the response header "Content-Type" is "application/json"
40+
And the response header "x-correlator" has the same value as the request header "x-correlator"
41+
And the response property "$.status" is 400
42+
And the response property "$.code" is "INVALID_ARGUMENT" or "OUT_OF_RANGE"
43+
And the response property "$.message" contains a user friendly text
44+
45+
@multi_point_vpn_assessConnectionFeasibility_error_400_03_invalid_duration_unit
46+
Scenario: Error 400 due to duration unit not matching allowed enum
47+
Given the request body property "$.duration.unit" is set to a value not in ["minutes", "hours", "days", "months", "years"]
48+
When the request "assessConnectionFeasibility" is sent
49+
Then the response status code is 400
50+
And the response header "Content-Type" is "application/json"
51+
And the response header "x-correlator" has the same value as the request header "x-correlator"
52+
And the response property "$.status" is 400
53+
And the response property "$.code" is "INVALID_ARGUMENT"
54+
And the response property "$.message" contains a user friendly text
55+
56+
@multi_point_vpn_assessConnectionFeasibility_error_401_01_no_authorization_header
57+
Scenario: Error 401 when Authorization header is missing
58+
Given the header "Authorization" is removed
59+
When the request "assessConnectionFeasibility" is sent
60+
Then the response status code is 401
61+
And the response header "Content-Type" is "application/json"
62+
And the response header "x-correlator" has the same value as the request header "x-correlator"
63+
And the response property "$.status" is 401
64+
And the response property "$.code" is "UNAUTHENTICATED"
65+
And the response property "$.message" contains a user friendly text
66+
67+
@multi_point_vpn_assessConnectionFeasibility_error_401_02_expired_access_token
68+
Scenario: Error 401 when access token is expired
69+
Given the header "Authorization" is set to an expired access token
70+
When the request "assessConnectionFeasibility" is sent
71+
Then the response status code is 401
72+
And the response header "Content-Type" is "application/json"
73+
And the response header "x-correlator" has the same value as the request header "x-correlator"
74+
And the response property "$.status" is 401
75+
And the response property "$.code" is "UNAUTHENTICATED"
76+
And the response property "$.message" contains a user friendly text
77+
78+
@multi_point_vpn_assessConnectionFeasibility_error_403_01_missing_scope
79+
Scenario: Error 403 when access token lacks the multi-point-vpn:assessment:assess scope
80+
Given the header "Authorization" is set to a valid access token without the "multi-point-vpn:assessment:assess" scope
81+
When the request "assessConnectionFeasibility" is sent
82+
Then the response status code is 403
83+
And the response header "Content-Type" is "application/json"
84+
And the response header "x-correlator" has the same value as the request header "x-correlator"
85+
And the response property "$.status" is 403
86+
And the response property "$.code" is "PERMISSION_DENIED"
87+
And the response property "$.message" contains a user friendly text
88+
89+
@multi_point_vpn_assessConnectionFeasibility_error_500_01_internal_server_error
90+
Scenario: Error 500 due to internal server error
91+
Given an internal server error occurs
92+
When the request "assessConnectionFeasibility" is sent
93+
Then the response status code is 500
94+
And the response header "Content-Type" is "application/json"
95+
And the response header "x-correlator" has the same value as the request header "x-correlator"
96+
And the response property "$.status" is 500
97+
And the response property "$.code" is "INTERNAL"
98+
And the response property "$.message" contains a user friendly text
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
Feature: CAMARA MultiPoint VPN API, vwip - Operation createNetwork
2+
3+
Background:
4+
Given an environment at "apiRoot"
5+
And the resource "/multi-point-vpn/vwip/networks"
6+
And the header "Content-Type" is set to "application/json"
7+
And the header "Authorization" is set to a valid access token
8+
And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator"
9+
10+
@multi_point_vpn_createNetwork_success_01_create_network
11+
Scenario: Successfully create a multipoint VPN network
12+
Given the request body complies with the schema at "#/components/schemas/NetworkCreate"
13+
And the request body property "$.isProtected" is set to true
14+
And the request body property "$.connections" contains at least one valid connection with customerEdge and providerEdge
15+
And the request body property "$.guaranteeBandwidth" is set to 20
16+
And the request body property "$.sla" is set to "AA"
17+
When the request "createNetwork" is sent
18+
Then the response status code is 201
19+
And the response header "Content-Type" is "application/json"
20+
And the response header "x-correlator" has the same value as the request header "x-correlator"
21+
And the response body complies with the schema at "#/components/schemas/Network"
22+
And the response property "$.serviceId" is present
23+
24+
@multi_point_vpn_createNetwork_error_400_01_invalid_argument
25+
Scenario: Error 400 due to request body not complying with NetworkCreate schema
26+
Given the request body does not comply with the schema at "#/components/schemas/NetworkCreate"
27+
When the request "createNetwork" is sent
28+
Then the response status code is 400
29+
And the response header "Content-Type" is "application/json"
30+
And the response header "x-correlator" has the same value as the request header "x-correlator"
31+
And the response property "$.status" is 400
32+
And the response property "$.code" is "INVALID_ARGUMENT"
33+
And the response property "$.message" contains a user friendly text
34+
35+
@multi_point_vpn_createNetwork_error_400_02_out_of_range_bandwidth
36+
Scenario: Error 400 due to guaranteeBandwidth value out of allowed range
37+
Given the request body property "$.guaranteeBandwidth" is set to a value not between 1 and 1000000
38+
When the request "createNetwork" is sent
39+
Then the response status code is 400
40+
And the response header "Content-Type" is "application/json"
41+
And the response header "x-correlator" has the same value as the request header "x-correlator"
42+
And the response property "$.status" is 400
43+
And the response property "$.code" is "INVALID_ARGUMENT" or "OUT_OF_RANGE"
44+
And the response property "$.message" contains a user friendly text
45+
46+
@multi_point_vpn_createNetwork_error_400_03_invalid_sla
47+
Scenario: Error 400 due to sla value not matching allowed enum
48+
Given the request body property "$.sla" is set to a value not in ["A", "AA", "AAA"]
49+
When the request "createNetwork" is sent
50+
Then the response status code is 400
51+
And the response header "Content-Type" is "application/json"
52+
And the response header "x-correlator" has the same value as the request header "x-correlator"
53+
And the response property "$.status" is 400
54+
And the response property "$.code" is "INVALID_ARGUMENT"
55+
And the response property "$.message" contains a user friendly text
56+
57+
@multi_point_vpn_createNetwork_error_401_01_no_authorization_header
58+
Scenario: Error 401 when Authorization header is missing
59+
Given the header "Authorization" is removed
60+
When the request "createNetwork" is sent
61+
Then the response status code is 401
62+
And the response header "Content-Type" is "application/json"
63+
And the response header "x-correlator" has the same value as the request header "x-correlator"
64+
And the response property "$.status" is 401
65+
And the response property "$.code" is "UNAUTHENTICATED"
66+
And the response property "$.message" contains a user friendly text
67+
68+
@multi_point_vpn_createNetwork_error_401_02_expired_access_token
69+
Scenario: Error 401 when access token is expired
70+
Given the header "Authorization" is set to an expired access token
71+
When the request "createNetwork" is sent
72+
Then the response status code is 401
73+
And the response header "Content-Type" is "application/json"
74+
And the response header "x-correlator" has the same value as the request header "x-correlator"
75+
And the response property "$.status" is 401
76+
And the response property "$.code" is "UNAUTHENTICATED"
77+
And the response property "$.message" contains a user friendly text
78+
79+
@multi_point_vpn_createNetwork_error_403_01_missing_scope
80+
Scenario: Error 403 when access token lacks the multi-point-vpn:network:create scope
81+
Given the header "Authorization" is set to a valid access token without the "multi-point-vpn:network:create" scope
82+
When the request "createNetwork" is sent
83+
Then the response status code is 403
84+
And the response header "Content-Type" is "application/json"
85+
And the response header "x-correlator" has the same value as the request header "x-correlator"
86+
And the response property "$.status" is 403
87+
And the response property "$.code" is "PERMISSION_DENIED"
88+
And the response property "$.message" contains a user friendly text
89+
90+
@multi_point_vpn_createNetwork_error_500_01_internal_server_error
91+
Scenario: Error 500 due to internal server error
92+
Given an internal server error occurs
93+
When the request "createNetwork" is sent
94+
Then the response status code is 500
95+
And the response header "Content-Type" is "application/json"
96+
And the response header "x-correlator" has the same value as the request header "x-correlator"
97+
And the response property "$.status" is 500
98+
And the response property "$.code" is "INTERNAL"
99+
And the response property "$.message" contains a user friendly text
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
Feature: CAMARA MultiPoint VPN API, vwip - Operation deleteNetwork
2+
3+
Background:
4+
Given an environment at "apiRoot"
5+
And the resource "/multi-point-vpn/vwip/networks/{serviceId}"
6+
And the header "Authorization" is set to a valid access token
7+
And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator"
8+
9+
@multi_point_vpn_deleteNetwork_success_01_delete_accepted
10+
Scenario: Successfully request deletion of a multipoint VPN network
11+
Given the path parameter "serviceId" is set to an existing network identifier
12+
When the request "deleteNetwork" is sent
13+
Then the response status code is 202
14+
And the response header "x-correlator" has the same value as the request header "x-correlator"
15+
16+
@multi_point_vpn_deleteNetwork_error_400_01_invalid_serviceId
17+
Scenario: Error 400 due to serviceId not complying with the allowed pattern
18+
Given the path parameter "serviceId" does not comply with the schema at "#/components/parameters/serviceId"
19+
When the request "deleteNetwork" is sent
20+
Then the response status code is 400
21+
And the response header "Content-Type" is "application/json"
22+
And the response header "x-correlator" has the same value as the request header "x-correlator"
23+
And the response property "$.status" is 400
24+
And the response property "$.code" is "INVALID_ARGUMENT"
25+
And the response property "$.message" contains a user friendly text
26+
27+
@multi_point_vpn_deleteNetwork_error_401_01_no_authorization_header
28+
Scenario: Error 401 when Authorization header is missing
29+
Given the header "Authorization" is removed
30+
And the path parameter "serviceId" is set to an existing network identifier
31+
When the request "deleteNetwork" is sent
32+
Then the response status code is 401
33+
And the response header "Content-Type" is "application/json"
34+
And the response header "x-correlator" has the same value as the request header "x-correlator"
35+
And the response property "$.status" is 401
36+
And the response property "$.code" is "UNAUTHENTICATED"
37+
And the response property "$.message" contains a user friendly text
38+
39+
@multi_point_vpn_deleteNetwork_error_401_02_expired_access_token
40+
Scenario: Error 401 when access token is expired
41+
Given the header "Authorization" is set to an expired access token
42+
And the path parameter "serviceId" is set to an existing network identifier
43+
When the request "deleteNetwork" is sent
44+
Then the response status code is 401
45+
And the response header "Content-Type" is "application/json"
46+
And the response header "x-correlator" has the same value as the request header "x-correlator"
47+
And the response property "$.status" is 401
48+
And the response property "$.code" is "UNAUTHENTICATED"
49+
And the response property "$.message" contains a user friendly text
50+
51+
@multi_point_vpn_deleteNetwork_error_403_01_missing_scope
52+
Scenario: Error 403 when access token lacks the multi-point-vpn:network:delete scope
53+
Given the header "Authorization" is set to a valid access token without the "multi-point-vpn:network:delete" scope
54+
And the path parameter "serviceId" is set to an existing network identifier
55+
When the request "deleteNetwork" is sent
56+
Then the response status code is 403
57+
And the response header "Content-Type" is "application/json"
58+
And the response header "x-correlator" has the same value as the request header "x-correlator"
59+
And the response property "$.status" is 403
60+
And the response property "$.code" is "PERMISSION_DENIED"
61+
And the response property "$.message" contains a user friendly text
62+
63+
@multi_point_vpn_deleteNetwork_error_404_01_network_not_found
64+
Scenario: Error 404 when the requested network does not exist
65+
Given the path parameter "serviceId" is set to a non-existent network identifier
66+
When the request "deleteNetwork" is sent
67+
Then the response status code is 404
68+
And the response header "Content-Type" is "application/json"
69+
And the response header "x-correlator" has the same value as the request header "x-correlator"
70+
And the response property "$.status" is 404
71+
And the response property "$.code" is "NOT_FOUND"
72+
And the response property "$.message" contains a user friendly text
73+
74+
@multi_point_vpn_deleteNetwork_error_500_01_internal_server_error
75+
Scenario: Error 500 due to internal server error
76+
Given an internal server error occurs
77+
And the path parameter "serviceId" is set to an existing network identifier
78+
When the request "deleteNetwork" is sent
79+
Then the response status code is 500
80+
And the response header "Content-Type" is "application/json"
81+
And the response header "x-correlator" has the same value as the request header "x-correlator"
82+
And the response property "$.status" is 500
83+
And the response property "$.code" is "INTERNAL"
84+
And the response property "$.message" contains a user friendly text

0 commit comments

Comments
 (0)