diff --git a/src/main/java/api/test/rest/RestSessionContainer.java b/src/main/java/api/test/rest/RestSessionContainer.java index 6c980081b2c18ddeb0633bcf3860bebdfaabfa55..9adcb807630aeddc31614b22d94aff6bb22d6b20 100644 --- a/src/main/java/api/test/rest/RestSessionContainer.java +++ b/src/main/java/api/test/rest/RestSessionContainer.java @@ -19,6 +19,7 @@ package api.test.rest; import api.test.rest.pojo.connection.Connection; import api.test.rest.pojo.credentialDef.CredentialDef; +import api.test.rest.pojo.presentationRequest.Presentation; import api.test.rest.pojo.schema.Schema; public class RestSessionContainer { @@ -26,7 +27,15 @@ public class RestSessionContainer { private Schema currentSchema; private CredentialDef currentCredentialDef; private Connection currentConnection; + private Presentation currentPresentation; + public Presentation getCurrentPresentation() { + return currentPresentation; + } + + public void setCurrentPresentation(Presentation currentPresentation) { + this.currentPresentation = currentPresentation; + } public Connection getCurrentConnection() { return currentConnection; diff --git a/src/main/java/api/test/rest/pojo/presentationRequest/Data.java b/src/main/java/api/test/rest/pojo/presentationRequest/Data.java new file mode 100644 index 0000000000000000000000000000000000000000..1615a0dae72da793141cce79c35ae0de94403bb5 --- /dev/null +++ b/src/main/java/api/test/rest/pojo/presentationRequest/Data.java @@ -0,0 +1,109 @@ + +package api.test.rest.pojo.presentationRequest; + +import com.google.gson.annotations.SerializedName; + +public class Data { + + @SerializedName("connectionId") + private String mConnectionId; + @SerializedName("createdDate") + private String mCreatedDate; + @SerializedName("credentialDefId") + private String mCredentialDefId; + @SerializedName("id") + private String mId; + @SerializedName("presentationId") + private String mPresentationId; + @SerializedName("presentationMessage") + private String mPresentationMessage; + @SerializedName("schemaId") + private String mSchemaId; + @SerializedName("status") + private String mStatus; + @SerializedName("theirDid") + private String mTheirDid; + @SerializedName("updatedDate") + private String mUpdatedDate; + + public String getConnectionId() { + return mConnectionId; + } + + public void setConnectionId(String connectionId) { + mConnectionId = connectionId; + } + + public String getCreatedDate() { + return mCreatedDate; + } + + public void setCreatedDate(String createdDate) { + mCreatedDate = createdDate; + } + + public String getCredentialDefId() { + return mCredentialDefId; + } + + public void setCredentialDefId(String credentialDefId) { + mCredentialDefId = credentialDefId; + } + + public String getId() { + return mId; + } + + public void setId(String id) { + mId = id; + } + + public String getPresentationId() { + return mPresentationId; + } + + public void setPresentationId(String presentationId) { + mPresentationId = presentationId; + } + + public String getPresentationMessage() { + return mPresentationMessage; + } + + public void setPresentationMessage(String presentationMessage) { + mPresentationMessage = presentationMessage; + } + + public String getSchemaId() { + return mSchemaId; + } + + public void setSchemaId(String schemaId) { + mSchemaId = schemaId; + } + + public String getStatus() { + return mStatus; + } + + public void setStatus(String status) { + mStatus = status; + } + + public String getTheirDid() { + return mTheirDid; + } + + public void setTheirDid(String theirDid) { + mTheirDid = theirDid; + } + + public String getUpdatedDate() { + return mUpdatedDate; + } + + public void setUpdatedDate(String updatedDate) { + mUpdatedDate = updatedDate; + } + +} diff --git a/src/main/java/api/test/rest/pojo/presentationRequest/Presentation.java b/src/main/java/api/test/rest/pojo/presentationRequest/Presentation.java new file mode 100644 index 0000000000000000000000000000000000000000..747e626e9ff39e5c989f9e9ae984d23630bb8a3d --- /dev/null +++ b/src/main/java/api/test/rest/pojo/presentationRequest/Presentation.java @@ -0,0 +1,39 @@ + +package api.test.rest.pojo.presentationRequest; + +import com.google.gson.annotations.SerializedName; + +public class Presentation { + + @SerializedName("data") + private Data mData; + @SerializedName("message") + private String mMessage; + @SerializedName("statusCode") + private Long mStatusCode; + + public Data getData() { + return mData; + } + + public void setData(Data data) { + mData = data; + } + + public String getMessage() { + return mMessage; + } + + public void setMessage(String message) { + mMessage = message; + } + + public Long getStatusCode() { + return mStatusCode; + } + + public void setStatusCode(Long statusCode) { + mStatusCode = statusCode; + } + +} diff --git a/src/main/resources/REST/json/ProofSendOOBPresentationRequest.json b/src/main/resources/REST/json/ProofSendOOBPresentationRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..dca17e36c2affbf34b0c6eee0761871e75555484 --- /dev/null +++ b/src/main/resources/REST/json/ProofSendOOBPresentationRequest.json @@ -0,0 +1,10 @@ +{ + "successful_creation": { + "schemaName":"", + "attributes":["fName","lName"], + "options": { + "type":"Aries1.0", + "credentialDefinationName":"Test" + } + } +} \ No newline at end of file diff --git a/src/main/resources/REST/json/ProofSendPresentationRequest.json b/src/main/resources/REST/json/ProofSendPresentationRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..77a4f2b88499f9f33550ca674a1b7767cfc8ecb8 --- /dev/null +++ b/src/main/resources/REST/json/ProofSendPresentationRequest.json @@ -0,0 +1,15 @@ +{ + "successful_creation": { + "comment": "Tested participant", + "attributes": [ + { + "attribute_name": "fName", + "value": "1", + "condition": "true" + } + ], + "schemaId": "", + "credentialDefId": "", + "connectionId": "" + } +} \ No newline at end of file diff --git a/src/main/resources/REST/schemas/Attestation_GET_credential.json b/src/main/resources/REST/schemas/Attestation_GET_credential.json index 338b2d4c46eadc6c6549444035d04bdac0ad1164..af69669d0f5bc711a53e1a5bf38d8fe90190f772 100644 --- a/src/main/resources/REST/schemas/Attestation_GET_credential.json +++ b/src/main/resources/REST/schemas/Attestation_GET_credential.json @@ -47,9 +47,7 @@ "updatedDate": { "type": "string" }, - "expirationDate": { - "type": "string" - } + "expirationDate": { "type": ["null", "string"] } }, "required": [ "id", diff --git a/src/main/resources/REST/schemas/Proof_GET_find_proof_presentation.json b/src/main/resources/REST/schemas/Proof_GET_find_proof_presentation.json new file mode 100644 index 0000000000000000000000000000000000000000..fadfeb8307830fb4cdc7bc9d35efe2da4645f42b --- /dev/null +++ b/src/main/resources/REST/schemas/Proof_GET_find_proof_presentation.json @@ -0,0 +1,77 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "statusCode": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "records": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "presentationId": { + "type": "string" + }, + "connectionId": { + "type": "string" + }, + "credentialDefId": { + "type": "string" + }, + "schemaId": { + "type": "string" + }, + "theirDid": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdDate": { + "type": "string" + }, + "updatedDate": { + "type": "string" + } + }, + "required": [ + "id", + "presentationId", + "connectionId", + "credentialDefId", + "schemaId", + "theirDid", + "status", + "createdDate", + "updatedDate" + ] + } + ] + } + }, + "required": [ + "count", + "records" + ] + } + }, + "required": [ + "statusCode", + "message", + "data" + ] +} \ No newline at end of file diff --git a/src/main/resources/REST/schemas/Proof_POST_OOB_presentation_request.json b/src/main/resources/REST/schemas/Proof_POST_OOB_presentation_request.json new file mode 100644 index 0000000000000000000000000000000000000000..32b549f7ca4bc5c59396e98babcb814a5836c208 --- /dev/null +++ b/src/main/resources/REST/schemas/Proof_POST_OOB_presentation_request.json @@ -0,0 +1,64 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "statusCode": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "data": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "presentationId": { + "type": "string" + }, + "connectionId": { + "type": "string" + }, + "credentialDefId": { + "type": "string" + }, + "schemaId": { + "type": "string" + }, + "theirDid": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdDate": { + "type": "string" + }, + "updatedDate": { + "type": "string" + }, + "presentationMessage": { + "type": "string" + } + }, + "required": [ + "id", + "presentationId", + "connectionId", + "credentialDefId", + "schemaId", + "theirDid", + "status", + "createdDate", + "updatedDate", + "presentationMessage" + ] + } + }, + "required": [ + "statusCode", + "message", + "data" + ] +} \ No newline at end of file diff --git a/src/test/java/api/test/rest/ocm/proof/ProofStepDefinitions.java b/src/test/java/api/test/rest/ocm/proof/ProofStepDefinitions.java index 5fbe6835ea87c748ec83eac7592275f8e48c866e..091ac90e8ce28efeeaa17a6f762458b4395baf7e 100644 --- a/src/test/java/api/test/rest/ocm/proof/ProofStepDefinitions.java +++ b/src/test/java/api/test/rest/ocm/proof/ProofStepDefinitions.java @@ -19,14 +19,18 @@ package api.test.rest.ocm.proof; import api.test.core.BaseStepDefinitions; import api.test.rest.RestSessionContainer; -import core.DataContainer; -import core.Request; -import core.Response; -import core.RestClient; +import api.test.rest.pojo.credentialDef.CredentialDef; +import api.test.rest.pojo.presentationRequest.Presentation; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import core.*; import cucumber.api.java.en.Given; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.util.HashMap; + public class ProofStepDefinitions extends BaseStepDefinitions { private static final Logger logger = LogManager.getLogger(ProofStepDefinitions.class.getSimpleName()); RestSessionContainer restSessionContainer; @@ -48,4 +52,89 @@ public class ProofStepDefinitions extends BaseStepDefinitions { addRequest(currentRequest); addResponse(response); } + + @Given("^I send presentation request via OCM Api") + public void I_send_presentation_request_via_OCM_Api() { + currentRequest.setPath("/proof/v1/send-presentation-request"); + + Response response = RestClient.post(currentRequest); + addRequest(currentRequest); + addResponse(response); + } + + @Given("^I send presentation request with the current data via OCM Api") + public void I_send_presentation_request_with_the_current_data_via_OCM_Api() { + Gson gson = new Gson(); + JsonElement jsonElement = gson.fromJson(currentRequest.getBody(), JsonElement.class); + // only try to load body as JsonObject if it is not null. + JsonObject jsonObject = new JsonObject(); + if (jsonElement != null) jsonObject = jsonElement.getAsJsonObject();; + jsonObject.addProperty("connectionId", restSessionContainer.getCurrentConnection().getData().getConnection().getId()); + jsonObject.addProperty("credentialDefId", restSessionContainer.getCurrentCredentialDef().getData().getCredDefId()); + jsonObject.addProperty("schemaId", restSessionContainer.getCurrentSchema().getData().getSchemaID()); + currentRequest.setBody(gson.toJson(jsonObject)); + + I_send_presentation_request_via_OCM_Api(); + } + + @Given("^I get all proof presentations via OCM Api") + public void I_get_all_proof_presentations_via_OCM_Api() { + currentRequest.setPath("/proof/v1/find-proof-presentation"); + + Response response = RestClient.get(currentRequest); + addRequest(currentRequest); + addResponse(response); + } + + @Given("^I get all proof presentations with pageSize \\{(.*?)\\} and page \\{(.*?)\\} via OCM api") + public void I_get_all_proof_presentations_with_pageSize_and_page_via_OCM_api(String pageSize,String page) { + HashMap<String, String> queryParams = new HashMap<>(); + queryParams.put("pageSize",pageSize); + queryParams.put("page",page); + currentRequest.setQueryParams(queryParams); + + I_get_all_proof_presentations_via_OCM_Api(); + } + + @Given("^I get proof presentations with the current presentationId via OCM Api") + public void I_get_all_proof_presentations_with_the_current_presentationId_via_OCM_Api() { + I_get_proof_presentations_with_presentationId_via_OCM_Api(restSessionContainer.getCurrentPresentation().getData().getPresentationId()); + } + + @Given("^I get proof presentations with presentationId \\{(.*?)\\} via OCM Api") + public void I_get_proof_presentations_with_presentationId_via_OCM_Api(String presentationId) { + currentRequest.setPath("/proof/v1/find-by-presentation-id?presentationId="+ presentationId); + + Response response = RestClient.get(currentRequest); + addRequest(currentRequest); + addResponse(response); + } + + @Given("^I send out of bound presentation request via OCM Api") + public void I_send_out_of_bound_presentation_request_via_OCM_Api() { + currentRequest.setPath("/proof/v1/send-out-of-band-presentation-request"); + + Response response = RestClient.post(currentRequest); + addRequest(currentRequest); + addResponse(response); + + if (getLastResponse() != null && getLastResponse().getStatusCode() == 201) { + restSessionContainer.setCurrentPresentation(JsonUtils.getResourceFromResponse(getLastResponse(), Presentation.class)); + } + } + + @Given("^I send out of bound presentation request with the current data via OCM Api") + public void I_send_out_of_bound_presentation_request_with_the_current_data_via_OCM_Api() { +// Gson gson = new Gson(); +// JsonElement jsonElement = gson.fromJson(currentRequest.getBody(), JsonElement.class); +// // only try to load body as JsonObject if it is not null. +// JsonObject jsonObject = new JsonObject(); +// if (jsonElement != null) jsonObject = jsonElement.getAsJsonObject();; +// jsonObject.addProperty("connectionId", restSessionContainer.getCurrentConnection().getData().getConnection().getId()); +// jsonObject.addProperty("credentialDefId", restSessionContainer.getCurrentCredentialDef().getData().getCredDefId()); +// jsonObject.addProperty("schemaId", restSessionContainer.getCurrentSchema().getData().getSchemaID()); +// currentRequest.setBody(gson.toJson(jsonObject)); + + I_send_out_of_bound_presentation_request_via_OCM_Api(); + } } \ No newline at end of file diff --git a/src/test/resources/features/ocm/proof/v1/find-by-presentation-id/GET.feature b/src/test/resources/features/ocm/proof/v1/find-by-presentation-id/GET.feature new file mode 100644 index 0000000000000000000000000000000000000000..eee4e71750ccc5eb19d0c6bf183d84aaceffd359 --- /dev/null +++ b/src/test/resources/features/ocm/proof/v1/find-by-presentation-id/GET.feature @@ -0,0 +1,67 @@ +#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://localhost/ocm/proof/v1/find-by-presentation-id?presentationId={{presentation-id}} +#Author: Rosen Georgiev rosen.georgiev@vereign.com + +#NOTE: Cannot be fully tested, because it needs connection to be made with PCM. + +@rest @all @ocm @proof +Feature: API - OCM - proof - v1 - find-by-presentation-id GET + This request is used to fetch proof presentation request information for the presentation id provided in query parameter. + It also provides state of the proof presentation request. + + + + Background: + Given we are testing the OCM Api + + @presentation @negative + Scenario: OCM - Proof - Get proof presentation with presentationId - Positive + Given I get proof presentations with presentationId {nonExistentId} via OCM Api + Then the field {statusCode} contains the value {404} + And the status code should be {404} + Then the field {message} contains the value {proof with proofRecordId "nonExistentId" not found.} + + @proof @bug-proof-25 @bug-proof-24 @bug-proof-23 + Scenario: OCM - Proof - Get OOB presentation request via presentationId - Positive +# #Create a new member process connection +# Given an administrator generates a QR code by creating a connection with alias {member} via OCM api +# Then the field {statusCode} contains the value {200} +# And the status code should be {201} +# #Creation of the schema +# And I clear the query parameters +# And I clear the request body +# Given I load the REST request {AttestationCreateSchemas.json} with profile {successful_creation} +# Then I create a new schema with random version via Attestation Manager in OCM api +# And the status code should be {201} +# #Creation of the Credential definition +# And I clear the request body +# Given I load the REST request {AttestationCreateCredentialDef.json} with profile {successful_creation} +# Then I create a new credential definition with the current schemaId via OCM Api +# And the status code should be {201} +# And I clear the request body + #Send Out of Bound Presentation Request + Given I load the REST request {ProofSendOOBPresentationRequest.json} with profile {successful_creation} + Then I send out of bound presentation request with the current data via OCM Api + And the status code should be {201} + Then the field {statusCode} contains the value {201} + #Get the request via presentationid + And I clear the request body + Given I get proof presentations with the current presentationId via OCM Api + Then the field {statusCode} contains the value {200} + And the status code should be {200} + Then the field {message} contains the value {Proof presentation fetch successfully} + Then the field {$.data.state} contains the value {request-sent} \ No newline at end of file diff --git a/src/test/resources/features/ocm/proof/v1/find-proof-presentation/GET.feature b/src/test/resources/features/ocm/proof/v1/find-proof-presentation/GET.feature new file mode 100644 index 0000000000000000000000000000000000000000..bdf488ede48930ad34142f0e10f273622e0d982e --- /dev/null +++ b/src/test/resources/features/ocm/proof/v1/find-proof-presentation/GET.feature @@ -0,0 +1,51 @@ +#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://localhost/ocm/proof/v1/find-proof-presentation +#Author: Rosen Georgiev rosen.georgiev@vereign.com + +@rest @all @ocm @proof +Feature: API - OCM - proof - v1 - find-proof-presentation GET + This request fetches the all the proof presentation requests for the participant. + The records can be filtered using provided query parameters. + + Background: + Given we are testing the OCM Api + + @proof + Scenario: OCM - Proof - Get all Proof Presentations - Positive + Given I get all proof presentations via OCM Api + Then the field {statusCode} contains the value {200} + And the status code should be {200} + Then the field {message} contains the value {Proof presentation fetch successfully} + And the response is valid according to the {Proof_GET_find_proof_presentation.json} REST schema + + @proof + Scenario: OCM - Proof - Get all Proof Presentations with pagination - Positive + Given I get all proof presentations with pageSize {5} and page {0} via OCM api + Then the field {statusCode} contains the value {200} + And the status code should be {200} + Then the field {message} contains the value {Proof presentation fetch successfully} + And the response is valid according to the {Proof_GET_find_proof_presentation.json} REST schema + And the field {$.data.records} contains {5} elements + + @proof @negative + Scenario: OCM - Proof - Try to get presentations with out of bounds pagination - Negative + Given I get all proof presentations with pageSize {9999} and page {999} via OCM api + Then the field {statusCode} contains the value {200} + And the status code should be {200} + Then the field {message} contains the value {Proof presentation fetch successfully} + And the response is valid according to the {Proof_GET_find_proof_presentation.json} REST schema + And the field {$.data.records} contains {0} elements \ No newline at end of file diff --git a/src/test/resources/features/ocm/proof/v1/send-out-of-band-presentation-request/POST.feature b/src/test/resources/features/ocm/proof/v1/send-out-of-band-presentation-request/POST.feature new file mode 100644 index 0000000000000000000000000000000000000000..58258e844554eb7b822d616d673e8f276403f087 --- /dev/null +++ b/src/test/resources/features/ocm/proof/v1/send-out-of-band-presentation-request/POST.feature @@ -0,0 +1,58 @@ +#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://localhost/ocm/attestation/v1/send-out-of-band-presentation-request +#Author: Rosen Georgiev rosen.georgiev@vereign.com + +@rest @all @ocm +Feature: API - OCM - proof - v1 - send-out-of-band-presentation-request POST + From a verifier to a prover, the out of band presentation request message describes values + that need to be revealed and predicates that need to be fulfilled. + + The Out-of-band protocol is used when you wish to engage with another + agent and you don't have a DIDComm connection to use for the interaction. + + NOTE: This request needs PCM to be able to be called + + Background: + Given we are testing the OCM Api + + @proof @bug-proof-25 @bug-proof-24 @bug-proof-23 + Scenario: OCM - Proof - Create out of bounds presentation - Positive +# #Create a new member process connection +# Given an administrator generates a QR code by creating a connection with alias {member} via OCM api +# Then the field {statusCode} contains the value {200} +# And the status code should be {201} +# #Creation of the schema +# And I clear the query parameters +# And I clear the request body +# Given I load the REST request {AttestationCreateSchemas.json} with profile {successful_creation} +# Then I create a new schema with random version via Attestation Manager in OCM api +# And the status code should be {201} +# #Creation of the Credential definition +# And I clear the request body +# Given I load the REST request {AttestationCreateCredentialDef.json} with profile {successful_creation} +# Then I create a new credential definition with the current schemaId via OCM Api +# And the status code should be {201} +# And I clear the request body + #Send Out of Bound Presentation Request + Given I load the REST request {ProofSendOOBPresentationRequest.json} with profile {successful_creation} + Then I send out of bound presentation request with the current data via OCM Api + And the status code should be {201} + Then the field {statusCode} contains the value {201} + Then the field {message} contains the value {Presentation request send successfully} + Then the field {$.data.credentialDefId} contains the value {Test} + Then the field {$.data.status} contains the value {request-sent} + And the response is valid according to the {Proof_POST_OOB_presentation_request.json} REST schema \ No newline at end of file diff --git a/src/test/resources/features/ocm/proof/v1/send-presentation-request/POST.feature b/src/test/resources/features/ocm/proof/v1/send-presentation-request/POST.feature new file mode 100644 index 0000000000000000000000000000000000000000..b47bc3b42985f39e51dd02dfdfc6d2a9d752e80a --- /dev/null +++ b/src/test/resources/features/ocm/proof/v1/send-presentation-request/POST.feature @@ -0,0 +1,54 @@ +#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://localhost/ocm/attestation/v1/send-presentation-request +#Author: Rosen Georgiev rosen.georgiev@vereign.com + +@rest @all @ocm +Feature: API - OCM - proof - v1 - send-presentation-request POST + From a verifier to a prover, the presentation request message describes values + that need to be revealed and predicates that need to be fulfilled. + + In Hyperledger Indy, this message is required, because it forces the Issuer to make a cryptographic commitment + to the set of fields in the final credential and thus prevents Issuers from inserting spurious data. + + NOTE: This request needs PCM to be able to be called + + Background: + Given we are testing the OCM Api + + @proof @wip + Scenario: OCM - Proof - Try to Create offer of the currently created credential for untrusted connection - Negative + #Create a new member process connection + Given an administrator generates a QR code by creating a connection with alias {member} via OCM api + Then the field {statusCode} contains the value {200} + And the status code should be {201} + #Creation of the schema + And I clear the query parameters + And I clear the request body + Given I load the REST request {AttestationCreateSchemas.json} with profile {successful_creation} + Then I create a new schema with random version via Attestation Manager in OCM api + And the status code should be {201} + #Creation of the Credential definition + And I clear the request body + Given I load the REST request {AttestationCreateCredentialDef.json} with profile {successful_creation} + Then I create a new credential definition with the current schemaId via OCM Api + And the status code should be {201} + And I clear the request body + #Send Presentation Request + Given I load the REST request {ProofSendPresentationRequest.json} with profile {successful_creation} + Then I send presentation request with the current data via OCM Api + And the status code should be {201} +