Skip to content

Commit

Permalink
test(prism-agent): fix schema-related unit-tests
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Voiturier <[email protected]>
  • Loading branch information
bvoiturier committed Jan 12, 2024
1 parent fb1592d commit 29d166b
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 189 deletions.
Original file line number Diff line number Diff line change
@@ -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"
}
34 changes: 9 additions & 25 deletions pollux/lib/core/src/test/resources/anoncred-schema-example.json
Original file line number Diff line number Diff line change
@@ -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"
}
98 changes: 41 additions & 57 deletions pollux/lib/core/src/test/resources/vc-schema-example.json
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 29d166b

Please sign in to comment.