Skip to content
Snippets Groups Projects
Unverified Commit c7b20d46 authored by Georgi Michev's avatar Georgi Michev
Browse files

refactor for dev env

parent 50c7bdb4
Branches
Tags
1 merge request!19refactor for dev env
Showing
with 164 additions and 42 deletions
...@@ -23,7 +23,12 @@ This repository holds the test automation framework based on Java and used for t ...@@ -23,7 +23,12 @@ This repository holds the test automation framework based on Java and used for t
### Running ### Running
- Run the tests on a remote env: ```gradle regressionSuite -PbaseUrl=https://TestEnv -Dcucumber.tags="@rest, ~@wip" -Dcourgette.threads=10 -Dcourgette.runLevel=Scenario -Dcourgette.rerunFailedScenarios=false -Dcourgette.rerunAttempts=1``` - Run the tests on a remote env: ```gradle regressionSuite -PbaseUrl={BASE_URL} -Dcucumber.tags="@tsa, not @wip" -Dcourgette.threads=1 -Dcourgette.runLevel=Scenario -Dcourgette.rerunFailedScenarios=false -Dcourgette.rerunAttempts=1 -DmongoUrl={MONGO_PATH}```
_{BASE_URL} - should be replaced with the path where the services are deployed:
example: http://localhost_
_{MONGO_PATH}_ - should be replaced with the address of the MongoDB instance:
example: mongodb://user:pass@localhost:27017
# Manual execution # Manual execution
To simplify manual tests execution we have a postman collection with the list of supported endpoints, you can find [here](postman/TSA.postman_collection.json) To simplify manual tests execution we have a postman collection with the list of supported endpoints, you can find [here](postman/TSA.postman_collection.json)
\ No newline at end of file
...@@ -41,6 +41,11 @@ if (project.hasProperty("baseUrl")) { ...@@ -41,6 +41,11 @@ if (project.hasProperty("baseUrl")) {
baseUrl = project.property("baseUrl") baseUrl = project.property("baseUrl")
} }
def mongoUrl
if (project.hasProperty("mongoUrl")) {
mongoUrl = project.property("mongoUrl")
}
tasks.withType(Test) { tasks.withType(Test) {
systemProperties = System.getProperties() systemProperties = System.getProperties()
...@@ -55,6 +60,7 @@ task regressionSuite(type: Test) { ...@@ -55,6 +60,7 @@ task regressionSuite(type: Test) {
} }
systemProperty "file.encoding", "utf-8" systemProperty "file.encoding", "utf-8"
systemProperty "baseUrl", "${baseUrl}" systemProperty "baseUrl", "${baseUrl}"
systemProperty "mongoUrl", "${mongoUrl}"
systemProperties System.getProperties() systemProperties System.getProperties()
......
...@@ -233,7 +233,7 @@ public class JsonUtils { ...@@ -233,7 +233,7 @@ public class JsonUtils {
* @return the uri * @return the uri
*/ */
public static String getTSAPolicy() { public static String getTSAPolicy() {
return System.getProperty("baseUrl") + ":8081/policy"; return System.getProperty("baseUrl") + "/policy";
} }
/** /**
...@@ -241,7 +241,7 @@ public class JsonUtils { ...@@ -241,7 +241,7 @@ public class JsonUtils {
* @return the uri * @return the uri
*/ */
public static String getTSACache() { public static String getTSACache() {
return System.getProperty("baseUrl") + ":8083/v1/cache"; return System.getProperty("baseUrl") + "/cache";
} }
/** /**
...@@ -249,7 +249,7 @@ public class JsonUtils { ...@@ -249,7 +249,7 @@ public class JsonUtils {
* @return the uri * @return the uri
*/ */
public static String getTSATask() { public static String getTSATask() {
return System.getProperty("baseUrl") + ":8082/v1"; return System.getProperty("baseUrl") + "/task";
} }
/** /**
......
{ {
"successful_set": { "successful_set": {
"msg": "successful setting the cache" "msg": "successful setting the cache"
},
"missing_body": {
} }
} }
\ No newline at end of file
...@@ -48,7 +48,7 @@ public class PolicyStepDefinitions extends BaseStepDefinitions { ...@@ -48,7 +48,7 @@ public class PolicyStepDefinitions extends BaseStepDefinitions {
private static final Logger logger = LogManager.getLogger(RestGeneralStepDefinitions.class.getSimpleName()); private static final Logger logger = LogManager.getLogger(RestGeneralStepDefinitions.class.getSimpleName());
// MONGO_PATH environment variable should be set to point to the MonoDB instance // MONGO_PATH environment variable should be set to point to the MonoDB instance
public static final String mongoConnection = System.getenv("MONGO_PATH"); public static final String mongoConnection = System.getProperty("mongoUrl");
RestSessionContainer restSessionContainer; RestSessionContainer restSessionContainer;
Request currentRequest; Request currentRequest;
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
#You should have received a copy of the GNU Affero General Public License #You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>. #along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost:8083/v1/cache #http://gaiax.vereign.com/tsa/cache/v1/cache
#Author: Georgi Michev georgi.michev@vereign.com #Author: Georgi Michev georgi.michev@vereign.com
@rest @all @tsa @cache @rest @all @tsa @cache
Feature: API -TSA - Cache - v1/cache POST Feature: API -TSA - Cache - v1/cache GET
As policy administrator As policy administrator
I want to have distributed cache feature provided I want to have distributed cache feature provided
So I am able to use cache functionality in my custom policies So I am able to use cache functionality in my custom policies
...@@ -34,10 +34,10 @@ Feature: API -TSA - Cache - v1/cache POST ...@@ -34,10 +34,10 @@ Feature: API -TSA - Cache - v1/cache POST
Given I load the REST request {Cache.json} with profile {successful_set} Given I load the REST request {Cache.json} with profile {successful_set}
And I store key {key_positive} with value {test} in the data container And I store key {key_positive} with value {test} in the data container
And I load object with key {key_positive} from DataContainer into currentRequest HEADER {x-cache-key} And I load object with key {key_positive} from DataContainer into currentRequest HEADER {x-cache-key}
And I send the current request as POST to endpoint {} And I send the current request as POST to endpoint {/v1/cache}
And the status code should be {201} And the status code should be {201}
Then I clear the request body Then I clear the request body
And I send the current request as GET to endpoint {} And I send the current request as GET to endpoint {/v1/cache}
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}
...@@ -45,7 +45,14 @@ Feature: API -TSA - Cache - v1/cache POST ...@@ -45,7 +45,14 @@ Feature: API -TSA - Cache - v1/cache POST
Scenario: TSA - Access non existing Cache - Negative Scenario: TSA - Access non existing Cache - Negative
And I store key {key_negative} with value {NEGATIVE} in the data container And I store key {key_negative} with value {NEGATIVE} in the data container
And I load object with key {key_negative} from DataContainer into currentRequest HEADER {x-cache-key} And I load object with key {key_negative} from DataContainer into currentRequest HEADER {x-cache-key}
Given I send the current request as GET to endpoint {} Given I send the current request as GET to endpoint {/v1/cache}
Then the status code should be {404} Then the status code should be {404}
And the response is valid according to the {Cache_negative_schema.json} REST schema And the response is valid according to the {Cache_negative_schema.json} REST schema
And the field {message} has the value {key not found in cache} And the field {message} has the value {key not found in cache}
@negative
Scenario: TSA - Access Cache without header x-cache-key - Negative
Given I send the current request as GET to endpoint {/v1/cache}
Then the status code should be {400}
And the response is valid according to the {Cache_negative_schema.json} REST schema
And the field {message} has the value {"x-cache-key" is missing from header}
#Copyright (c) 2018 Vereign AG [https://www.vereign.com]
#
#This is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as
#published by the Free Software Foundation, either version 3 of the
#License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU Affero General Public License for more details.
#
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#https://gaiax.vereign.com/tsa/cache/v1/cache
#Author: Georgi Michev georgi.michev@vereign.com
@rest @all @tsa @cache
Feature: API -TSA - Cache - v1/cache POST
As policy administrator
I want to have distributed cache feature provided
So I am able to use cache functionality in my custom policies
Acceptance criteria:
- The plugin for rego language to get/set values is ready to use
- The working example how to use the plugin
- Green test based on example committed to the system
Background:
Given we are testing the TSA Cache Api
Scenario: TSA - Setting Cache - Positive
Given I load the REST request {Cache.json} with profile {successful_set}
And I store key {key_positive} with value {test} in the data container
And I load object with key {key_positive} from DataContainer into currentRequest HEADER {x-cache-key}
And I send the current request as POST to endpoint {/v1/cache}
And the status code should be {201}
@negative
Scenario: TSA - Setting Cache with missing header - x-cache-key - Negative
Given I load the REST request {Cache.json} with profile {missing_body}
And I send the current request as POST to endpoint {/v1/cache}
Then the status code should be {400}
And the response is valid according to the {Cache_negative_schema.json} REST schema
And the field {message} has the value {"x-cache-key" is missing from header}
@negative
Scenario: TSA - Setting Cache with missing body - Negative
And I send the current request as POST to endpoint {/v1/cache}
Then the status code should be {400}
And the response is valid according to the {Cache_negative_schema.json} REST schema
And the field {message} has the value {missing required payload}
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#You should have received a copy of the GNU Affero General Public License #You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>. #along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost:8081/policy/:group/:name/:version/evaluation #https://gaiax.vereign.com/tsa/policy/policy/:group/:name/:version/evaluation
#Author: Georgi Michev georgi.michev@vereign.com #Author: Georgi Michev georgi.michev@vereign.com
@rest @all @tsa @policy @rest @all @tsa @policy
...@@ -33,16 +33,17 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST ...@@ -33,16 +33,17 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST
Scenario: TSA - Evaluate policy synchronously - Positive Scenario: TSA - Evaluate policy synchronously - Positive
Given I upload a policy {test1} to repository Given I upload a policy {test1} to repository
Then I load the REST request {Policy.json} with profile {successful_evaluate} Then I load the REST request {Policy.json} with profile {successful_evaluate}
And I execute the policy {/testable/test1/2.0/evaluation} And I execute the policy {/policy/testable/test1/2.0/evaluation}
Then the status code should be {200} Then the status code should be {200}
And the response is valid according to the {Policy_Evaluate_schema.json} REST schema And the response is valid according to the {Policy_Evaluate_schema.json} REST schema
And the field {result.allow} has the value {true} And the field {result.allow} has the value {true}
And delete policy {test1} from repository And delete policy {test1} from repository
@bug @issue-35
Scenario: TSA - DID resolution - Positive Scenario: TSA - DID resolution - Positive
Given I upload a DID resolver policy to repository Given I upload a DID resolver policy to repository
Then I load the REST request {Policy.json} with profile {didResolve_evaluate} Then I load the REST request {Policy.json} with profile {didResolve_evaluate}
And I execute the policy {/example/resolve/1.0/evaluation} And I execute the policy {/policy/example/resolve/1.0/evaluation}
Then the status code should be {200} Then the status code should be {200}
And the response is valid according to the {Policy_EvaluateDID_schema.json} REST schema And the response is valid according to the {Policy_EvaluateDID_schema.json} REST schema
And the field {result.data.didDocument.id} has the value {did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE} And the field {result.data.didDocument.id} has the value {did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE}
...@@ -52,7 +53,7 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST ...@@ -52,7 +53,7 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST
Scenario: TSA - Evaluate policy with incorrect value - Negative Scenario: TSA - Evaluate policy with incorrect value - Negative
Given I upload a policy {test6} to repository Given I upload a policy {test6} to repository
Then I load the REST request {Policy.json} with profile {unsuccessful_evaluate} Then I load the REST request {Policy.json} with profile {unsuccessful_evaluate}
And I execute the policy {/testable/test6/2.0/evaluation} And I execute the policy {/policy/testable/test6/2.0/evaluation}
Then the status code should be {200} Then the status code should be {200}
And the response is valid according to the {Policy_Evaluate_schema.json} REST schema And the response is valid according to the {Policy_Evaluate_schema.json} REST schema
And the field {result.allow} has the value {false} And the field {result.allow} has the value {false}
...@@ -61,7 +62,7 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST ...@@ -61,7 +62,7 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST
@negative @negative
Scenario: TSA - Evaluate policy with missing body- Negative Scenario: TSA - Evaluate policy with missing body- Negative
Given I upload a policy {test7} to repository Given I upload a policy {test7} to repository
And I execute the policy {/testable/test7/2.0/evaluation} And I execute the policy {/policy/testable/test7/2.0/evaluation}
Then the status code should be {400} Then the status code should be {400}
And the response is valid according to the {Policy_Evaluate_negative_schema.json} REST schema And the response is valid according to the {Policy_Evaluate_negative_schema.json} REST schema
And the field {message} has the value {missing required payload} And the field {message} has the value {missing required payload}
...@@ -70,16 +71,16 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST ...@@ -70,16 +71,16 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST
@negative @negative
Scenario: TSA - Evaluate missing policy - Negative Scenario: TSA - Evaluate missing policy - Negative
Then I load the REST request {Policy.json} with profile {successful_evaluate} Then I load the REST request {Policy.json} with profile {successful_evaluate}
Given I execute the policy {/testable/test0/1.0/evaluation} Given I execute the policy {/policy/testable/test0/1.0/evaluation}
Then the status code should be {404} Then the status code should be {404}
And the response is valid according to the {Policy_Evaluate_negative_schema.json} REST schema And the response is valid according to the {Policy_Evaluate_negative_schema.json} REST schema
And the field {message} has the value {error evaluating policy} And the field {message} has the value {error evaluating policy}
@negative @negative @bug @issue-35
Scenario: TSA - DID resolution with incorrect did - Negative Scenario: TSA - DID resolution with incorrect did - Negative
Given I upload a DID resolver policy to repository Given I upload a DID resolver policy to repository
Then I load the REST request {Policy.json} with profile {didResolve_missing_method} Then I load the REST request {Policy.json} with profile {didResolve_missing_method}
And I execute the policy {/example/resolve/1.0/evaluation} And I execute the policy {/policy/example/resolve/1.0/evaluation}
Then the status code should be {200} Then the status code should be {200}
And the response is valid according to the {Policy_EvaluateDID_negative_schema.json} REST schema And the response is valid according to the {Policy_EvaluateDID_negative_schema.json} REST schema
And the field {result.data.didResolutionMetadata.error} has the value {notFound} And the field {result.data.didResolutionMetadata.error} has the value {notFound}
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#You should have received a copy of the GNU Affero General Public License #You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>. #along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost:8081/policy/:group/:name/:version/lock #https://gaiax.vereign.com/policy/policy/:group/:name/:version/lock
#Author: Georgi Michev georgi.michev@vereign.com #Author: Georgi Michev georgi.michev@vereign.com
@rest @all @tsa @policy @lock @rest @all @tsa @policy @lock
...@@ -27,13 +27,13 @@ Feature: API - TSA - Policy - :group/:name/:version/lock DELETE ...@@ -27,13 +27,13 @@ Feature: API - TSA - Policy - :group/:name/:version/lock DELETE
Scenario: TSA - Unlock policy - Positive Scenario: TSA - Unlock policy - Positive
Given I upload a policy {test4} to repository Given I upload a policy {test4} to repository
When I lock the policy {/testable/test4/2.0/lock} When I lock the policy {/policy/testable/test4/2.0/lock}
And I unlock the policy {/testable/test4/2.0/lock} And I unlock the policy {/policy/testable/test4/2.0/lock}
And the status code should be {200} And the status code should be {200}
And delete policy {test4} from repository And delete policy {test4} from repository
@negative @negative
Scenario: TSA - Unlock none existing policy - Negative Scenario: TSA - Unlock none existing policy - Negative
When I unlock the policy {/testable/test8/2.0/lock} When I unlock the policy {/policy/testable/test8/2.0/lock}
And the status code should be {404} And the status code should be {404}
And the field {message} has the value {policy not found} And the field {message} has the value {policy not found}
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#You should have received a copy of the GNU Affero General Public License #You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>. #along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost:8081/policy/:group/:name/:version/lock #https://gaiax.vereign.com/policy/policy/:group/:name/:version/lock
#Author: Georgi Michev georgi.michev@vereign.com #Author: Georgi Michev georgi.michev@vereign.com
@rest @all @tsa @policy @lock @rest @all @tsa @policy @lock
...@@ -32,23 +32,23 @@ Feature: API - TSA -Policy - :group/:name/:version/lock POST ...@@ -32,23 +32,23 @@ Feature: API - TSA -Policy - :group/:name/:version/lock POST
Scenario: TSA - Lock policy - Positive Scenario: TSA - Lock policy - Positive
Given I upload a policy {test2} to repository Given I upload a policy {test2} to repository
When I lock the policy {/testable/test2/2.0/lock} When I lock the policy {/policy/testable/test2/2.0/lock}
Then the status code should be {200} Then the status code should be {200}
When I load the REST request {Policy.json} with profile {successful_evaluate} When I load the REST request {Policy.json} with profile {successful_evaluate}
And I execute the policy {/testable/test2/2.0/evaluation} And I execute the policy {/policy/testable/test2/2.0/evaluation}
Then the status code should be {403} Then the status code should be {403}
And I lock the policy {/testable/test2/2.0/lock} And I lock the policy {/policy/testable/test2/2.0/lock}
And the status code should be {403} And the status code should be {403}
And the field {message} has the value {policy is already locked} And the field {message} has the value {policy is already locked}
And I unlock the policy {/testable/test2/2.0/lock} And I unlock the policy {/policy/testable/test2/2.0/lock}
And delete policy {test2} from repository And delete policy {test2} from repository
@negative @negative
Scenario: TSA - Lock already locked policy - Negative Scenario: TSA - Lock already locked policy - Negative
Given I upload a policy {test3} to repository Given I upload a policy {test3} to repository
When I lock the policy {/testable/test3/2.0/lock} When I lock the policy {/policy/testable/test3/2.0/lock}
And I lock the policy {/testable/test3/2.0/lock} And I lock the policy {/policy/testable/test3/2.0/lock}
And the status code should be {403} And the status code should be {403}
And the field {message} has the value {policy is already locked} And the field {message} has the value {policy is already locked}
And I unlock the policy {/testable/test3/2.0/lock} And I unlock the policy {/policy/testable/test3/2.0/lock}
And delete policy {test3} from repository And delete policy {test3} from repository
#Copyright (c) 2018 Vereign AG [https://www.vereign.com]
#
#This is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as
#published by the Free Software Foundation, either version 3 of the
#License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU Affero General Public License for more details.
#
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://gaiax.vereign.com/tsa/task/v1/task
#Author: Georgi Michev georgi.michev@vereign.com
@rest @all @tsa @task
Feature: API -TSA - Task - v1/task GET
As user
I want to evaluate the policy asynchronously
So I am able to execute the developed Rego code in the future non-blocking
Acceptance criteria:
- HTTP endpoints to evaluate the policy asynchronously and get the result
- example of long-running policy committed to Git repo
- Green test based on example committed to the system
Background:
Given we are testing the TSA Task Api
@bug @issue-35
Scenario: TSA - Executing Task with DID resolver and Evaluate the Cache - Positive
Given I upload a DID resolver policy to repository
And I upload a task template {didResolve} to repository
Then I load the REST request {Policy.json} with profile {didResolve_evaluate}
And I send the current request as POST to endpoint {/v1/task/didResolve}
Then the status code should be {200}
And the response is valid according to the {Task_Execute_schema.json} REST schema
# Test the Task Result
Then I get the value of {taskID} from the last response and store it in the DataContainer with key {taskID}
Then I clear the request body
And I wait for {2000} mseconds
And I send the current request to endpoint {taskResult} with container value{taskID}
Then the status code should be {200}
And the response is valid according to the {Task_ExecuteDID_schema.json} REST schema
And the field {result.data.didDocument.id} has the value {did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE}
# Test the Cache Service
Then I load object with key {taskID} from DataContainer into currentRequest HEADER {x-cache-key}
And I send the current request as GET to endpoint {http://localhost:8083/v1/cache}
And the status code should be {200}
And the response is valid according to the {Task_ExecuteDID_schema.json} REST schema
And the field {result.data.didDocument.id} has the value {did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE}
Then delete task {didResolve} from repository
And delete policy {resolve} from repository
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#You should have received a copy of the GNU Affero General Public License #You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>. #along with this program. If not, see <http://www.gnu.org/licenses/>.
#http://localhost:8082/v1/task #http://gaiax.vereign.com/tsa/task/v1/task
#Author: Georgi Michev georgi.michev@vereign.com #Author: Georgi Michev georgi.michev@vereign.com
@rest @all @tsa @task @rest @all @tsa @task
...@@ -30,14 +30,14 @@ Feature: API -TSA - Task - v1/task POST ...@@ -30,14 +30,14 @@ Feature: API -TSA - Task - v1/task POST
Background: Background:
Given we are testing the TSA Task Api Given we are testing the TSA Task Api
@bug @issue-35
Scenario: TSA - Executing Task with DID resolver - Positive Scenario: TSA - Executing Task with DID resolver - Positive
Given I upload a DID resolver policy to repository Given I upload a DID resolver policy to repository
And I upload a task template {didResolve} to repository And I upload a task template {didResolve} to repository
Then I load the REST request {Policy.json} with profile {didResolve_evaluate} Then I load the REST request {Policy.json} with profile {didResolve_evaluate}
And I send the current request as POST to endpoint {task/didResolve} And I send the current request as POST to endpoint {/v1/task/didResolve}
Then the status code should be {200} Then the status code should be {200}
And the response is valid according to the {Task_Execute_schema.json} REST schema And the response is valid according to the {Task_Execute_schema.json} REST schema
# Test the Task Result
Then I get the value of {taskID} from the last response and store it in the DataContainer with key {taskID} Then I get the value of {taskID} from the last response and store it in the DataContainer with key {taskID}
Then I clear the request body Then I clear the request body
And I wait for {2000} mseconds And I wait for {2000} mseconds
...@@ -45,20 +45,12 @@ Feature: API -TSA - Task - v1/task POST ...@@ -45,20 +45,12 @@ Feature: API -TSA - Task - v1/task POST
Then the status code should be {200} Then the status code should be {200}
And the response is valid according to the {Task_ExecuteDID_schema.json} REST schema And the response is valid according to the {Task_ExecuteDID_schema.json} REST schema
And the field {result.data.didDocument.id} has the value {did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE} And the field {result.data.didDocument.id} has the value {did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE}
# Test the Cache Service
Then I load object with key {taskID} from DataContainer into currentRequest HEADER {x-cache-key}
And I send the current request as GET to endpoint {http://localhost:8083/v1/cache}
And the status code should be {200}
And the response is valid according to the {Task_ExecuteDID_schema.json} REST schema
And the field {result.data.didDocument.id} has the value {did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE}
Then delete task {didResolve} from repository
And delete policy {resolve} from repository
@negative @negative
Scenario: TSA - Executing Task with non existing task template - Negative Scenario: TSA - Executing Task with non existing task template - Negative
Given I upload a DID resolver policy to repository Given I upload a DID resolver policy to repository
Then I load the REST request {Policy.json} with profile {didResolve_evaluate} Then I load the REST request {Policy.json} with profile {didResolve_evaluate}
And I send the current request as POST to endpoint {task/resolve} And I send the current request as POST to endpoint {/v1/task/resolve}
Then the response is valid according to the {Policy_Evaluate_negative_schema.json} REST schema Then the response is valid according to the {Policy_Evaluate_negative_schema.json} REST schema
And the field {message} has the value {task template not found} And the field {message} has the value {task template not found}
And delete policy {resolve} from repository And delete policy {resolve} from repository
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment