Added issuer with compact iri test

This commit is contained in:
Xavi Aracil 2022-12-12 11:10:38 +01:00
parent d852003526
commit 6eb8b66560
3 changed files with 27 additions and 6 deletions

View File

@ -59,12 +59,11 @@ public class OB20Tests {
@Test @Test
void testSimpleBadgeClassJsonValid() { void testSimpleBadgeClassJsonValid() {
// TODO: commented out due to lack of prerequisite tasks yet assertDoesNotThrow(()->{
// assertDoesNotThrow(()->{ Report report = validator.run(Samples.OB20.JSON.SIMPLE_BADGECLASS.asFileResource());
// Report report = validator.run(Samples.OB20.JSON.SIMPLE_BADGECLASS.asFileResource()); if(verbose) PrintHelper.print(report, true);
// if(verbose) PrintHelper.print(report, true); assertValid(report);
// assertValid(report); });
// });
} }
@Test @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 @Nested
static class WarningTests { static class WarningTests {
@BeforeAll @BeforeAll

View File

@ -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); 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 // original: test_validation: test_can_input_badgeclass
public final static Sample SIMPLE_BADGECLASS = new Sample("ob20/assets/badgeclass1.json", true); 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 // original: validate_language: validate_language_prop_basic
public final static Sample SIMPLE_LANGUAGE_BADGECLASS = new Sample("ob20/badge-class-with-language.json", true); public final static Sample SIMPLE_LANGUAGE_BADGECLASS = new Sample("ob20/badge-class-with-language.json", true);
} }

View File

@ -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"
}
}