-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from FabrizioMoggio/Gherkin-v0.9
Create Traffic_Influence_Test.feature
- Loading branch information
Showing
1 changed file
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#/*- ---license-start | ||
#* CAMARA Project | ||
#* --- | ||
#* Copyright (C) 2022 - 2023 Contributors | Deutsche Telekom AG to CAMARA a Series of LF Projects, LLC | ||
#* The contributor of this file confirms his sign-off for the | ||
#* Developer Certificate of Origin (http://developercertificate.org). | ||
#* --- | ||
#* Licensed under the Apache License, Version 2.0 (the "License"); | ||
#* you may not use this file except in compliance with the License. | ||
#* You may obtain a copy of the License at | ||
#* | ||
#* http://www.apache.org/licenses/LICENSE-2.0 | ||
#* | ||
#* Unless required by applicable law or agreed to in writing, software | ||
#* distributed under the License is distributed on an "AS IS" BASIS, | ||
#* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
#* See the License for the specific language governing permissions and | ||
#* limitations under the License. | ||
#* ---license-end | ||
#*/ | ||
|
||
@TI @TISanity | ||
Feature: Automated Traffic Influence API Test | ||
|
||
@TI_Resource_LCM_Mandatory_Parameters_Valid | ||
Scenario: Manage Traffic Influence (TI) Resource with mandatory parameters | ||
Given the usage of the Traffic Influence API URL | ||
When creating a new TI Resource, with POST, with mandatory parameters ("apiConsumerId", "applicationId") | ||
Then it should be created a new TI Resource and the optimal routing will be activated for any user on any location | ||
And Response Code is 201 | ||
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 | ||
When asking for a previously created TI Resource, with GET, with the parameter "trafficInfluenceID" valorised with the reponse of the previous POST | ||
Then Response code is 200 | ||
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) | ||
When deleting an existing TI Resource, with DELETE, with the parameter "trafficInfluenceID" valorised with the reponse of the previous POST | ||
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". | ||
|
||
@TI_Resource_LCM_Optional_Parameters_Valid | ||
Scenario: Manage Traffic Influence (TI) Resource with also optional parameters | ||
Given the usage of the Traffic Influence API URL | ||
Given the acquisition of the applicationId via the EdgeCloudAPI | ||
Given the acquisition of Regions and Zones | ||
When creating a new TI Resource, with POST, with mandatory parameters ("apiConsumerId", "applicationId") and any other optional parameter (e.g. "instanceId", "zone") | ||
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) | ||
And Response Code is 201 | ||
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 | ||
When asking for a previously created TI Resource, with GET, with the parameter "trafficInfluenceID" valorised with the reponse of the previous POST | ||
Then Response code is 200 | ||
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) | ||
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 | ||
Then the TI Resource is modified | ||
And Response Code is 200 | ||
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 | ||
When deleting an existing TI Resource, with DELETE, with the parameter "trafficInfluenceID" valorised with the reponse of the previous POST | ||
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". | ||
|
||
@TI_Resource_LCM_Invalid_Parameters | ||
Scenario: Manage Traffic Influence Resource with invalid paramters | ||
Given the usage of the Traffic Influence API URL | ||
When creating a new TI Resource, with POST, with invalid parameters (mandatory or optionals) | ||
Then no new TI Resource is created and no optimal routing will be activated | ||
And Response Code is 400 | ||
When asking for a previously created TI Resource, with GET, with an invalid parameter "trafficInfluenceID" | ||
Then Response code is 404 | ||
When updating an existing TI Resource, with, PATCH, with invalid an invalid parameter "trafficInfluenceID" | ||
Then Response Code is 404 | ||
When updating an existing TI Resource, with, PATCH, with invalid parameters (with the exclusion of "trafficInfluenceID") | ||
Then Response Code is 400 | ||
When deleting an existing TI Resource, with DELETE, with an invalid parameter "trafficInfluenceID" | ||
Then Response Code is 400 | ||
|
||
@TI_Incomplete_Parameters_TI_Creation | ||
Scenario: Creation of new TI Resource without all the mandatory parameters | ||
Given the usage of the Traffic Influence API URL | ||
When creating a new TI Resource, with POST, without all the mandatory parameters ("apiConsumerId", "applicationId") | ||
Then no new TI Resource is created and no optimal routing will be activated | ||
And Response Code is 400 | ||
|
||
|
||
|
||
|