diff --git a/src/main/resources/REST/json/Policy.json b/src/main/resources/REST/json/Policy.json index e1f37e85c589de4b458f6b1a55986a178cfa487a..f91bc352f2bbd9a65cac8853cf5f6d400b711d87 100644 --- a/src/main/resources/REST/json/Policy.json +++ b/src/main/resources/REST/json/Policy.json @@ -13,5 +13,6 @@ }, "did_missing_method": { "did":"did:idunion:BDrEcHc8Tb4Lb2VyQZWEDE" - } + }, + "empty": {} } \ No newline at end of file diff --git a/src/test/resources/features/tsa/cache/v1/cache/GET.feature b/src/test/resources/features/tsa/cache/v1/cache/GET.feature index 5ddbbc6014361746cccfbc38681c3374376b8a0f..21433fd92141a43c7ee3b29bbcffda4c11a910f7 100644 --- a/src/test/resources/features/tsa/cache/v1/cache/GET.feature +++ b/src/test/resources/features/tsa/cache/v1/cache/GET.feature @@ -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} diff --git a/src/test/resources/features/tsa/policy/policy/{group}/{name}/{version}/evaluation/POST.feature b/src/test/resources/features/tsa/policy/policy/{group}/{name}/{version}/evaluation/POST.feature index ae395f1a4ddf16f9b40c3111e5088b0447ef411f..cdf1f3f8cc285fffb70394765068309ee9eb9d11 100644 --- a/src/test/resources/features/tsa/policy/policy/{group}/{name}/{version}/evaluation/POST.feature +++ b/src/test/resources/features/tsa/policy/policy/{group}/{name}/{version}/evaluation/POST.feature @@ -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}