diff --git a/inspector-vc/src/test/java/org/oneedtech/inspect/vc/OB20Tests.java b/inspector-vc/src/test/java/org/oneedtech/inspect/vc/OB20Tests.java index 8f6d59e..e95e668 100644 --- a/inspector-vc/src/test/java/org/oneedtech/inspect/vc/OB20Tests.java +++ b/inspector-vc/src/test/java/org/oneedtech/inspect/vc/OB20Tests.java @@ -59,12 +59,11 @@ public class OB20Tests { @Test void testSimpleBadgeClassJsonValid() { - // TODO: commented out due to lack of prerequisite tasks yet - // assertDoesNotThrow(()->{ - // Report report = validator.run(Samples.OB20.JSON.SIMPLE_BADGECLASS.asFileResource()); - // if(verbose) PrintHelper.print(report, true); - // assertValid(report); - // }); + assertDoesNotThrow(()->{ + Report report = validator.run(Samples.OB20.JSON.SIMPLE_BADGECLASS.asFileResource()); + if(verbose) PrintHelper.print(report, true); + assertValid(report); + }); } @Test @@ -118,6 +117,15 @@ public class OB20Tests { }); } + @Test + void testCompactIriInIssuer() { + assertDoesNotThrow(()->{ + Report report = validator.run(Samples.OB20.JSON.ISSUER_COMPACTIRI_VALIDATION.asFileResource()); + if(verbose) PrintHelper.print(report, true); + assertValid(report); + }); + } + @Nested static class WarningTests { @BeforeAll diff --git a/inspector-vc/src/test/java/org/oneedtech/inspect/vc/Samples.java b/inspector-vc/src/test/java/org/oneedtech/inspect/vc/Samples.java index e7ee0e6..09ac1e7 100644 --- a/inspector-vc/src/test/java/org/oneedtech/inspect/vc/Samples.java +++ b/inspector-vc/src/test/java/org/oneedtech/inspect/vc/Samples.java @@ -55,6 +55,8 @@ public class Samples { public final static Sample WARNING_ISSUER_NON_HTTPS_JSON = new Sample("ob20/warning-issuer-non-http.json", true); // original: test_validation: test_can_input_badgeclass public final static Sample SIMPLE_BADGECLASS = new Sample("ob20/assets/badgeclass1.json", true); + // original: test_validation: test_validate_compacted_iri_value + public final static Sample ISSUER_COMPACTIRI_VALIDATION = new Sample("ob20/issuer-compact-iri-validation.json", true); // original: validate_language: validate_language_prop_basic public final static Sample SIMPLE_LANGUAGE_BADGECLASS = new Sample("ob20/badge-class-with-language.json", true); } diff --git a/inspector-vc/src/test/resources/ob20/issuer-compact-iri-validation.json b/inspector-vc/src/test/resources/ob20/issuer-compact-iri-validation.json new file mode 100644 index 0000000..23f62cd --- /dev/null +++ b/inspector-vc/src/test/resources/ob20/issuer-compact-iri-validation.json @@ -0,0 +1,11 @@ +{ + "@context": "https://w3id.org/openbadges/v2", + "type": "Issuer", + "id": "https://example.org/organization.json", + "url": "https://example.org", + "name": "An Example Badge Issuer", + "email": "contact@example.org", + "verification": { + "verificationProperty": "id" + } +} \ No newline at end of file