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

add and update task tests, refactor mongo path


Signed-off-by: default avatargeorgi.michev <georgi.michev@vereign.com>
parent 52df3f64
No related branches found
No related tags found
1 merge request!18add cache and task tests
......@@ -41,13 +41,14 @@ import org.bson.Document;
import org.bson.conversions.Bson;
import org.bson.types.ObjectId;
import static api.test.core.GeneralStepDefinitions.the_field_has_the_value_;
import static com.mongodb.client.model.Filters.eq;
public class PolicyStepDefinitions extends BaseStepDefinitions {
private static final Logger logger = LogManager.getLogger(RestGeneralStepDefinitions.class.getSimpleName());
public static final String mongoConnection = "mongodb://root:root@localhost:27017";
// MONGO_PATH environment variable should be set to point to the MonoDB instance
public static final String mongoConnection = System.getenv("MONGO_PATH");
RestSessionContainer restSessionContainer;
Request currentRequest;
......
......@@ -34,15 +34,31 @@ Feature: API -TSA - Task - v1/task POST
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 {task/resolve}
And I send the current request as POST to endpoint {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 {3000} mseconds
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.doc.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
Scenario: TSA - Executing Task with non existing task template - Negative
Given I upload a DID resolver policy to repository
Then I load the REST request {Policy.json} with profile {didResolve_evaluate}
And I send the current request as POST to endpoint {task/resolve}
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 delete policy {resolve} from repository
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