From 1481cbf322b5d7f904582d941eddf2cc92357ac6 Mon Sep 17 00:00:00 2001 From: "georgi.michev" <georgi.michev@vereign.com> Date: Mon, 11 Jul 2022 11:48:39 +0300 Subject: [PATCH] implement code reviw comments Signed-off-by: georgi.michev <georgi.michev@vereign.com> --- .../api/test/rest/tsa/cache/CacheStepDefinitions.java | 5 ----- .../resources/features/tsa/infohub/v1/export/GET.feature | 8 ++++++++ .../features/tsa/infohub/v1/import/POST.feature | 9 ++++++++- .../features/tsa/signer/v1/credential/proof/POST.feature | 2 +- .../tsa/signer/v1/presentation/proof/POST.feature | 2 +- 5 files changed, 18 insertions(+), 8 deletions(-) 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 c2ac4c06..916f9a04 100644 --- a/src/test/java/api/test/rest/tsa/cache/CacheStepDefinitions.java +++ b/src/test/java/api/test/rest/tsa/cache/CacheStepDefinitions.java @@ -34,11 +34,6 @@ public class CacheStepDefinitions extends BaseStepDefinitions { } } - @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/resources/features/tsa/infohub/v1/export/GET.feature b/src/test/resources/features/tsa/infohub/v1/export/GET.feature index 2241669e..2c97cdcf 100644 --- a/src/test/resources/features/tsa/infohub/v1/export/GET.feature +++ b/src/test/resources/features/tsa/infohub/v1/export/GET.feature @@ -28,8 +28,16 @@ Feature: API - TSA - Infohub - v1/export GET Scenario: TSA - Export through Infohub - Positive When I export the {testexport} via TSA Infohub API Then the status code should be {200} + ## If the result is not in the cache the first call returns the below result + ## And the field {result} has the value {export request is accepted} 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} + + Scenario: TSA - Export missing export through Infohub - Negative + When I export the {missing_export} via TSA Infohub API + Then the status code should be {404} + And the response is valid according to the {Policy_Evaluate_negative_schema.json} REST schema + And the field {message} has the value {export configuration not found} diff --git a/src/test/resources/features/tsa/infohub/v1/import/POST.feature b/src/test/resources/features/tsa/infohub/v1/import/POST.feature index 7dcbadfa..fd2d19f8 100644 --- a/src/test/resources/features/tsa/infohub/v1/import/POST.feature +++ b/src/test/resources/features/tsa/infohub/v1/import/POST.feature @@ -29,4 +29,11 @@ Feature: API - TSA - Infohub - v1/export POST 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 + And the response is valid according to the {Infohub_Import_schema.json} REST schema + + @wip @bug-signer-#13 @negative + Scenario: TSA - Import empty data to Infohub - Negative + When I set the following request body {{}} + And I import data via TSA Infohub 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/credential/proof/POST.feature b/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature index 9142ce1c..07586ba0 100644 --- a/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature +++ b/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature @@ -32,7 +32,7 @@ Feature: API - TSA - Signer credential proof - v1/credential/proof POST 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 + @wip @bug-signer-#13 @negative 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 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 965b877e..bb8c99f6 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 @@ -32,7 +32,7 @@ Feature: API - TSA - Signer presentation proof - v1/presentation/proof POST 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} - @wip @bug-signer-#13 + @wip @bug-signer-#13 @negative Scenario: TSA - validate presentation proof with empty body - Negative When I set the following request body {{}} When I create presentation proof via TSA Signer API -- GitLab