Skip to content

Commit a7377b6

Browse files
authored
Merge pull request #143 from FabrizioMoggio/Gherkin-v0.9
Create Traffic_Influence_Test.feature
2 parents e599de0 + daf5f4c commit a7377b6

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#/*- ---license-start
2+
#* CAMARA Project
3+
#* ---
4+
#* Copyright (C) 2022 - 2023 Contributors | Deutsche Telekom AG to CAMARA a Series of LF Projects, LLC
5+
#* The contributor of this file confirms his sign-off for the
6+
#* Developer Certificate of Origin (http://developercertificate.org).
7+
#* ---
8+
#* Licensed under the Apache License, Version 2.0 (the "License");
9+
#* you may not use this file except in compliance with the License.
10+
#* You may obtain a copy of the License at
11+
#*
12+
#* http://www.apache.org/licenses/LICENSE-2.0
13+
#*
14+
#* Unless required by applicable law or agreed to in writing, software
15+
#* distributed under the License is distributed on an "AS IS" BASIS,
16+
#* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
#* See the License for the specific language governing permissions and
18+
#* limitations under the License.
19+
#* ---license-end
20+
#*/
21+
22+
@TI @TISanity
23+
Feature: Automated Traffic Influence API Test
24+
25+
@TI_Resource_LCM_Mandatory_Parameters_Valid
26+
Scenario: Manage Traffic Influence (TI) Resource with mandatory parameters
27+
Given the usage of the Traffic Influence API URL
28+
When creating a new TI Resource, with POST, with mandatory parameters ("apiConsumerId", "applicationId")
29+
Then it should be created a new TI Resource and the optimal routing will be activated for any user on any location
30+
And Response Code is 201
31+
And response contains the TI Resource with the resource identifier ("trafficInfluenceID") valorised with a unique value, the status of the request ("state=ordered") and the previously used parameters valorised as in the POST request
32+
When asking for a previously created TI Resource, with GET, with the parameter "trafficInfluenceID" valorised with the reponse of the previous POST
33+
Then Response code is 200
34+
And response contains a TI Resource with a potentially updated status ("state") reporting the current status of the traffic influece configuration (ordered, created, active, error, deleted)
35+
When deleting an existing TI Resource, with DELETE, with the parameter "trafficInfluenceID" valorised with the reponse of the previous POST
36+
Then Response Code is 202 and the response message is Accepted meaning that the resource deletion is accepted and in progress. The satus update can be retrived with the GET method on that TI Resource. The final value of the parameter "state" is "deleted".
37+
38+
@TI_Resource_LCM_Optional_Parameters_Valid
39+
Scenario: Manage Traffic Influence (TI) Resource with also optional parameters
40+
Given the usage of the Traffic Influence API URL
41+
Given the acquisition of the applicationId via the EdgeCloudAPI
42+
Given the acquisition of Regions and Zones
43+
When creating a new TI Resource, with POST, with mandatory parameters ("apiConsumerId", "applicationId") and any other optional parameter (e.g. "instanceId", "zone")
44+
Then it should be created a new TI Resource and the optimal routing will be activated according to the optional paramters specified (e.g. only in a specific zone or for a specific user)
45+
And Response Code is 201
46+
And response contains the TI Resource with the resource identifier ("trafficInfluenceID"), the status of the request ("state=ordered") and the previously used paramters valorised as in the POST request
47+
When asking for a previously created TI Resource, with GET, with the parameter "trafficInfluenceID" valorised with the reponse of the previous POST
48+
Then Response code is 200
49+
And response contains a TI Resource with the a potentially updated status ("state") reporting the current status of the traffic influece configuration (ordered, created, active, error, deleted)
50+
When updating an existing TI Resource, with, PATCH, with the parameter "trafficInfluenceID" valorised with the reponse of the previous POST and with some of the optional parameters updated (the madatory parameters can not be updated) and, potentially, some of the optional parameters still having the same value as before
51+
Then the TI Resource is modified
52+
And Response Code is 200
53+
And response contains the TI Resource with the resource identifier ("trafficInfluenceID"), the status of the request ("state=ordered") and the previously used paramters valorised as in the PATCH request
54+
When deleting an existing TI Resource, with DELETE, with the parameter "trafficInfluenceID" valorised with the reponse of the previous POST
55+
Then Response Code is 202 and the responce message is Accepted meaning that the resource deletion is accepted and in progress. The satus update can be retrived with the GET method on that TI Resource. The final value of the parameter "state" is "deleted".
56+
57+
@TI_Resource_LCM_Invalid_Parameters
58+
Scenario: Manage Traffic Influence Resource with invalid paramters
59+
Given the usage of the Traffic Influence API URL
60+
When creating a new TI Resource, with POST, with invalid parameters (mandatory or optionals)
61+
Then no new TI Resource is created and no optimal routing will be activated
62+
And Response Code is 400
63+
When asking for a previously created TI Resource, with GET, with an invalid parameter "trafficInfluenceID"
64+
Then Response code is 404
65+
When updating an existing TI Resource, with, PATCH, with invalid an invalid parameter "trafficInfluenceID"
66+
Then Response Code is 404
67+
When updating an existing TI Resource, with, PATCH, with invalid parameters (with the exclusion of "trafficInfluenceID")
68+
Then Response Code is 400
69+
When deleting an existing TI Resource, with DELETE, with an invalid parameter "trafficInfluenceID"
70+
Then Response Code is 400
71+
72+
@TI_Incomplete_Parameters_TI_Creation
73+
Scenario: Creation of new TI Resource without all the mandatory parameters
74+
Given the usage of the Traffic Influence API URL
75+
When creating a new TI Resource, with POST, without all the mandatory parameters ("apiConsumerId", "applicationId")
76+
Then no new TI Resource is created and no optimal routing will be activated
77+
And Response Code is 400
78+
79+
80+
81+

0 commit comments

Comments
 (0)