diff --git a/features/executeTaskList.feature b/features/executeTaskList.feature deleted file mode 100644 index a87234353c691bd228544b31b003130d4fdaaac4..0000000000000000000000000000000000000000 --- a/features/executeTaskList.feature +++ /dev/null @@ -1,56 +0,0 @@ -As user -I want to execute the list of tasks -So I am able to bring the consistensy to running multiple asyncronous tasks - -Scenario: Sequential task list processing -Given long running policy is uploaded to the system -And the list of tasks is defined -And the list of tasks contains the group of tasks -And the group of tasks contains task A and task B -When I evaluate a policy -And the task list specified as an input -Then I get successful response with waiting status -And the response contains the taskListObject -And the taskListObject contains the taskList id -And the taskListObject contains the taskIDs of all the tasks - -Scenario: Handling the error for the sequential task list execution -Given task list is configured -And the list of tasks contains the group of tasks -And the group of tasks contains task A, task B and task C -And the group of tasks is configured for running one by one -And the task list has executed -And task B failed -When I request the result of task list execution -Then I get the failure response -And the status of task list execution marked as failed -And the status of task A is marked as successful -And the status of task B is marked as failed -And the status of task C is marked as failed - -Scenario: Handling the error for the parallel task list execution -Given task list is configured -And the list of tasks contains the group of tasks -And the group of tasks contains task A, task B and task C -And the group of tasks is configured for running in parallel -And the task list has executed -And task B failed -When I request the result of task list execution -Then I get the failure response -And the status of task list execution marked as failed -And the status of task A is marked as successful -And the status of task B is marked as failed -And the status of task C is marked as successful - -Scenario: Handling the error for the mixed task list execution -Given task list is configured -And the list of tasks contains the group A and group B -And the group A configured for running sequentially -And the group B configured for running in parallel -And the task list has executed -And one of the tasks in a group B failed -When I request the result of the task list execution -Then I get the failure response -And the status of task list execution marked as failed - - diff --git a/src/main/java/api/test/rest/RestSessionContainer.java b/src/main/java/api/test/rest/RestSessionContainer.java index b5e5261a2a684a1a7bc08dbcf3b3a596b1a33d6f..f32f2bd610f82d34f60efab9a98cf8102efdac5a 100644 --- a/src/main/java/api/test/rest/RestSessionContainer.java +++ b/src/main/java/api/test/rest/RestSessionContainer.java @@ -23,6 +23,15 @@ public class RestSessionContainer { private String taskID; private String taskListID; private List<String> groupTaskIDs; + private List<String> importIDs; + + public List<String> getImportIDs() { + return importIDs; + } + + public void setImportIDs(List<String> importIDs) { + this.importIDs = importIDs; + } public List<String> getGroupTaskIDs() { return groupTaskIDs; diff --git a/src/main/java/core/JsonUtils.java b/src/main/java/core/JsonUtils.java index 3a5809bf7402a3a820c3ed7b9304818de2dfdaa7..fcec2c115a162a86b45529e22b3e0d3e567961fb 100644 --- a/src/main/java/core/JsonUtils.java +++ b/src/main/java/core/JsonUtils.java @@ -244,6 +244,14 @@ public class JsonUtils { return System.getProperty("baseUrl") + "/cache"; } + /** + * Get the url for "TSA Infohub" + * @return the uri + */ + public static String getTSAInfohub() { + return System.getProperty("baseUrl") + "/infohub"; + } + /** * Get the url for "TSA Signer" * @return the uri diff --git a/src/main/resources/REST/json/Credential.json b/src/main/resources/REST/json/Credential.json new file mode 100644 index 0000000000000000000000000000000000000000..90acfcfd468aa351e2f00750e5f24de35f90ca4d --- /dev/null +++ b/src/main/resources/REST/json/Credential.json @@ -0,0 +1,15 @@ +{ + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/security/suites/jws-2020/v1", + "https://www.w3.org/2018/credentials/examples/v1" + ], + "credentialSubject": { + "allow": true, + "hello": "world", + "id": "example/examplePolicy/1.0" + }, + "issuanceDate": "2022-07-01T13:29:47.578628068Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "VerifiableCredential" +} \ No newline at end of file diff --git a/src/main/resources/REST/json/Infohub.json b/src/main/resources/REST/json/Infohub.json new file mode 100644 index 0000000000000000000000000000000000000000..869c2778317d4db07531b3e4e0942f5c058bab89 --- /dev/null +++ b/src/main/resources/REST/json/Infohub.json @@ -0,0 +1,48 @@ +{ + "successful_import": { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/security/suites/jws-2020/v1", + "https://www.w3.org/2018/credentials/examples/v1" + ], + "id": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "proof": { + "created": "2022-07-08T09:23:43.073435032Z", + "jws": "eyJhbGciOiJKc29uV2ViU2lnbmF0dXJlMjAyMCIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..MEYCIQCSmaYCbM8RweOXO1Vauz7F5taH9xnRKtcmkTkrhxw9DQIhAMhLuFBqk5JvYstemhdBGc81Ie3zOl00m_5CmfUd7OtO", + "proofPurpose": "assertionMethod", + "type": "JsonWebSignature2020", + "verificationMethod": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1" + }, + "type": "VerifiablePresentation", + "verifiableCredential": [ + { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/security/suites/jws-2020/v1", + "https://www.w3.org/2018/credentials/examples/v1" + ], + "credentialSubject": { + "allow": true, + "id": "example/examplePolicy/1.0" + }, + "issuanceDate": "2022-07-08T09:23:43.006994232Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "VerifiableCredential" + }, + { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/security/suites/jws-2020/v1", + "https://www.w3.org/2018/credentials/examples/v1" + ], + "credentialSubject": { + "allow": true, + "id": "example/ProofRequestResponse/1.0" + }, + "issuanceDate": "2022-07-08T09:23:43.006998385Z", + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "type": "VerifiableCredential" + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/REST/schemas/Infohub_Export_schema.json b/src/main/resources/REST/schemas/Infohub_Export_schema.json new file mode 100644 index 0000000000000000000000000000000000000000..293ca617533c83eb8bfad5959502f440c23a88e4 --- /dev/null +++ b/src/main/resources/REST/schemas/Infohub_Export_schema.json @@ -0,0 +1,165 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "@context": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ] + }, + "id": { + "type": "string" + }, + "proof": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "jws": { + "type": "string" + }, + "proofPurpose": { + "type": "string" + }, + "type": { + "type": "string" + }, + "verificationMethod": { + "type": "string" + } + }, + "required": [ + "created", + "jws", + "proofPurpose", + "type", + "verificationMethod" + ] + }, + "type": { + "type": "string" + }, + "verifiableCredential": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "@context": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ] + }, + "credentialSubject": { + "type": "object", + "properties": { + "allow": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "required": [ + "allow", + "id" + ] + }, + "issuanceDate": { + "type": "string" + }, + "issuer": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "@context", + "credentialSubject", + "issuanceDate", + "issuer", + "type" + ] + }, + { + "type": "object", + "properties": { + "@context": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ] + }, + "credentialSubject": { + "type": "object", + "properties": { + "allow": { + "type": "boolean" + }, + "id": { + "type": "string" + } + }, + "required": [ + "allow", + "id" + ] + }, + "issuanceDate": { + "type": "string" + }, + "issuer": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "@context", + "credentialSubject", + "issuanceDate", + "issuer", + "type" + ] + } + ] + } + }, + "required": [ + "@context", + "id", + "proof", + "type", + "verifiableCredential" + ] +} \ No newline at end of file diff --git a/src/main/resources/REST/schemas/Infohub_Import_schema.json b/src/main/resources/REST/schemas/Infohub_Import_schema.json new file mode 100644 index 0000000000000000000000000000000000000000..9abbd17724e1fb44d426c02233c25202b1b9a8f7 --- /dev/null +++ b/src/main/resources/REST/schemas/Infohub_Import_schema.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "importIds": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ] + } + }, + "required": [ + "importIds" + ] +} \ No newline at end of file diff --git a/src/main/resources/REST/schemas/Signer_CredentialProof_schema.json b/src/main/resources/REST/schemas/Signer_CredentialProof_schema.json new file mode 100644 index 0000000000000000000000000000000000000000..50182c1b1bebe87efb5463f7cc88a542f5605188 --- /dev/null +++ b/src/main/resources/REST/schemas/Signer_CredentialProof_schema.json @@ -0,0 +1,83 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "@context": { + "type": "array", + "items": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ] + }, + "credentialSubject": { + "type": "object", + "properties": { + "allow": { + "type": "boolean" + }, + "hello": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "allow", + "hello", + "id" + ] + }, + "issuanceDate": { + "type": "string" + }, + "issuer": { + "type": "string" + }, + "proof": { + "type": "object", + "properties": { + "created": { + "type": "string" + }, + "jws": { + "type": "string" + }, + "proofPurpose": { + "type": "string" + }, + "type": { + "type": "string" + }, + "verificationMethod": { + "type": "string" + } + }, + "required": [ + "created", + "jws", + "proofPurpose", + "type", + "verificationMethod" + ] + }, + "type": { + "type": "string" + } + }, + "required": [ + "@context", + "credentialSubject", + "issuanceDate", + "issuer", + "proof", + "type" + ] +} \ No newline at end of file diff --git a/src/test/java/api/test/rest/RestGeneralStepDefinitions.java b/src/test/java/api/test/rest/RestGeneralStepDefinitions.java index 961c5ee48e828be53698f10235080684a7eb0e0c..447c286f73ce3670c6f205f3069dd9b07debbe31 100644 --- a/src/test/java/api/test/rest/RestGeneralStepDefinitions.java +++ b/src/test/java/api/test/rest/RestGeneralStepDefinitions.java @@ -66,6 +66,16 @@ public class RestGeneralStepDefinitions extends BaseStepDefinitions { currentRequest.setContentType("application/json"); } + @Given("we are testing the TSA Infohub Api") + public void weAreTestingTheTSAInfohubApi() { + RestClient.setDefaultEncoding("UTF8"); + RestClient.setBaseURI(JsonUtils.getTSAInfohub()); + RestClient.appendDefaultContentCharsetToContentTypeIfUndefined(false); + currentRequest.clear(); + currentRequest.getHeaders().put("X-Client-UserAgent", "test framework"); + currentRequest.setContentType("application/json"); + } + @Given("^we are testing the TSA Policy Api") public void we_are_testing_the_Policy_api() throws Throwable { RestClient.setDefaultEncoding("UTF8"); @@ -224,5 +234,4 @@ public class RestGeneralStepDefinitions extends BaseStepDefinitions { public void iLoadValueIntoCurrentRequestHEADER(String value, String headerName) throws Throwable { currentRequest.getHeaders().put(headerName, value); } - } diff --git a/src/test/java/api/test/rest/tsa/cache/CacheStepDefinitions.java b/src/test/java/api/test/rest/tsa/cache/CacheStepDefinitions.java index 352cef90a30e5a0819d0004bc0f02557e98144f9..c2ac4c067bce8a8c234c6cc867798c8d4b984e63 100644 --- a/src/test/java/api/test/rest/tsa/cache/CacheStepDefinitions.java +++ b/src/test/java/api/test/rest/tsa/cache/CacheStepDefinitions.java @@ -5,7 +5,6 @@ import api.test.rest.RestGeneralStepDefinitions; import api.test.rest.RestSessionContainer; import core.*; import cucumber.api.java.en.And; -import cucumber.api.java.en.Given; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -34,4 +33,15 @@ public class CacheStepDefinitions extends BaseStepDefinitions { addResponse(response); } } + + @And("^I get the result \\{(\\d+)\\} from Import IDs $") + public void iGetTheResultOfTask(int id) { + iSendTheCachePOSTRequest( restSessionContainer.getImportIDs().get(id)); + } + + @And("I load element \\{(\\d+)\\} from Info SessionContainer into currentRequest HEADER \\{(.*?)\\}$") + public void load_element_from_Info_SessionContainer_into_currentRequest_Header_(int id, String headerName) throws Throwable { + currentRequest.getHeaders().put(headerName, restSessionContainer.getImportIDs().get(id)); + + } } diff --git a/src/test/java/api/test/rest/tsa/infohub/InfohubStepDefinitions.java b/src/test/java/api/test/rest/tsa/infohub/InfohubStepDefinitions.java new file mode 100644 index 0000000000000000000000000000000000000000..c478947fb6dbdecbafacc6a598484aefd038e9d2 --- /dev/null +++ b/src/test/java/api/test/rest/tsa/infohub/InfohubStepDefinitions.java @@ -0,0 +1,52 @@ +package api.test.rest.tsa.infohub; + +import api.test.core.BaseStepDefinitions; +import api.test.rest.RestGeneralStepDefinitions; +import api.test.rest.RestSessionContainer; +import com.jayway.jsonpath.JsonPath; +import core.DataContainer; +import core.Request; +import core.Response; +import core.RestClient; +import cucumber.api.java.en.And; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import java.util.List; + +public class InfohubStepDefinitions extends BaseStepDefinitions { + private static final Logger logger = LogManager.getLogger(RestGeneralStepDefinitions.class.getSimpleName()); + RestSessionContainer restSessionContainer; + Request currentRequest; + + public InfohubStepDefinitions(RestSessionContainer restSessionContainer, Request currentRequest, DataContainer dataContainer) { + super(dataContainer); + this.restSessionContainer = restSessionContainer; + this.currentRequest = currentRequest; + } + + @And("^I export the \\{(.*)\\} via TSA Infohub API$") + public void iExportTheData(String configuration) { + currentRequest.setPath("/v1/export/" + configuration); + + Response response = RestClient.get(currentRequest); + addRequest(currentRequest); + addResponse(response); + } + + @And("I import data via TSA Infohub API") + public void iImportData() { + currentRequest.setPath("/v1/import"); + + Response response = RestClient.post(currentRequest); + addRequest(currentRequest); + addResponse(response); + + if (getLastResponse().getStatusCode() == 200) { + String responseBody = getLastResponse().getBody(); + + List<String> importResult = JsonPath.read(responseBody, "$.importIds"); + restSessionContainer.setImportIDs(importResult); + } + } +} diff --git a/src/test/java/api/test/rest/tsa/policy/PolicyStepDefinitions.java b/src/test/java/api/test/rest/tsa/policy/PolicyStepDefinitions.java index fc374d82f53e608dc95737db2d7832c3ed6f7f31..b6aa2df7cc3da76761346f35f222623d07d55804 100644 --- a/src/test/java/api/test/rest/tsa/policy/PolicyStepDefinitions.java +++ b/src/test/java/api/test/rest/tsa/policy/PolicyStepDefinitions.java @@ -22,9 +22,7 @@ import api.test.rest.RestGeneralStepDefinitions; import api.test.rest.RestSessionContainer; import core.*; import cucumber.api.java.en.And; -import cucumber.api.java.en.Given; import cucumber.api.java.en.When; -import exceptions.RAFException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/src/test/java/api/test/rest/tsa/signer/SignerStepDefinitions.java b/src/test/java/api/test/rest/tsa/signer/SignerStepDefinitions.java index fb87712776e8d22c677ca9d043434c65bb59478f..0bdf245d21e958361db839be618e3e4a85194aea 100644 --- a/src/test/java/api/test/rest/tsa/signer/SignerStepDefinitions.java +++ b/src/test/java/api/test/rest/tsa/signer/SignerStepDefinitions.java @@ -44,11 +44,19 @@ public class SignerStepDefinitions extends BaseStepDefinitions { addResponse(response); } - @When("I validate presentation proof via TSA Signer API") - public void iValidatePresentationProofViaTSASignerAPI() { + @When("I create presentation proof via TSA Signer API") + public void iCreatePresentationProofViaTSASignerAPI() { currentRequest.setPath("/v1/presentation/proof"); Response response = RestClient.post(currentRequest); addRequest(currentRequest); addResponse(response); } + + @When("I create credential proof via TSA Signer API") + public void iCreateCredentialProofViaTSASignerAPI() { + currentRequest.setPath("/v1/credential/proof"); + Response response = RestClient.post(currentRequest); + addRequest(currentRequest); + addResponse(response); + } } diff --git a/src/test/java/api/test/rest/tsa/task/TaskStepDefinitions.java b/src/test/java/api/test/rest/tsa/task/TaskStepDefinitions.java index 8a0967c4978136cdd428062eb7919b9d6db4e8e4..f86a00ba1580ff449410bbf7e53ecaefd79bd174 100644 --- a/src/test/java/api/test/rest/tsa/task/TaskStepDefinitions.java +++ b/src/test/java/api/test/rest/tsa/task/TaskStepDefinitions.java @@ -100,4 +100,5 @@ public class TaskStepDefinitions extends BaseStepDefinitions{ public void iGetTheResultOfTask(int id) { iGetTheTaskResultWithKey( restSessionContainer.getGroupTaskIDs().get(id)); } + } \ 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 732bf9f4397d92f4d1feb2befec96aaa88adde8a..ca6f8c486a839185945ba5062e85796fb15151ff 100644 --- a/src/test/resources/features/tsa/cache/v1/cache/GET.feature +++ b/src/test/resources/features/tsa/cache/v1/cache/GET.feature @@ -67,4 +67,20 @@ Feature: API -TSA - Cache - v1/cache GET When I send the Cache GET request via TSA Cache API Then the status code should be {200} 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} \ No newline at end of file + And the field {data.didDocument.id} has the value {did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6} + + Scenario: TSA - Check the Cache after importing data to Infohub - Positive + Given we are testing the TSA Infohub Api + When I load the REST request {Infohub.json} with profile {successful_import} + And I import data via TSA Infohub API + Then the status code should be {200} + ## Checking the cache service with Import IDs + Given we are testing the TSA Cache Api + Then I load element {0} from Info SessionContainer into currentRequest HEADER {x-cache-key} + When I send the Cache GET request via TSA Cache API + And the field {allow} has the value {true} + And the field {id} has the value {example/examplePolicy/1.0} + Then I load element {1} from Info SessionContainer into currentRequest HEADER {x-cache-key} + When I send the Cache GET request via TSA Cache API + And the field {allow} has the value {true} + And the field {id} has the value {example/ProofRequestResponse/1.0} diff --git a/src/test/resources/features/tsa/infohub/v1/export/GET.feature b/src/test/resources/features/tsa/infohub/v1/export/GET.feature new file mode 100644 index 0000000000000000000000000000000000000000..2241669e9d0e3496b767409914a9c3e2912cab54 --- /dev/null +++ b/src/test/resources/features/tsa/infohub/v1/export/GET.feature @@ -0,0 +1,35 @@ +#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/infohub/v1/export +#Author: Georgi Michev georgi.michev@vereign.com + +@rest @all @tsa @infohub +Feature: API - TSA - Infohub - v1/export GET + As user + I want to export data wrapped as Verifiable Credential or Presentation + So I can have the data with proof + + Background: + Given we are testing the TSA Infohub Api + + Scenario: TSA - Export through Infohub - Positive + When I export the {testexport} via TSA Infohub API + Then the status code should be {200} + When I export the {testexport} via TSA Infohub API + Then the status code should be {200} + And the response is valid according to the {Infohub_Export_schema.json} REST schema + And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} + And the field {proof.type} has the value {JsonWebSignature2020} diff --git a/src/test/resources/features/tsa/infohub/v1/import/POST.feature b/src/test/resources/features/tsa/infohub/v1/import/POST.feature new file mode 100644 index 0000000000000000000000000000000000000000..7dcbadfa293d0abcd55a7df777f01ab7e979a6f9 --- /dev/null +++ b/src/test/resources/features/tsa/infohub/v1/import/POST.feature @@ -0,0 +1,32 @@ +#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/infohub/v1/import +#Author: Georgi Michev georgi.michev@vereign.com + +@rest @all @tsa @infohub +Feature: API - TSA - Infohub - v1/export POST + As user + I want to import data in to Infohub + So I can export it later + + Background: + Given we are testing the TSA Infohub Api + + Scenario: TSA - Import data to Infohub - Positive + When I load the REST request {Infohub.json} with profile {successful_import} + And I import data via TSA Infohub API + Then the status code should be {200} + And the response is valid according to the {Infohub_Import_schema.json} REST schema \ No newline at end of file diff --git a/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature b/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature new file mode 100644 index 0000000000000000000000000000000000000000..9142ce1c4b361f6598cebcfa8abc79881cc84c89 --- /dev/null +++ b/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature @@ -0,0 +1,40 @@ +#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/signer/v1/credential/proof +#Author: Georgi Michev georgi.michev@vereign.com + +@rest @all @tsa @signer +Feature: API - TSA - Signer credential proof - v1/credential/proof POST + As user + I want to create a credential proof + So the credential can be verified + + Background: + Given we are testing the TSA Signer Api + + Scenario: TSA - create credential proof - Positive + When I load the request from json {/REST/json/Credential.json} + When I create credential proof via TSA Signer API + And the status code should be {200} + And the response is valid according to the {Signer_CredentialProof_schema.json} REST schema + And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} + + @wip @bug-signer-#13 + Scenario: TSA - validate credential proof with empty body - Negative + When I set the following request body {{}} + When I create credential proof via TSA Signer API + And the status code should be {400} + And the field {message} has the value {missing required payload} diff --git a/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature b/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature index 84af1aa993b73986a93ac9815157d77514daaeba..965b877e7398a19c596dfe69ddb3f4bcbe3c526a 100644 --- a/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature +++ b/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature @@ -19,15 +19,15 @@ @rest @all @tsa @signer Feature: API - TSA - Signer presentation proof - v1/presentation/proof POST As user - I want to check a presentation proof - So I am sure it is valid + I want to create a presentation proof + So the presentation can be verified Background: Given we are testing the TSA Signer Api - Scenario: TSA - validate presentation proof - Positive + Scenario: TSA - create presentation proof - Positive When I load the request from json {/REST/json/Presentation.json} - When I validate presentation proof via TSA Signer API + When I create presentation proof via TSA Signer API And the status code should be {200} And the response is valid according to the {Signer_PresentationProof_schema.json} REST schema And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} @@ -35,6 +35,6 @@ Feature: API - TSA - Signer presentation proof - v1/presentation/proof POST @wip @bug-signer-#13 Scenario: TSA - validate presentation proof with empty body - Negative When I set the following request body {{}} - When I validate presentation proof via TSA Signer API + When I create presentation proof via TSA Signer API And the status code should be {400} And the field {message} has the value {missing required payload}