Skip to content
Snippets Groups Projects
Unverified Commit a89c8214 authored by Georgi Michev's avatar Georgi Michev
Browse files
parent e5192fd6
No related branches found
No related tags found
1 merge request!35Add tests for evaluating policies and setting cache using header.
Pipeline #54585 passed with stage
in 6 minutes and 59 seconds
......@@ -13,5 +13,6 @@
},
"did_missing_method": {
"did":"did:idunion:BDrEcHc8Tb4Lb2VyQZWEDE"
}
},
"empty": {}
}
\ No newline at end of file
......@@ -40,6 +40,20 @@ Feature: API -TSA - Cache - v1/cache GET
Then the status code should be {200}
And the field {msg} has the value {successful setting the cache}
@test
Scenario: TSA - using header values for setting TTL on cache - Positive
When I load the REST request {Cache.json} with profile {successful_set}
And I load value {test} into current request HEADER {x-cache-key}
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 send the Cache GET request via TSA Cache API
Then the status code should be {200}
When I wait for {10000} mseconds
And I send the Cache GET request via TSA Cache API
Then the status code should be {404}
@negative
Scenario: TSA - Access non existing Cache - Negative
Given I load value {NEGATIVE} into current request HEADER {x-cache-key}
......
......@@ -44,6 +44,22 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST
And the response is valid according to the {Policy_EvaluateDID_schema.json} REST schema
And the field {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
Scenario: TSA - using header values for policy execution - Positive
When I load the REST request {Policy.json} with profile {empty}
And I load value {someValue} into current request HEADER {X-Cache-Key}
And I execute the Policy group {example} name {getHeader} version {1.0} via TSA Policy API
Then the status code should be {200}
And the field {key} has the value {someValue}
Scenario: TSA - using multiple header values for policy execution - Positive
When I load the REST request {Policy.json} with profile {empty}
And I load value {someValue} into current request HEADER {X-Cache-Key}
And I load value {another-value} into current request HEADER {X-Another-Header}
And I execute the Policy group {example} name {getMultiHeaders} version {1.0} via TSA Policy API
Then the status code should be {200}
And the field {key} has the value {someValue}
And the field {another} has the value {another-value}
@negative
Scenario: TSA - Evaluate policy with incorrect value - Negative
When I load the REST request {Policy.json} with profile {incorrect_message}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment