Skip to content
Snippets Groups Projects
Commit 9ab33028 authored by Kalin Canov's avatar Kalin Canov :fishing_pole_and_fish:
Browse files

Merge branch 'main' into 'develop'

sync

See merge request !11
parents 4f0ff318 e30c5069
Branches develop
No related tags found
2 merge requests!12Update,!11sync
Showing
with 5095 additions and 319 deletions
As an OCM user
I want to create a new CredentialType
Feature: Create a new CredentialType
Create a new CredentialType
Scenario: Provide valid and required CredentialType Details
Given I have passed all required credentialType details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> credentialType/
When passed all valid credentialType details.
Then credentialType should be created in DB.
And I should get the HTTP status code 201 Created and the created CredentialType Details.
Scenario: Provide invalid schema_id or type
Given I have passed schema_id and type.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> credentialType/
When passed invalid schema_id or type.
Then I should get HTTP status code 400 Bad Request.
\ No newline at end of file
As an OCM user
I want to create credential offer
Feature: Create offer credential
Create a credential offer
Scenario: Provide valid and required connectionId, credentialDefinitionId, comment, preview and autoAcceptCredential
Given I have passed all required offer credential details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> create-offer-credential/
When passed all valid offer credential details.
Then credential offer should be sent to the given connection.
And I should get the HTTP status code 201 Created and the created credential offer Details.
\ No newline at end of file
As an OCM user
I want to get credentials
Feature: Get credential
Scenario: Provide valid credential_id
Given I have passed all required details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> credential/:id
When passed valid credential_id.
Then I should get the HTTP status code 200 Ok and the credential Details.
Scenario: Provide invalid credential_id
Given I have passed all required details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> credential/:id
When passed invalid credential_id.
Then I should get the HTTP status code 404 Not Found.
\ No newline at end of file
As an OCM user
I want to get the credentialType details of a given type
Feature: Get CredentialType details
Get the details of credentialType of given type
Scenario: Provide valid and required type
Given I have passed type.
# src\issue-credential\controller\controller.ts -> NATS call for topic 'ATTESTATION_MANAGER_SERVICE/getCredentialsTypeDetails'
When passed valid type.
Then I should get the details of the CredentialType.
\ No newline at end of file
As an OCM user
I want to get the credentials issued to a given connection
Feature: Get issued credentials of a given connection
Scenario: Provide valid and required connection_id
Given I have passed connection_id.
# src\issue-credential\controller\controller.ts -> NATS call for topic 'ATTESTATION_MANAGER_SERVICE/getIssueCredentials'
When passed valid connection_id.
Then I should get the list of Credentials Issued.
\ No newline at end of file
As an OCM user
I want to offer MemberShip Credentials
Feature: Offer Membership Credential
Offer a membership credential to User
Scenario: Provide valid and required status, connectionId, theirLabel and participantDid
Given AFJ Agent NATS Publisher have passed all required offer membership credential details.
# src\issue-credential\controller\controller.ts -> NATS call for topic 'ATTESTATION_MANAGER_SERVICE/offerMemberShipCredentials'
When passed all valid offer membership credential details.
Then credential offer should be sent to the given connection.
And I should get the HTTP status code 201 Created and the created membership credential offer Details.
\ No newline at end of file
As an OCM user
I want to update schema_id in credentialType of given type
Feature: Update schema_id by type
update schema_id in credentialType for given type
Scenario: Provide valid and required schema_id and type
Given I have passed all required details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> updateSchemaIdByType/
When passed valid schema_id and type.
Then credentialType should be updated.
And I should get the HTTP status code 200 Ok and the updated credentialType Details.
\ No newline at end of file
As an OCM user
I want to save the credential details from Webhook emitted by AFJ Agent
Feature: Credentials Webhook
Credential Webhook Emitted by AFJ
Scenario: A new Credential is offered
Given AFJ Agent have passed created credential details.
# src\issue-credential\controller\controller.ts -> NATS call for topic 'ATTESTATION_MANAGER_SERVICE/CredentialStateChanged'
When passed credential state is OFFER_SENT.
Then credential should be created in DB.
And I should get the HTTP status code 201 Created and the created credential Details.
Scenario: A Credential's state is changed
Given AFJ have passed the updated credential details.
# src\issue-credential\controller\controller.ts -> NATS call for topic 'ATTESTATION_MANAGER_SERVICE/CredentialStateChanged'
When passed credential state is not OFFER_SENT.
Then credential state should be updated in DB.
And I should get the HTTP status code 202 Accepted and the updated credential Details.
As an OCM user
I want to create a new Schema
Feature: Create a new Schema
Create a new Schema on Ledger and save details in DB
Scenario: Provide valid and required Schema Details
Given I have passed all required schema details.
# src\schemas\controller\controller.ts -> REST API with POST method -> schemas/
When passed all valid schema details.
Then schema should be created on the Ledger with the given details.
And should return the newly created Schema_ID.
And store the details in DB.
And I should get the HTTP status code 201 Created and the created Schema Details.
Scenario: Provide invalid name, created_by, version or attributes
Given I have passed name, created_by, version and attributes.
# src\schemas\controller\controller.ts -> REST API with POST method -> schemas/
When passed invalid name, created_by, version or attributes.
Then I should get the HTTP status code 400 Bad Request.
Scenario: Provide name and version of the existing Schema.
Given I have passed all required schema details.
# src\schemas\controller\controller.ts -> REST API with POST method -> schemas/
When passed name and version of the existing Schema.
Then I should get the HTTP status code 409 Conflict.
\ No newline at end of file
As an OCM user
I want to get the Schema by id
Feature: Get Schema by Id
Get Schema by the given schema id
Scenario: Provide valid schema id.
Given I have passed the required schema id.
# src\schemas\controller\controller.ts -> REST API with GET method -> schemas/:id
When passed schema id is valid.
Then I should get the HTTP status code 200 Ok and Schema from the DB.
Scenario: Provide invalid schema id.
Given I have passed the required schema id.
# src\schemas\controller\controller.ts -> REST API with GET method -> schemas/:id
When passed schema id is invalid.
Then I should get the HTTP status code 404 Not Found.
As an OCM user
I want to get list of all the Schemas
Feature: Get All Schemas
Get All Schemas from the DB
Scenario: Provide valid page and page size.
Given I have passed the required page and page size.
# src\schemas\controller\controller.ts -> REST API with GET method -> schemas/
When passed details are valid.
Then I should get the HTTP status code 200 Ok and list of Schemas from the DB.
\ No newline at end of file
As an OCM user
I want to get all principal DIDs for a given schema id
Feature: Get all DIDs for Schema
Get all principal DIDs for a given schema id
Scenario: Provide valid schema id.
Given I have passed the required schema id.
# src\schemas\controller\controller.ts -> REST API with GET method -> get-dids-for-schema/:id
When passed schema id is valid.
Then I should get the HTTP status code 200 Ok and Schema DIDs from the DB.
Scenario: Provide invalid schema id.
Given I have passed the required schema id.
# src\schemas\controller\controller.ts -> REST API with GET method -> get-dids-for-schema/:id
When passed schema id is invalid.
Then I should get the HTTP status code 404 Not Found.
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -236,6 +236,14 @@ public class JsonUtils {
return System.getProperty("baseUrl") + "/policy";
}
/**
* Get the url for "OCM"
* @return the uri
*/
public static String getOCM() {
return System.getProperty("baseUrl") + "/ocm";
}
/**
* UTF8 encodes a string
*
......
......@@ -113,10 +113,10 @@ public class RestClient {
.log().all()
.get(request.getVersion() + request.getPath())
.then()
.log().all()
.log().all()
.extract();
Response resp = new Response(response.statusCode(), response.body().asString(), response.headers());
logger.info("Received response {}", resp);
logger.info("Received response {}", response);
return resp;
}
......
......@@ -14,7 +14,6 @@ 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/>.
*/
package utils;
import java.io.ByteArrayOutputStream;
......
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"code": {
"type": "string"
},
"data": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"Status": {
"type": "string"
},
"TransactionID": {
"type": "string"
},
"BatchID": {
"type": "string"
}
},
"required": [
"Status",
"TransactionID",
"BatchID"
]
},
{
"type": "object",
"properties": {
"Status": {
"type": "string"
},
"TransactionID": {
"type": "string"
},
"BatchID": {
"type": "string"
}
},
"required": [
"Status",
"TransactionID",
"BatchID"
]
}
]
}
},
"required": [
"status",
"code",
"data"
]
}
\ No newline at end of file
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