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

refactor step definitions

parent 1174b3d6
Branches
No related tags found
1 merge request!22refactor step definitions
Showing
with 144 additions and 68 deletions
{ {
"successful_evaluate": { "successful_message": {
"message": "hello world" "message": "hello world"
}, },
"unsuccessful_evaluate": { "incorrect_message": {
"message": "wrong value!" "message": "wrong value!"
}, },
"didResolve_indy_evaluate": { "did_indy": {
"did":"did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE" "did":"did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE"
}, },
"didResolve_evaluate": { "did_key": {
"did":"did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6" "did":"did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6"
}, },
"didResolve_missing_method": { "did_missing_method": {
"did":"did:idunion:BDrEcHc8Tb4Lb2VyQZWEDE" "did":"did:idunion:BDrEcHc8Tb4Lb2VyQZWEDE"
} }
} }
\ No newline at end of file
...@@ -3,11 +3,10 @@ package api.test.rest.tsa.cache; ...@@ -3,11 +3,10 @@ package api.test.rest.tsa.cache;
import api.test.core.BaseStepDefinitions; import api.test.core.BaseStepDefinitions;
import api.test.rest.RestGeneralStepDefinitions; import api.test.rest.RestGeneralStepDefinitions;
import api.test.rest.RestSessionContainer; import api.test.rest.RestSessionContainer;
import core.DataContainer; import core.*;
import core.JsonUtils; import cucumber.api.java.en.And;
import core.Request;
import core.RestClient;
import cucumber.api.java.en.Given; import cucumber.api.java.en.Given;
import exceptions.RAFException;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -22,6 +21,26 @@ public class CacheStepDefinitions extends BaseStepDefinitions { ...@@ -22,6 +21,26 @@ public class CacheStepDefinitions extends BaseStepDefinitions {
this.currentRequest = currentRequest; this.currentRequest = currentRequest;
} }
@Given("^I load the body of my Cache request with \\{(.*)\\} from \\{(.*)\\}$")
public void iLoadTheBodyOfMyPolicyRequestWithDataFromFile(String profileName, String jsonName) throws Throwable {
logger.info("Loading REST json into current request body. Json file= [{}] , profile= [{}]", jsonName, profileName);
String loadedProfileData = JsonUtils.getProfileFromJson("/REST/json/" + jsonName, profileName);
if (!loadedProfileData.equals("null")) {
currentRequest.setBody(loadedProfileData);
logger.info("SUCCESS - profile loaded.");
} else {
throw new RAFException(String.format("Profile loading FAILED. Value is \"null\". File= [%s] , profile= [%s]",
jsonName,
profileName)
, RestGeneralStepDefinitions.class);
}
}
@And("^I load value \\{(.*)\\} into current request HEADER \\{(.*)\\}$")
public void iLoadValueFromTheResponseIntoCurrentRequestHEADER(String value, String headerName) throws Throwable {
currentRequest.getHeaders().put(headerName, value);
}
@Given("we are testing the TSA Cache Api") @Given("we are testing the TSA Cache Api")
public void weAreTestingTheTSACacheApi() { public void weAreTestingTheTSACacheApi() {
RestClient.setDefaultEncoding("UTF8"); RestClient.setDefaultEncoding("UTF8");
...@@ -31,4 +50,18 @@ public class CacheStepDefinitions extends BaseStepDefinitions { ...@@ -31,4 +50,18 @@ public class CacheStepDefinitions extends BaseStepDefinitions {
currentRequest.getHeaders().put("X-Client-UserAgent", "test framework"); currentRequest.getHeaders().put("X-Client-UserAgent", "test framework");
currentRequest.setContentType("application/json"); currentRequest.setContentType("application/json");
} }
@And("^I send the Cache (POST|GET) request$")
public void iSendTheCachePOSTRequest(String method) {
currentRequest.setPath("/v1/cache");
if (method.equals("POST")) {
Response response = RestClient.post(currentRequest);
addRequest(currentRequest);
addResponse(response);
} else if (method.equals("GET")) {
Response response = RestClient.get(currentRequest);
addRequest(currentRequest);
addResponse(response);
}
}
} }
...@@ -20,12 +20,11 @@ package api.test.rest.tsa.policy; ...@@ -20,12 +20,11 @@ package api.test.rest.tsa.policy;
import api.test.core.BaseStepDefinitions; import api.test.core.BaseStepDefinitions;
import api.test.rest.RestGeneralStepDefinitions; import api.test.rest.RestGeneralStepDefinitions;
import api.test.rest.RestSessionContainer; import api.test.rest.RestSessionContainer;
import core.DataContainer; import core.*;
import core.Request;
import core.Response;
import core.RestClient;
import cucumber.api.java.en.And; import cucumber.api.java.en.And;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.When; import cucumber.api.java.en.When;
import exceptions.RAFException;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -41,9 +40,24 @@ public class PolicyStepDefinitions extends BaseStepDefinitions { ...@@ -41,9 +40,24 @@ public class PolicyStepDefinitions extends BaseStepDefinitions {
this.currentRequest = currentRequest; this.currentRequest = currentRequest;
} }
@Given("^I load the body of my Policy request with \\{(.*)\\} from \\{(.*)\\}$")
public void iLoadTheBodyOfMyPolicyRequestWithDataFromFile(String profileName, String jsonName) throws Throwable {
logger.info("Loading REST json into current request body. Json file= [{}] , profile= [{}]", jsonName, profileName);
String loadedProfileData = JsonUtils.getProfileFromJson("/REST/json/" + jsonName, profileName);
if (!loadedProfileData.equals("null")) {
currentRequest.setBody(loadedProfileData);
logger.info("SUCCESS - profile loaded.");
} else {
throw new RAFException(String.format("Profile loading FAILED. Value is \"null\". File= [%s] , profile= [%s]",
jsonName,
profileName)
, RestGeneralStepDefinitions.class);
}
}
@And("^I execute the policy \\{(.*)\\}$") @And("^I execute the policy \\{(.*)\\}$")
public void iExecuteThePolicy(String path) throws Throwable { public void iExecuteThePolicy(String path) throws Throwable {
currentRequest.setPath(path); currentRequest.setPath("/policy/example/" + path + "/1.0/evaluation");
Response response = RestClient.post(currentRequest); Response response = RestClient.post(currentRequest);
addRequest(currentRequest); addRequest(currentRequest);
addResponse(response); addResponse(response);
...@@ -51,7 +65,7 @@ public class PolicyStepDefinitions extends BaseStepDefinitions { ...@@ -51,7 +65,7 @@ public class PolicyStepDefinitions extends BaseStepDefinitions {
@When("^I lock the policy \\{(.*)\\}$") @When("^I lock the policy \\{(.*)\\}$")
public void iLockThePolicy(String path) throws Throwable { public void iLockThePolicy(String path) throws Throwable {
currentRequest.setPath(path); currentRequest.setPath("/policy/example/" + path + "/1.0/lock");
Response response = RestClient.post(currentRequest); Response response = RestClient.post(currentRequest);
addRequest(currentRequest); addRequest(currentRequest);
addResponse(response); addResponse(response);
...@@ -59,7 +73,7 @@ public class PolicyStepDefinitions extends BaseStepDefinitions { ...@@ -59,7 +73,7 @@ public class PolicyStepDefinitions extends BaseStepDefinitions {
@When("^I unlock the policy \\{(.*)\\}$") @When("^I unlock the policy \\{(.*)\\}$")
public void iUnlockThePolicy(String path) throws Throwable { public void iUnlockThePolicy(String path) throws Throwable {
currentRequest.setPath(path); currentRequest.setPath("/policy/example/" + path + "/1.0/lock");
Response response = RestClient.delete(currentRequest); Response response = RestClient.delete(currentRequest);
addRequest(currentRequest); addRequest(currentRequest);
addResponse(response); addResponse(response);
......
...@@ -6,6 +6,7 @@ import api.test.rest.RestSessionContainer; ...@@ -6,6 +6,7 @@ import api.test.rest.RestSessionContainer;
import core.*; import core.*;
import cucumber.api.java.en.And; import cucumber.api.java.en.And;
import cucumber.api.java.en.Given; import cucumber.api.java.en.Given;
import exceptions.RAFException;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
...@@ -38,4 +39,36 @@ public class TaskStepDefinitions extends BaseStepDefinitions{ ...@@ -38,4 +39,36 @@ public class TaskStepDefinitions extends BaseStepDefinitions{
addRequest(currentRequest); addRequest(currentRequest);
addResponse(response); addResponse(response);
} }
@Given("^I load the body of my Task request with \\{(.*)\\} from \\{(.*)\\}$")
public void iLoadTheBodyOfMyPolicyRequestWithDataFromFile(String profileName, String jsonName) throws Throwable {
logger.info("Loading REST json into current request body. Json file= [{}] , profile= [{}]", jsonName, profileName);
String loadedProfileData = JsonUtils.getProfileFromJson("/REST/json/" + jsonName, profileName);
if (!loadedProfileData.equals("null")) {
currentRequest.setBody(loadedProfileData);
logger.info("SUCCESS - profile loaded.");
} else {
throw new RAFException(String.format("Profile loading FAILED. Value is \"null\". File= [%s] , profile= [%s]",
jsonName,
profileName)
, RestGeneralStepDefinitions.class);
}
}
@And("^I execute the Task \\{(.*)\\}$")
public void iExecuteThePolicy(String path) throws Throwable {
currentRequest.setPath("/v1/task/" + path);
Response response = RestClient.post(currentRequest);
addRequest(currentRequest);
addResponse(response);
}
@And("^I get the Task result with key \\{(.*)\\}$")
public void iGetTheTaskResultWithKey(String suffix) {
currentRequest.setPath("v1/taskResult/"+ getDataContainer().getObject(suffix));
Response response = RestClient.get(currentRequest);
addRequest(currentRequest);
addResponse(response);
}
} }
...@@ -31,28 +31,26 @@ Feature: API -TSA - Cache - v1/cache GET ...@@ -31,28 +31,26 @@ Feature: API -TSA - Cache - v1/cache GET
Given we are testing the TSA Cache Api Given we are testing the TSA Cache Api
Scenario: TSA - Working with Cache - Positive Scenario: TSA - Working with Cache - Positive
Given I load the REST request {Cache.json} with profile {successful_set} When I load the body of my Cache request with {successful_set} from {Cache.json}
And I store key {key_positive} with value {test} in the data container And I load value {test} into current request HEADER {x-cache-key}
And I load object with key {key_positive} from DataContainer into currentRequest HEADER {x-cache-key} And I send the Cache POST request
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 {/v1/cache} And I send the Cache GET request
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}
@negative @negative
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 Given I load value {NEGATIVE} into current request HEADER {x-cache-key}
And I load object with key {key_negative} from DataContainer into currentRequest HEADER {x-cache-key} And I send the Cache GET request
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 @negative
Scenario: TSA - Access Cache without header x-cache-key - Negative Scenario: TSA - Access Cache without header x-cache-key - Negative
Given I send the current request as GET to endpoint {/v1/cache} Given I send the Cache GET request
Then the status code should be {400} Then the status code should be {400}
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 {"x-cache-key" is missing from header} And the field {message} has the value {"x-cache-key" is missing from header}
...@@ -31,23 +31,22 @@ Feature: API -TSA - Cache - v1/cache POST ...@@ -31,23 +31,22 @@ Feature: API -TSA - Cache - v1/cache POST
Given we are testing the TSA Cache Api Given we are testing the TSA Cache Api
Scenario: TSA - Setting Cache - Positive Scenario: TSA - Setting Cache - Positive
Given I load the REST request {Cache.json} with profile {successful_set} When I load the body of my Cache request with {successful_set} from {Cache.json}
And I store key {key_positive} with value {test} in the data container And I load value {test} into current request HEADER {x-cache-key}
And I load object with key {key_positive} from DataContainer into currentRequest HEADER {x-cache-key} And I send the Cache POST request
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}
@negative @negative
Scenario: TSA - Setting Cache with missing header - x-cache-key - Negative Scenario: TSA - Setting Cache with missing header - x-cache-key - Negative
Given I load the REST request {Cache.json} with profile {missing_body} When I load the body of my Cache request with {missing_body} from {Cache.json}
And I send the current request as POST to endpoint {/v1/cache} And I send the Cache POST request
Then the status code should be {400} Then the status code should be {400}
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 {"x-cache-key" is missing from header} And the field {message} has the value {"x-cache-key" is missing from header}
@negative @negative
Scenario: TSA - Setting Cache with missing body - Negative Scenario: TSA - Setting Cache with missing body - Negative
And I send the current request as POST to endpoint {/v1/cache} When I send the Cache POST request
Then the status code should be {400} Then the status code should be {400}
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 {missing required payload} And the field {message} has the value {missing required payload}
...@@ -31,47 +31,46 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST ...@@ -31,47 +31,46 @@ Feature: API -TSA - Policy - :group/:name/:version/evaluation POST
Given we are testing the TSA Policy Api Given we are testing the TSA Policy Api
Scenario: TSA - Evaluate policy synchronously - Positive Scenario: TSA - Evaluate policy synchronously - Positive
Given I load the REST request {Policy.json} with profile {successful_evaluate} When I load the body of my Policy request with {successful_message} from {Policy.json}
And I execute the policy {/policy/example/test/1.0/evaluation} And I execute the policy {test}
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 {allow} has the value {true} And the field {allow} has the value {true}
@bug-policy-35
Scenario: TSA - DID resolution - Positive Scenario: TSA - DID resolution - Positive
Given I load the REST request {Policy.json} with profile {didResolve_evaluate} When I load the body of my Policy request with {did_key} from {Policy.json}
And I execute the policy {/policy/example/resolve/1.0/evaluation} And I execute the policy {resolve}
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 {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6} And the field {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
@negative @negative
Scenario: TSA - Evaluate policy with incorrect value - Negative Scenario: TSA - Evaluate policy with incorrect value - Negative
Given I load the REST request {Policy.json} with profile {unsuccessful_evaluate} When I load the body of my Policy request with {incorrect_message} from {Policy.json}
And I execute the policy {/policy/example/test/1.0/evaluation} And I execute the policy {test}
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 {allow} has the value {false} And the field {allow} has the value {false}
@negative @negative
Scenario: TSA - Evaluate policy with missing body- Negative Scenario: TSA - Evaluate policy with missing body- Negative
Given I execute the policy {/policy/example/test/1.0/evaluation} Given I execute the policy {test}
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 {allow} has the value {false} And the field {allow} has the value {false}
@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} When I load the body of my Policy request with {successful_message} from {Policy.json}
Given I execute the policy {/policy/testable/test0/1.0/evaluation} Given I execute the policy {missing}
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 @bug-policy-35 @negative
Scenario: TSA - DID resolution with incorrect did - Negative Scenario: TSA - DID resolution with incorrect did - Negative
Then I load the REST request {Policy.json} with profile {didResolve_missing_method} When I load the body of my Policy request with {did_missing_method} from {Policy.json}
And I execute the policy {/policy/example/resolve/1.0/evaluation} And I execute the policy {resolve}
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 {data.didResolutionMetadata.error} has the value {notFound} And the field {data.didResolutionMetadata.error} has the value {notFound}
...@@ -26,12 +26,16 @@ Feature: API - TSA - Policy - :group/:name/:version/lock DELETE ...@@ -26,12 +26,16 @@ Feature: API - TSA - Policy - :group/:name/:version/lock DELETE
Given we are testing the TSA Policy Api Given we are testing the TSA Policy Api
Scenario: TSA - Unlock policy - Positive Scenario: TSA - Unlock policy - Positive
When I lock the policy {/policy/example/test/1.0/lock} When I lock the policy {test}
And I unlock the policy {/policy/example/test/1.0/lock} And I unlock the policy {test}
And the status code should be {200} And the status code should be {200}
# Check if the policy can be executed
When I load the body of my Policy request with {successful_message} from {Policy.json}
And I execute the policy {test}
Then the status code should be {200}
@negative @negative
Scenario: TSA - Unlock none existing policy - Negative Scenario: TSA - Unlock none existing policy - Negative
When I unlock the policy {/policy/example/non_existing/1.0/lock} When I unlock the policy {non_existing}
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}
...@@ -31,20 +31,18 @@ Feature: API - TSA -Policy - :group/:name/:version/lock POST ...@@ -31,20 +31,18 @@ Feature: API - TSA -Policy - :group/:name/:version/lock POST
Given we are testing the TSA Policy Api Given we are testing the TSA Policy Api
Scenario: TSA - Lock policy - Positive Scenario: TSA - Lock policy - Positive
When I lock the policy {/policy/example/test/1.0/lock} When I lock the policy {test}
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} Then I load the body of my Policy request with {successful_message} from {Policy.json}
And I execute the policy {/policy/example/test/1.0/evaluation} And I execute the policy {test}
Then the status code should be {403} Then the status code should be {403}
And I lock the policy {/policy/example/test/1.0/lock} And the field {message} has the value {error evaluating policy}
And the status code should be {403} And I unlock the policy {test}
And the field {message} has the value {policy is already locked}
And I unlock the policy {/policy/example/test/1.0/lock}
@negative @negative
Scenario: TSA - Lock already locked policy - Negative Scenario: TSA - Lock already locked policy - Negative
When I lock the policy {/policy/example/test/1.0/lock} When I lock the policy {test}
And I lock the policy {/policy/example/test/1.0/lock} And I lock the policy {test}
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 {/policy/example/test/1.0/lock} And I unlock the policy {test}
...@@ -30,17 +30,16 @@ Feature: API -TSA - Task - v1/task GET ...@@ -30,17 +30,16 @@ Feature: API -TSA - Task - v1/task GET
Background: Background:
Given we are testing the TSA Task Api Given we are testing the TSA Task Api
@bug-policy-35
Scenario: TSA - Executing Task with DID resolver and Evaluate the Cache - Positive Scenario: TSA - Executing Task with DID resolver and Evaluate the Cache - Positive
Given I load the REST request {Policy.json} with profile {didResolve_evaluate} When I load the body of my Task request with {did_key} from {Policy.json}
And I send the current request as POST to endpoint {/v1/task/didResolve} And I execute the 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 # 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
And I send the current request to endpoint {v1/taskResult} with container value{taskID} And I get the Task result with key {taskID}
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 {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6} And the field {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
......
...@@ -30,23 +30,22 @@ Feature: API -TSA - Task - v1/task POST ...@@ -30,23 +30,22 @@ 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-policy-35
Scenario: TSA - Executing Task with DID resolver - Positive Scenario: TSA - Executing Task with DID resolver - Positive
Then I load the REST request {Policy.json} with profile {didResolve_evaluate} When I load the body of my Task request with {did_key} from {Policy.json}
And I send the current request as POST to endpoint {/v1/task/didResolve} And I execute the 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
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
And I send the current request to endpoint {v1/taskResult} with container value{taskID} And I get the Task result with key {taskID}
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 {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6} And the field {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6}
@negative @negative
Scenario: TSA - Executing Task with non existing task template - Negative Scenario: TSA - Executing Task with non existing task template - Negative
Then I load the REST request {Policy.json} with profile {didResolve_evaluate} When I load the body of my Task request with {did_key} from {Policy.json}
And I send the current request as POST to endpoint {/v1/task/resolve} And I execute the Task {non_existing}
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}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment