From 29d166b10eb9e0ea5ec58bed9cf80bbfdedc5820 Mon Sep 17 00:00:00 2001 From: Benjamin Voiturier Date: Fri, 12 Jan 2024 17:03:31 +0100 Subject: [PATCH] test(prism-agent): fix schema-related unit-tests Signed-off-by: Benjamin Voiturier --- .../anoncred-presentation-schema-example.json | 32 ++---- .../resources/anoncred-schema-example.json | 34 ++----- .../src/test/resources/vc-schema-example.json | 98 ++++++++----------- .../resources/anoncred-schema-example.json | 36 ++----- .../src/test/resources/vc-schema-example.json | 98 ++++++++----------- 5 files changed, 109 insertions(+), 189 deletions(-) diff --git a/pollux/lib/core/src/test/resources/anoncred-presentation-schema-example.json b/pollux/lib/core/src/test/resources/anoncred-presentation-schema-example.json index 14b1ffcfbe..febd78d65d 100644 --- a/pollux/lib/core/src/test/resources/anoncred-presentation-schema-example.json +++ b/pollux/lib/core/src/test/resources/anoncred-presentation-schema-example.json @@ -1,26 +1,10 @@ { - "guid": "1631026d-5d55-3285-8ccd-bd70480cfbdc", - "id": "329da384-b2bb-497f-a605-4118dec75d31", - "longId": "did:prism:4a5b5cf0a513e83b598bbea25cd6196746747f361a73ef77068268bc9bd732ff/329da384-b2bb-497f-a605-4118dec75d31?version=5.0.0", - "name": "DrivingLicense", - "version": "5.0.0", - "tags": [ - "string" + "name": "resource:///anoncred-presentation-schema-example.json", + "version": "1.0", + "attrNames": [ + "name", + "sex", + "age" ], - "description": "Simple credential schema for the driving licence verifiable credential.", - "type": "AnoncredSchemaV1", - "schema": { - "name": "resource:///anoncred-presentation-schema-example.json", - "version": "1.0", - "attrNames": [ - "name", - "sex", - "age" - ], - "issuerId": "did:prism:issuer" - }, - "author": "did:prism:4a5b5cf0a513e83b598bbea25cd6196746747f361a73ef77068268bc9bd732ff", - "authored": "2023-04-06T08:48:01.654162Z", - "kind": "CredentialSchema", - "self": "/schema-registry/schemas/1631026d-5d55-3285-8ccd-bd70480cfbdc" -} + "issuerId": "did:prism:issuer" +} \ No newline at end of file diff --git a/pollux/lib/core/src/test/resources/anoncred-schema-example.json b/pollux/lib/core/src/test/resources/anoncred-schema-example.json index bc6bea286d..8507b68529 100644 --- a/pollux/lib/core/src/test/resources/anoncred-schema-example.json +++ b/pollux/lib/core/src/test/resources/anoncred-schema-example.json @@ -1,28 +1,12 @@ { - "guid": "1631026d-5d55-3285-8ccd-bd70480cfbdc", - "id": "329da384-b2bb-497f-a605-4118dec75d31", - "longId": "did:prism:4a5b5cf0a513e83b598bbea25cd6196746747f361a73ef77068268bc9bd732ff/329da384-b2bb-497f-a605-4118dec75d31?version=5.0.0", - "name": "DrivingLicense", - "version": "5.0.0", - "tags": [ - "string" + "name": "Driving licence Anoncred Schema", + "version": "1.0", + "attrNames": [ + "emailAddress", + "familyName", + "dateOfIssuance", + "drivingLicenseID", + "drivingClass" ], - "description": "Simple credential schema for the driving licence verifiable credential.", - "type": "AnoncredSchemaV1", - "schema": { - "name": "Driving licence Anoncred Schema", - "version": "1.0", - "attrNames": [ - "emailAddress", - "familyName", - "dateOfIssuance", - "drivingLicenseID", - "drivingClass" - ], - "issuerId": "http://www.example.com/issuer" - }, - "author": "did:prism:4a5b5cf0a513e83b598bbea25cd6196746747f361a73ef77068268bc9bd732ff", - "authored": "2023-04-06T08:48:01.654162Z", - "kind": "CredentialSchema", - "self": "/schema-registry/schemas/1631026d-5d55-3285-8ccd-bd70480cfbdc" + "issuerId": "http://www.example.com/issuer" } diff --git a/pollux/lib/core/src/test/resources/vc-schema-example.json b/pollux/lib/core/src/test/resources/vc-schema-example.json index 9b0e106826..cc2b777de8 100644 --- a/pollux/lib/core/src/test/resources/vc-schema-example.json +++ b/pollux/lib/core/src/test/resources/vc-schema-example.json @@ -1,60 +1,44 @@ { - "guid": "1631026d-5d55-3285-8ccd-bd70480cfbdc", - "id": "329da384-b2bb-497f-a605-4118dec75d31", - "longId": "did:prism:4a5b5cf0a513e83b598bbea25cd6196746747f361a73ef77068268bc9bd732ff/329da384-b2bb-497f-a605-4118dec75d31?version=5.0.0", - "name": "DrivingLicense", - "version": "5.0.0", - "tags": [ - "string" - ], - "description": "Simple credential schema for the driving licence verifiable credential.", - "type": "https://w3c-ccg.github.io/vc-json-schemas/schema/2.0/schema.json", - "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Driving License", - "type": "object", - "properties": { - "credentialSubject": { - "type": "object", - "properties": { - "emailAddress": { - "type": "string", - "format": "email" - }, - "givenName": { - "type": "string" - }, - "familyName": { - "type": "string" - }, - "dateOfIssuance": { - "type": "string", - "format": "date-time" - }, - "drivingLicenseID": { - "type": "string" - }, - "drivingClass": { - "type": "integer" - } + "$schema": "https://json-schema.org/draft/2020-12/schema", + "description": "Driving License", + "type": "object", + "properties": { + "credentialSubject": { + "type": "object", + "properties": { + "emailAddress": { + "type": "string", + "format": "email" + }, + "givenName": { + "type": "string" + }, + "familyName": { + "type": "string" }, - "required": [ - "emailAddress", - "familyName", - "dateOfIssuance", - "drivingLicenseID", - "drivingClass" - ], - "additionalProperties": false - } - }, - "required": [ - "credentialSubject" - ], - "additionalProperties": false + "dateOfIssuance": { + "type": "string", + "format": "date-time" + }, + "drivingLicenseID": { + "type": "string" + }, + "drivingClass": { + "type": "integer" + } + }, + "required": [ + "emailAddress", + "familyName", + "dateOfIssuance", + "drivingLicenseID", + "drivingClass" + ], + "additionalProperties": false + } }, - "author": "did:prism:4a5b5cf0a513e83b598bbea25cd6196746747f361a73ef77068268bc9bd732ff", - "authored": "2023-04-06T08:48:01.654162Z", - "kind": "CredentialSchema", - "self": "/schema-registry/schemas/1631026d-5d55-3285-8ccd-bd70480cfbdc" -} + "required": [ + "credentialSubject" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/prism-agent/service/server/src/test/resources/anoncred-schema-example.json b/prism-agent/service/server/src/test/resources/anoncred-schema-example.json index bc6bea286d..dab13b547a 100644 --- a/prism-agent/service/server/src/test/resources/anoncred-schema-example.json +++ b/prism-agent/service/server/src/test/resources/anoncred-schema-example.json @@ -1,28 +1,12 @@ { - "guid": "1631026d-5d55-3285-8ccd-bd70480cfbdc", - "id": "329da384-b2bb-497f-a605-4118dec75d31", - "longId": "did:prism:4a5b5cf0a513e83b598bbea25cd6196746747f361a73ef77068268bc9bd732ff/329da384-b2bb-497f-a605-4118dec75d31?version=5.0.0", - "name": "DrivingLicense", - "version": "5.0.0", - "tags": [ - "string" + "name": "Driving licence Anoncred Schema", + "version": "1.0", + "attrNames": [ + "emailAddress", + "familyName", + "dateOfIssuance", + "drivingLicenseID", + "drivingClass" ], - "description": "Simple credential schema for the driving licence verifiable credential.", - "type": "AnoncredSchemaV1", - "schema": { - "name": "Driving licence Anoncred Schema", - "version": "1.0", - "attrNames": [ - "emailAddress", - "familyName", - "dateOfIssuance", - "drivingLicenseID", - "drivingClass" - ], - "issuerId": "http://www.example.com/issuer" - }, - "author": "did:prism:4a5b5cf0a513e83b598bbea25cd6196746747f361a73ef77068268bc9bd732ff", - "authored": "2023-04-06T08:48:01.654162Z", - "kind": "CredentialSchema", - "self": "/schema-registry/schemas/1631026d-5d55-3285-8ccd-bd70480cfbdc" -} + "issuerId": "http://www.example.com/issuer" +} \ No newline at end of file diff --git a/prism-agent/service/server/src/test/resources/vc-schema-example.json b/prism-agent/service/server/src/test/resources/vc-schema-example.json index 9b0e106826..cc2b777de8 100644 --- a/prism-agent/service/server/src/test/resources/vc-schema-example.json +++ b/prism-agent/service/server/src/test/resources/vc-schema-example.json @@ -1,60 +1,44 @@ { - "guid": "1631026d-5d55-3285-8ccd-bd70480cfbdc", - "id": "329da384-b2bb-497f-a605-4118dec75d31", - "longId": "did:prism:4a5b5cf0a513e83b598bbea25cd6196746747f361a73ef77068268bc9bd732ff/329da384-b2bb-497f-a605-4118dec75d31?version=5.0.0", - "name": "DrivingLicense", - "version": "5.0.0", - "tags": [ - "string" - ], - "description": "Simple credential schema for the driving licence verifiable credential.", - "type": "https://w3c-ccg.github.io/vc-json-schemas/schema/2.0/schema.json", - "schema": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Driving License", - "type": "object", - "properties": { - "credentialSubject": { - "type": "object", - "properties": { - "emailAddress": { - "type": "string", - "format": "email" - }, - "givenName": { - "type": "string" - }, - "familyName": { - "type": "string" - }, - "dateOfIssuance": { - "type": "string", - "format": "date-time" - }, - "drivingLicenseID": { - "type": "string" - }, - "drivingClass": { - "type": "integer" - } + "$schema": "https://json-schema.org/draft/2020-12/schema", + "description": "Driving License", + "type": "object", + "properties": { + "credentialSubject": { + "type": "object", + "properties": { + "emailAddress": { + "type": "string", + "format": "email" + }, + "givenName": { + "type": "string" + }, + "familyName": { + "type": "string" }, - "required": [ - "emailAddress", - "familyName", - "dateOfIssuance", - "drivingLicenseID", - "drivingClass" - ], - "additionalProperties": false - } - }, - "required": [ - "credentialSubject" - ], - "additionalProperties": false + "dateOfIssuance": { + "type": "string", + "format": "date-time" + }, + "drivingLicenseID": { + "type": "string" + }, + "drivingClass": { + "type": "integer" + } + }, + "required": [ + "emailAddress", + "familyName", + "dateOfIssuance", + "drivingLicenseID", + "drivingClass" + ], + "additionalProperties": false + } }, - "author": "did:prism:4a5b5cf0a513e83b598bbea25cd6196746747f361a73ef77068268bc9bd732ff", - "authored": "2023-04-06T08:48:01.654162Z", - "kind": "CredentialSchema", - "self": "/schema-registry/schemas/1631026d-5d55-3285-8ccd-bd70480cfbdc" -} + "required": [ + "credentialSubject" + ], + "additionalProperties": false +} \ No newline at end of file