Skip to content
Snippets Groups Projects
Verified Commit 8722e02d authored by Georgi Michev's avatar Georgi Michev
Browse files

Add Content Access tests

parent 5f91e3a9
No related branches found
No related tags found
1 merge request!60Add Content Access tests
Pipeline #68943 passed
...@@ -6,5 +6,17 @@ ...@@ -6,5 +6,17 @@
}, },
"default_set": { "default_set": {
"msg": "default" "msg": "default"
},
"content_access_01": {
"key": "value 01",
"data": "data value 01"
},
"content_access_02": {
"key": "value 02",
"data": "data value 02"
},
"content_access_03": {
"key": "value 03",
"data": "data value 03"
} }
} }
\ No newline at end of file
...@@ -24,6 +24,138 @@ Feature: API -TSA - Cache - v1/cache GET ...@@ -24,6 +24,138 @@ Feature: API -TSA - Cache - v1/cache GET
Then the status code should be {200} Then the status code should be {200}
And the field {msg} has the value {successful setting the cache} And the field {msg} has the value {successful setting the cache}
@phase2 @IDM.TSA.E1.00020
Scenario: TSA - Get merged Content Access - Positive
# Set the first cache record
When I load the REST request {Cache.json} with profile {content_access_01}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {01} into current request HEADER {x-cache-scope}
And I load value {10} into current request HEADER {x-cache-ttl}
And I send the Cache POST request via TSA Cache API
And the status code should be {201}
Then I clear the request body
And I clear ALL headers
# Set the second cache record
And I load the REST request {Cache.json} with profile {content_access_02}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {02} into current request HEADER {x-cache-scope}
And I load value {10} into current request HEADER {x-cache-ttl}
And I send the Cache POST request via TSA Cache API
And the status code should be {201}
Then I clear the request body
And I clear ALL headers
# Set the third cache record
And I load the REST request {Cache.json} with profile {content_access_03}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {03} into current request HEADER {x-cache-scope}
And I load value {10} into current request HEADER {x-cache-ttl}
And I send the Cache POST request via TSA Cache API
And the status code should be {201}
Then I clear the request body
And I clear ALL headers
# Get the merged cache result
And I load value {merge} into current request HEADER {x-cache-flatten-strategy}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {01,02,03} into current request HEADER {x-cache-scope}
And I send the Cache GET request via TSA Cache API
Then the status code should be {200}
And the field {data_1} has the value {data value 01}
And the field {data_2} has the value {data value 02}
And the field {data_3} has the value {data value 03}
And the field {key_1} has the value {value 01}
And the field {key_2} has the value {value 02}
And the field {key_3} has the value {value 03}
@phase2 @IDM.TSA.E1.00020
Scenario: TSA - Get the first cache from merged - Content Access - Positive
# Set the first cache record
When I load the REST request {Cache.json} with profile {content_access_01}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {01} into current request HEADER {x-cache-scope}
And I load value {10} into current request HEADER {x-cache-ttl}
And I send the Cache POST request via TSA Cache API
And the status code should be {201}
Then I clear the request body
And I clear ALL headers
# Set the second cache record
And I load the REST request {Cache.json} with profile {content_access_02}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {02} into current request HEADER {x-cache-scope}
And I load value {10} into current request HEADER {x-cache-ttl}
And I send the Cache POST request via TSA Cache API
And the status code should be {201}
Then I clear the request body
And I clear ALL headers
# Get the merged cache result and show just the first one
And I load value {first} into current request HEADER {x-cache-flatten-strategy}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {01,02} into current request HEADER {x-cache-scope}
And I send the Cache GET request via TSA Cache API
Then the status code should be {200}
And the field {data} has the value {data value 01}
And the field {key} has the value {value 01}
@phase2 @IDM.TSA.E1.00020
Scenario: TSA - Get the last cache from merged - Content Access - Positive
# Set the first cache record
When I load the REST request {Cache.json} with profile {content_access_01}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {01} into current request HEADER {x-cache-scope}
And I load value {10} into current request HEADER {x-cache-ttl}
And I send the Cache POST request via TSA Cache API
And the status code should be {201}
Then I clear the request body
And I clear ALL headers
# Set the second cache record
And I load the REST request {Cache.json} with profile {content_access_02}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {02} into current request HEADER {x-cache-scope}
And I load value {10} into current request HEADER {x-cache-ttl}
And I send the Cache POST request via TSA Cache API
And the status code should be {201}
Then I clear the request body
And I clear ALL headers
# Get the merged cache result and show just the last one
And I load value {last} into current request HEADER {x-cache-flatten-strategy}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {01,02} into current request HEADER {x-cache-scope}
And I send the Cache GET request via TSA Cache API
Then the status code should be {200}
And the field {data} has the value {data value 02}
And the field {key} has the value {value 02}
@phase2 @IDM.TSA.E1.00020
Scenario: TSA - Get existing and non existing cache - Content Access - Positive
# Set the cache record
When I load the REST request {Cache.json} with profile {content_access_01}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {01} into current request HEADER {x-cache-scope}
And I load value {10} into current request HEADER {x-cache-ttl}
And I send the Cache POST request via TSA Cache API
And the status code should be {201}
Then I clear the request body
And I clear ALL headers
# Get the merged cache result
When I load value {merge} into current request HEADER {x-cache-flatten-strategy}
And I load value {did:web:example.com} into current request HEADER {x-cache-key}
And I load value {Login} into current request HEADER {x-cache-namespace}
And I load value {01, nonExisting} into current request HEADER {x-cache-scope}
And I send the Cache GET request via TSA Cache API
Then the status code should be {200}
And the field {data} has the value {data value 01}
And the field {key} has the value {value 01}
@negative @negative
Scenario: TSA - Setting 10 seconds time to live and verifying it expires - Negative Scenario: TSA - Setting 10 seconds time to live and verifying it expires - Negative
When I load the REST request {Cache.json} with profile {successful_set} When I load the REST request {Cache.json} with profile {successful_set}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment