diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01a627cc..3a56d1cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,6 +86,15 @@ jobs: use_oidc: true files: '*.profraw' + assert_full_test_suite: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Run Test Suite + run: tests/unit_test_cases.sh + build_aarch64_apple_darwin: runs-on: macos-latest name: Build aarch64-apple-darwin target diff --git a/bound/kt/src/test/kotlin/web5/sdk/TestHelper.kt b/bound/kt/src/test/kotlin/web5/sdk/TestHelper.kt deleted file mode 100644 index 4b82f1c2..00000000 --- a/bound/kt/src/test/kotlin/web5/sdk/TestHelper.kt +++ /dev/null @@ -1,22 +0,0 @@ -package web5.sdk - -import java.nio.file.Files -import java.nio.file.Paths - -class UnitTestSuite(name: String) { - val tests: MutableList - - init { - val path = Paths.get("../../tests/unit_test_cases/$name.json") - val jsonString = Files.readString(path) - this.tests = Json.jsonMapper.readValue(jsonString, List::class.java) as MutableList - } - - fun include() { - val testMethodName = Thread.currentThread().stackTrace - .firstOrNull { it.methodName.startsWith("test") }?.methodName - ?: throw IllegalStateException("Unable to determine test method name") - - this.tests.remove(testMethodName) - } -} \ No newline at end of file diff --git a/bound/kt/src/test/kotlin/web5/sdk/crypto/Ed25519GeneratorTest.kt b/bound/kt/src/test/kotlin/web5/sdk/crypto/Ed25519GeneratorTest.kt index 2411b3da..15931581 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/crypto/Ed25519GeneratorTest.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/crypto/Ed25519GeneratorTest.kt @@ -3,25 +3,12 @@ package web5.sdk.crypto import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite @TestInstance(TestInstance.Lifecycle.PER_CLASS) class Ed25519GeneratorTest { - private val testSuite = UnitTestSuite("ed25519_generate") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_must_set_alg() { - testSuite.include() val jwk = Ed25519Generator.generate() assertEquals("Ed25519", jwk.alg) @@ -29,7 +16,6 @@ class Ed25519GeneratorTest { @Test fun test_must_set_kty() { - testSuite.include() val jwk = Ed25519Generator.generate() assertEquals("OKP", jwk.kty) @@ -37,7 +23,6 @@ class Ed25519GeneratorTest { @Test fun test_must_set_crv() { - testSuite.include() val jwk = Ed25519Generator.generate() assertEquals("Ed25519", jwk.crv) @@ -45,7 +30,6 @@ class Ed25519GeneratorTest { @Test fun test_must_set_public_key_with_correct_length() { - testSuite.include() val jwk = Ed25519Generator.generate() val publicKeyBytes = java.util.Base64.getUrlDecoder().decode(jwk.x) @@ -54,7 +38,6 @@ class Ed25519GeneratorTest { @Test fun test_must_set_private_key_with_correct_length() { - testSuite.include() val jwk = Ed25519Generator.generate() val privateKeyBytes = jwk.d ?: fail("Private key is missing") diff --git a/bound/kt/src/test/kotlin/web5/sdk/crypto/Secp256k1GeneratorTest.kt b/bound/kt/src/test/kotlin/web5/sdk/crypto/Secp256k1GeneratorTest.kt index 8ceeeb8b..46adf83e 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/crypto/Secp256k1GeneratorTest.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/crypto/Secp256k1GeneratorTest.kt @@ -4,50 +4,30 @@ import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail import java.util.Base64 -import web5.sdk.UnitTestSuite @TestInstance(TestInstance.Lifecycle.PER_CLASS) class Secp256k1GeneratorTest { - private val testSuite = UnitTestSuite("secp256k1_generate") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_must_set_alg() { - testSuite.include() - val jwk = Secp256k1Generator.generate() assertEquals("ES256K", jwk.alg) } @Test fun test_must_set_kty() { - testSuite.include() - val jwk = Secp256k1Generator.generate() assertEquals("EC", jwk.kty) } @Test fun test_must_set_crv() { - testSuite.include() - val jwk = Secp256k1Generator.generate() assertEquals("secp256k1", jwk.crv) } @Test fun test_must_set_public_key_with_correct_length() { - testSuite.include() - val jwk = Secp256k1Generator.generate() val xBytes = Base64.getUrlDecoder().decode(jwk.x) val yBytes = jwk.y?.let { Base64.getUrlDecoder().decode(it) } ?: fail("y coordinate is missing") @@ -57,8 +37,6 @@ class Secp256k1GeneratorTest { @Test fun test_must_set_private_key_with_correct_length() { - testSuite.include() - val jwk = Secp256k1Generator.generate() val privateKeyBytes = jwk.d ?: fail("Private key is missing") val decodedPrivateKeyBytes = Base64.getUrlDecoder().decode(privateKeyBytes) diff --git a/bound/kt/src/test/kotlin/web5/sdk/crypto/keys/InMemoryKeyManagerTest.kt b/bound/kt/src/test/kotlin/web5/sdk/crypto/keys/InMemoryKeyManagerTest.kt index 922bfcfa..0cd37b96 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/crypto/keys/InMemoryKeyManagerTest.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/crypto/keys/InMemoryKeyManagerTest.kt @@ -3,7 +3,6 @@ package web5.sdk.crypto.keys import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.crypto.Ed25519Generator import web5.sdk.Web5Exception @@ -11,20 +10,9 @@ class InMemoryKeyManagerTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class ImportPrivateJwk { - private val testSuite = UnitTestSuite("in_memory_key_manager_import_private_jwk") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } @Test fun test_must_be_private_jwk() { - testSuite.include() val keyManager = InMemoryKeyManager(listOf()) val privateJwk = Ed25519Generator.generate() @@ -40,7 +28,6 @@ class InMemoryKeyManagerTest { @Test fun test_successfully_imports_and_returns_public_jwk() { - testSuite.include() val keyManager = InMemoryKeyManager(listOf()) val privateJwk = Ed25519Generator.generate() @@ -54,20 +41,8 @@ class InMemoryKeyManagerTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class GetSigner { - private val testSuite = UnitTestSuite("in_memory_key_manager_get_signer") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_must_be_public_key() { - testSuite.include() val privateJwk = Ed25519Generator.generate() val keyManager = InMemoryKeyManager(listOf(privateJwk)) @@ -82,7 +57,6 @@ class InMemoryKeyManagerTest { @Test fun test_not_found() { - testSuite.include() val keyManager = InMemoryKeyManager(listOf()) val privateJwk = Ed25519Generator.generate() @@ -98,7 +72,6 @@ class InMemoryKeyManagerTest { @Test fun test_found() { - testSuite.include() val privateJwk = Ed25519Generator.generate() val publicJwk = privateJwk.copy(d = null) @@ -113,20 +86,9 @@ class InMemoryKeyManagerTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class ExportPrivateJwks { - private val testSuite = UnitTestSuite("in_memory_key_manager_export_private_jwks") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } @Test fun test_export_empty_list() { - testSuite.include() val keyManager = InMemoryKeyManager(listOf()) val privateJwks = keyManager.exportPrivateJwks() @@ -136,7 +98,6 @@ class InMemoryKeyManagerTest { @Test fun test_export_single_key() { - testSuite.include() val privateJwk = Ed25519Generator.generate() val keyManager = InMemoryKeyManager(listOf(privateJwk)) @@ -148,7 +109,6 @@ class InMemoryKeyManagerTest { @Test fun test_export_multiple_keys() { - testSuite.include() val privateJwk1 = Ed25519Generator.generate() val privateJwk2 = Ed25519Generator.generate() diff --git a/bound/kt/src/test/kotlin/web5/sdk/crypto/keys/JwkTest.kt b/bound/kt/src/test/kotlin/web5/sdk/crypto/keys/JwkTest.kt index 936ffadc..dc4518ec 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/crypto/keys/JwkTest.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/crypto/keys/JwkTest.kt @@ -3,26 +3,13 @@ package web5.sdk.crypto.keys import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.Web5Exception @TestInstance(TestInstance.Lifecycle.PER_CLASS) class JwkTest { - private val testSuite = UnitTestSuite("jwk_compute_thumbprint") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_ec_valid() { - testSuite.include() val jwk = Jwk( kty = "EC", crv = "secp256k1", @@ -36,7 +23,6 @@ class JwkTest { @Test fun test_okp_valid() { - testSuite.include() val jwk = Jwk( kty = "OKP", crv = "Ed25519", @@ -49,7 +35,6 @@ class JwkTest { @Test fun test_unsupported_kty() { - testSuite.include() val jwk = Jwk( kty = "RSA", crv = "RS256", @@ -66,7 +51,6 @@ class JwkTest { @Test fun test_empty_kty() { - testSuite.include() val jwk = Jwk( kty = "", crv = "Ed25519", @@ -82,7 +66,6 @@ class JwkTest { @Test fun test_empty_x() { - testSuite.include() val jwk = Jwk( kty = "OKP", crv = "Ed25519", @@ -98,7 +81,6 @@ class JwkTest { @Test fun test_empty_crv() { - testSuite.include() val jwk = Jwk( kty = "EC", crv = "", @@ -115,7 +97,6 @@ class JwkTest { @Test fun test_ec_missing_y() { - testSuite.include() val jwk = Jwk( kty = "EC", crv = "P-256", @@ -131,7 +112,6 @@ class JwkTest { @Test fun test_ec_empty_y() { - testSuite.include() val jwk = Jwk( kty = "EC", crv = "P-256", diff --git a/bound/kt/src/test/kotlin/web5/sdk/crypto/signers/Ed25519SignerTest.kt b/bound/kt/src/test/kotlin/web5/sdk/crypto/signers/Ed25519SignerTest.kt index 67011082..80c5025a 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/crypto/signers/Ed25519SignerTest.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/crypto/signers/Ed25519SignerTest.kt @@ -3,27 +3,14 @@ package web5.sdk.crypto.signers import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.crypto.Ed25519Generator import web5.sdk.Web5Exception @TestInstance(TestInstance.Lifecycle.PER_CLASS) class Ed25519SignerTest { - private val testSuite = UnitTestSuite("ed25519_sign") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_with_valid_key() { - testSuite.include() val jwk = Ed25519Generator.generate() val signer = Ed25519Signer(jwk) @@ -38,7 +25,6 @@ class Ed25519SignerTest { @Test fun test_with_invalid_private_key() { - testSuite.include() val jwk = Ed25519Generator.generate() val invalidJwk = jwk.copy(d = java.util.Base64.getUrlEncoder().withoutPadding().encodeToString(ByteArray(SECRET_KEY_LENGTH - 1))) @@ -55,7 +41,6 @@ class Ed25519SignerTest { @Test fun test_with_missing_private_key() { - testSuite.include() val jwk = Ed25519Generator.generate() val missingKeyJwk = jwk.copy(d = null) diff --git a/bound/kt/src/test/kotlin/web5/sdk/crypto/signers/Secp256k1SignerTest.kt b/bound/kt/src/test/kotlin/web5/sdk/crypto/signers/Secp256k1SignerTest.kt index a0d2e0f3..95724d10 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/crypto/signers/Secp256k1SignerTest.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/crypto/signers/Secp256k1SignerTest.kt @@ -3,28 +3,15 @@ package web5.sdk.crypto.signers import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.crypto.Secp256k1Generator import web5.sdk.Web5Exception import java.util.Base64 @TestInstance(TestInstance.Lifecycle.PER_CLASS) class Secp256k1SignerTest { - private val testSuite = UnitTestSuite("secp256k1_sign") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } @Test fun test_with_valid_key() { - testSuite.include() - val jwk = Secp256k1Generator.generate() val signer = Secp256k1Signer(jwk) @@ -38,8 +25,6 @@ class Secp256k1SignerTest { @Test fun test_with_invalid_private_key() { - testSuite.include() - val jwk = Secp256k1Generator.generate() val invalidJwk = jwk.copy(d = Base64.getUrlEncoder().withoutPadding().encodeToString(ByteArray(SECRET_KEY_LENGTH - 1))) @@ -55,8 +40,6 @@ class Secp256k1SignerTest { @Test fun test_with_missing_private_key() { - testSuite.include() - val jwk = Secp256k1Generator.generate() val missingKeyJwk = jwk.copy(d = null) diff --git a/bound/kt/src/test/kotlin/web5/sdk/crypto/verifiers/Ed25519VerifierTest.kt b/bound/kt/src/test/kotlin/web5/sdk/crypto/verifiers/Ed25519VerifierTest.kt index 8e27702e..fe0ce8d5 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/crypto/verifiers/Ed25519VerifierTest.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/crypto/verifiers/Ed25519VerifierTest.kt @@ -3,7 +3,6 @@ package web5.sdk.crypto.verifiers import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.crypto.Ed25519Generator import web5.sdk.crypto.keys.Jwk import web5.sdk.crypto.signers.Ed25519Signer @@ -12,17 +11,6 @@ import web5.sdk.Web5Exception @TestInstance(TestInstance.Lifecycle.PER_CLASS) class Ed25519VerifierTest { - private val testSuite = UnitTestSuite("ed25519_verify") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - private fun generateKeys(): Pair { val privateJwk = Ed25519Generator.generate() val publicJwk = privateJwk.copy(d = null) @@ -31,7 +19,6 @@ class Ed25519VerifierTest { @Test fun test_with_valid_signature() { - testSuite.include() val (publicJwk, privateJwk) = generateKeys() val signer = Ed25519Signer(privateJwk) @@ -47,7 +34,6 @@ class Ed25519VerifierTest { @Test fun test_with_private_key() { - testSuite.include() val (_, privateJwk) = generateKeys() val verifier = Ed25519Verifier(privateJwk) // this is not allowed @@ -65,7 +51,6 @@ class Ed25519VerifierTest { @Test fun test_with_invalid_signature() { - testSuite.include() val (publicJwk, _) = generateKeys() val verifier = Ed25519Verifier(publicJwk) @@ -83,7 +68,6 @@ class Ed25519VerifierTest { @Test fun test_with_invalid_public_key() { - testSuite.include() val (publicJwk, privateJwk) = generateKeys() val invalidPublicJwk = publicJwk.copy(x = java.util.Base64.getUrlEncoder().withoutPadding().encodeToString(ByteArray(PUBLIC_KEY_LENGTH - 1))) @@ -104,7 +88,6 @@ class Ed25519VerifierTest { @Test fun test_with_invalid_signature_length() { - testSuite.include() val (publicJwk, _) = generateKeys() val verifier = Ed25519Verifier(publicJwk) diff --git a/bound/kt/src/test/kotlin/web5/sdk/crypto/verifiers/Secp256k1Verifier.kt b/bound/kt/src/test/kotlin/web5/sdk/crypto/verifiers/Secp256k1Verifier.kt index e91b4169..7b68d471 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/crypto/verifiers/Secp256k1Verifier.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/crypto/verifiers/Secp256k1Verifier.kt @@ -3,7 +3,6 @@ package web5.sdk.crypto.verifiers import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.crypto.Secp256k1Generator import web5.sdk.crypto.keys.Jwk import web5.sdk.crypto.signers.Secp256k1Signer @@ -12,16 +11,6 @@ import java.util.Base64 @TestInstance(TestInstance.Lifecycle.PER_CLASS) class Secp256k1VerifierTest { - private val testSuite = UnitTestSuite("secp256k1_verify") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } private fun generateKeys(): Pair { val privateJwk = Secp256k1Generator.generate() @@ -31,8 +20,6 @@ class Secp256k1VerifierTest { @Test fun test_with_valid_signature() { - testSuite.include() - val (publicJwk, privateJwk) = generateKeys() val signer = Secp256k1Signer(privateJwk) val verifier = Secp256k1Verifier(publicJwk) @@ -47,8 +34,6 @@ class Secp256k1VerifierTest { @Test fun test_with_private_key() { - testSuite.include() - val (_, privateJwk) = generateKeys() val verifier = Secp256k1Verifier(privateJwk) // this is not allowed @@ -65,8 +50,6 @@ class Secp256k1VerifierTest { @Test fun test_with_invalid_signature() { - testSuite.include() - val (publicJwk, privateJwk) = generateKeys() val signer = Secp256k1Signer(privateJwk) val verifier = Secp256k1Verifier(publicJwk) @@ -87,8 +70,6 @@ class Secp256k1VerifierTest { @Test fun test_with_invalid_public_key() { - testSuite.include() - val (publicJwk, privateJwk) = generateKeys() val invalidPublicJwk = publicJwk.copy( x = Base64.getUrlEncoder().withoutPadding().encodeToString(ByteArray(PUBLIC_KEY_LENGTH - 1)) @@ -110,8 +91,6 @@ class Secp256k1VerifierTest { @Test fun test_with_invalid_signature_length() { - testSuite.include() - val (publicJwk, _) = generateKeys() val verifier = Secp256k1Verifier(publicJwk) diff --git a/bound/kt/src/test/kotlin/web5/sdk/dids/BearerDidTest.kt b/bound/kt/src/test/kotlin/web5/sdk/dids/BearerDidTest.kt index bd5302ce..1bbcc3c2 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/dids/BearerDidTest.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/dids/BearerDidTest.kt @@ -2,8 +2,6 @@ package web5.sdk.dids import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* -import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.crypto.keys.InMemoryKeyManager import web5.sdk.dids.methods.jwk.DidJwk import web5.sdk.dids.methods.jwk.DidJwkCreateOptions @@ -13,20 +11,8 @@ class BearerDidTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class FromPortableDid { - private val testSuite = UnitTestSuite("bearer_did_from_portable_did") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_can_instantiate_successfully() { - testSuite.include() val portableDid = PortableDid.fromJsonString(""" {"uri":"did:web:tbd.website%3A9002:alice","document":{"id":"did:web:tbd.website%3A9002:alice","@context":["https://www.w3.org/ns/did/v1"],"verificationMethod":[{"id":"did:web:tbd.website%3A9002:alice#key-0","type":"JsonWebKey","controller":"did:web:tbd.website%3A9002:alice","publicKeyJwk":{"alg":"Ed25519","kty":"OKP","crv":"Ed25519","x":"NNoVSv_v34ombmylF572t9HYYDiJtMgfckRT1W0vW0g"}}]},"privateKeys":[{"alg":"Ed25519","kty":"OKP","crv":"Ed25519","d":"SwuWbL-Fm64OUFy6x3FBt3RiB79RcnZZrllGT24m4BA","x":"NNoVSv_v34ombmylF572t9HYYDiJtMgfckRT1W0vW0g"}]} @@ -41,20 +27,8 @@ class BearerDidTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class GetSigner { - private val testSuite = UnitTestSuite("bearer_did_get_signer") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_verification_method_id_empty() { - testSuite.include() val bearerDid = DidJwk.create() @@ -68,7 +42,6 @@ class BearerDidTest { @Test fun test_not_found_by_verification_method_id() { - testSuite.include() val bearerDid = DidJwk.create() @@ -82,7 +55,6 @@ class BearerDidTest { @Test fun test_found_by_verification_method_id() { - testSuite.include() val bearerDid = DidJwk.create() @@ -95,20 +67,8 @@ class BearerDidTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class ToPortableDid { - private val testSuite = UnitTestSuite("bearer_did_to_portable_did") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_can_export() { - testSuite.include() val inMemoryKeyManager = InMemoryKeyManager(listOf()) val bearerDid = DidJwk.create(DidJwkCreateOptions(keyManager = inMemoryKeyManager)) @@ -119,4 +79,4 @@ class BearerDidTest { } } } -} \ No newline at end of file +} diff --git a/bound/kt/src/test/kotlin/web5/sdk/dids/DidTest.kt b/bound/kt/src/test/kotlin/web5/sdk/dids/DidTest.kt index d2fc1e79..3d77ab27 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/dids/DidTest.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/dids/DidTest.kt @@ -3,26 +3,13 @@ package web5.sdk.dids import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.Web5Exception @TestInstance(TestInstance.Lifecycle.PER_CLASS) class DidTest { - private val testSuite = UnitTestSuite("did_parse") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_did_empty_string_should_error() { - testSuite.include() val uri = "" val exception = assertThrows { @@ -34,7 +21,6 @@ class DidTest { @Test fun test_did_incomplete_scheme_should_error() { - testSuite.include() val uri = "did:" val exception = assertThrows { @@ -46,7 +32,6 @@ class DidTest { @Test fun test_did_missing_id_part_should_error() { - testSuite.include() val uri = "did:uport" val exception = assertThrows { @@ -58,7 +43,6 @@ class DidTest { @Test fun test_did_missing_id_should_error() { - testSuite.include() val uri = "did:uport:" val exception = assertThrows { @@ -70,7 +54,6 @@ class DidTest { @Test fun test_did_invalid_characters_in_id_should_error() { - testSuite.include() val uri = "did:uport:1234_12313***" val exception = assertThrows { @@ -82,7 +65,6 @@ class DidTest { @Test fun test_did_invalid_bare_id_should_error() { - testSuite.include() val uri = "2nQtiQG6Cgm1GYTBaaKAgr76uY7iSexUkqX" val exception = assertThrows { @@ -94,7 +76,6 @@ class DidTest { @Test fun test_did_invalid_percent_encoding_should_error() { - testSuite.include() val uri = "did:method:%12%1" val exception = assertThrows { @@ -106,7 +87,6 @@ class DidTest { @Test fun test_did_invalid_percent_encoding_incomplete_should_error() { - testSuite.include() val uri = "did:method:%1233%Ay" val exception = assertThrows { @@ -118,7 +98,6 @@ class DidTest { @Test fun test_did_capitalized_method_should_error() { - testSuite.include() val uri = "did:CAP:id" val exception = assertThrows { @@ -130,7 +109,6 @@ class DidTest { @Test fun test_did_invalid_additional_id_should_error() { - testSuite.include() val uri = "did:method:id::anotherid%r9" val exception = assertThrows { @@ -142,7 +120,6 @@ class DidTest { @Test fun test_did_valid_did_no_params_path_query_fragment() { - testSuite.include() val uri = "did:example:123456789abcdefghi" val expected = Did( uri = uri, @@ -156,7 +133,6 @@ class DidTest { @Test fun test_did_valid_did_with_params() { - testSuite.include() val uri = "did:example:123456789abcdefghi;foo=bar;baz=qux" val expected = Did( uri = "did:example:123456789abcdefghi", @@ -171,7 +147,6 @@ class DidTest { @Test fun test_did_valid_did_with_query() { - testSuite.include() val uri = "did:example:123456789abcdefghi?foo=bar&baz=qux" val expected = Did( uri = "did:example:123456789abcdefghi", @@ -186,7 +161,6 @@ class DidTest { @Test fun test_did_valid_did_with_fragment() { - testSuite.include() val uri = "did:example:123456789abcdefghi#keys-1" val expected = Did( uri = "did:example:123456789abcdefghi", @@ -201,7 +175,6 @@ class DidTest { @Test fun test_did_valid_did_with_query_and_fragment() { - testSuite.include() val uri = "did:example:123456789abcdefghi?foo=bar&baz=qux#keys-1" val expected = Did( uri = "did:example:123456789abcdefghi", @@ -217,7 +190,6 @@ class DidTest { @Test fun test_did_valid_did_with_params_query_and_fragment() { - testSuite.include() val uri = "did:example:123456789abcdefghi;foo=bar;baz=qux?foo=bar&baz=qux#keys-1" val expected = Did( uri = "did:example:123456789abcdefghi", @@ -234,7 +206,6 @@ class DidTest { @Test fun test_did_valid_did_with_path() { - testSuite.include() val uri = "did:example:123456789abcdefghi/path/to/resource" val expected = Did( uri = "did:example:123456789abcdefghi", diff --git a/bound/kt/src/test/kotlin/web5/sdk/dids/ResolutionResultTests.kt b/bound/kt/src/test/kotlin/web5/sdk/dids/ResolutionResultTests.kt index 566bad28..3503a5ea 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/dids/ResolutionResultTests.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/dids/ResolutionResultTests.kt @@ -4,8 +4,6 @@ import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* -import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.dids.methods.jwk.DidJwk import web5.sdk.dids.methods.web.DidWeb @@ -13,20 +11,8 @@ class ResolutionResultTests { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class Resolve { - private val testSuite = UnitTestSuite("resolution_result_resolve") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_invalid_did() { - testSuite.include() val resolutionResult = ResolutionResult.resolve("something invalid") assertEquals(ResolutionMetadataError.INVALID_DID, resolutionResult.resolutionMetadata.error) @@ -34,7 +20,6 @@ class ResolutionResultTests { @Test fun test_did_jwk() { - testSuite.include() val bearerDid = DidJwk.create() @@ -45,7 +30,6 @@ class ResolutionResultTests { @Test fun test_did_web() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -72,10 +56,9 @@ class ResolutionResultTests { @Test fun test_method_not_supported() { - testSuite.include() val resolutionResult = ResolutionResult.resolve("did:example:123") assertEquals(ResolutionMetadataError.METHOD_NOT_SUPPORTED, resolutionResult.resolutionMetadata.error) } } -} \ No newline at end of file +} diff --git a/bound/kt/src/test/kotlin/web5/sdk/dids/methods/dht/DidDhtTests.kt b/bound/kt/src/test/kotlin/web5/sdk/dids/methods/dht/DidDhtTests.kt index d394aeba..5f69f21c 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/dids/methods/dht/DidDhtTests.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/dids/methods/dht/DidDhtTests.kt @@ -6,8 +6,6 @@ import okhttp3.mockwebserver.MockWebServer import okhttp3.mockwebserver.RecordedRequest import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* -import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.Web5Exception import web5.sdk.crypto.keys.InMemoryKeyManager import web5.sdk.crypto.keys.Jwk @@ -19,20 +17,8 @@ class DidDhtTests { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class Create { - private val testSuite = UnitTestSuite("did_dht_create") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_can_specify_key_manager() { - testSuite.include() val keyManager = InMemoryKeyManager(listOf()) val bearerDid = DidDht.create( @@ -50,7 +36,6 @@ class DidDhtTests { @Test fun test_can_specify_publish_and_gateway_url() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -81,7 +66,6 @@ class DidDhtTests { @Test fun test_should_add_optional_verification_methods() { - testSuite.include() val additionalVerificationMethod = VerificationMethod( id = "did:web:example.com#key-1", @@ -110,7 +94,6 @@ class DidDhtTests { @Test fun test_should_add_optional_services() { - testSuite.include() val service = Service( id = "did:web:example.com#service-0", @@ -130,7 +113,6 @@ class DidDhtTests { @Test fun test_should_add_optional_also_known_as() { - testSuite.include() val alsoKnownAs = listOf("https://alias.example.com") @@ -146,7 +128,6 @@ class DidDhtTests { @Test fun test_should_add_optional_controllers() { - testSuite.include() val controllers = listOf("did:web:controller.example.com") @@ -164,20 +145,8 @@ class DidDhtTests { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class Publish { - private val testSuite = UnitTestSuite("did_dht_publish") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_can_specify_gateway_url() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -211,7 +180,6 @@ class DidDhtTests { @Test fun test_can_handle_network_error() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -247,20 +215,8 @@ class DidDhtTests { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class Resolve { - private val testSuite = UnitTestSuite("did_dht_resolve") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_invalid_did() { - testSuite.include() val resolutionResult = DidDht.resolve("something invalid") @@ -272,7 +228,6 @@ class DidDhtTests { @Test fun test_method_not_supported() { - testSuite.include() val resolutionResult = DidDht.resolve("did:web:example") @@ -284,7 +239,6 @@ class DidDhtTests { @Test fun test_not_found() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -318,7 +272,6 @@ class DidDhtTests { @Test fun test_internal_error() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -352,7 +305,6 @@ class DidDhtTests { @Test fun test_can_create_then_resolve() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -404,4 +356,4 @@ class DidDhtTests { mockWebServer.shutdown() } } -} \ No newline at end of file +} diff --git a/bound/kt/src/test/kotlin/web5/sdk/dids/methods/jwk/DidJwkTests.kt b/bound/kt/src/test/kotlin/web5/sdk/dids/methods/jwk/DidJwkTests.kt index 51f4591a..78dfdc96 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/dids/methods/jwk/DidJwkTests.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/dids/methods/jwk/DidJwkTests.kt @@ -3,7 +3,6 @@ package web5.sdk.dids.methods.jwk import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.crypto.keys.InMemoryKeyManager import web5.sdk.crypto.Dsa import web5.sdk.dids.ResolutionMetadataError @@ -12,20 +11,8 @@ class DidJwkTests { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class Create { - private val testSuite = UnitTestSuite("did_jwk_create") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_can_specify_key_manager() { - testSuite.include() val keyManager = InMemoryKeyManager(listOf()) val bearerDid = DidJwk.create(DidJwkCreateOptions(keyManager)) @@ -39,7 +26,6 @@ class DidJwkTests { @Test fun test_can_specify_secp256k1() { - testSuite.include() val bearerDid = DidJwk.create(DidJwkCreateOptions(dsa = Dsa.SECP256K1)) @@ -51,7 +37,6 @@ class DidJwkTests { @Test fun test_defaults_to_ed25519() { - testSuite.include() val bearerDid = DidJwk.create() @@ -65,20 +50,8 @@ class DidJwkTests { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class Resolve { - private val testSuite = UnitTestSuite("did_jwk_resolve") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_invalid_did() { - testSuite.include() val resolutionResult = DidJwk.resolve("something invalid") assertEquals(ResolutionMetadataError.INVALID_DID, resolutionResult.resolutionMetadata.error) @@ -86,7 +59,6 @@ class DidJwkTests { @Test fun test_create_then_resolve() { - testSuite.include() val bearerDid = DidJwk.create() val resolutionResult = DidJwk.resolve(bearerDid.did.uri) diff --git a/bound/kt/src/test/kotlin/web5/sdk/dids/methods/web/DidWebTests.kt b/bound/kt/src/test/kotlin/web5/sdk/dids/methods/web/DidWebTests.kt index 30f36430..40f5daed 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/dids/methods/web/DidWebTests.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/dids/methods/web/DidWebTests.kt @@ -6,7 +6,6 @@ import okhttp3.mockwebserver.MockWebServer import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.crypto.Dsa import web5.sdk.crypto.keys.InMemoryKeyManager import web5.sdk.crypto.keys.Jwk @@ -18,20 +17,8 @@ class DidWebTests { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class Create { - private val testSuite = UnitTestSuite("did_web_create") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_can_specify_key_manager() { - testSuite.include() val keyManager = InMemoryKeyManager(listOf()) val bearerDid = DidWeb.create("localhost", DidWebCreateOptions(keyManager = keyManager)) @@ -44,7 +31,6 @@ class DidWebTests { @Test fun test_can_specify_secp256k1() { - testSuite.include() val bearerDid = DidWeb.create("localhost", DidWebCreateOptions(dsa = Dsa.SECP256K1)) @@ -56,7 +42,6 @@ class DidWebTests { @Test fun test_defaults_to_ed25519() { - testSuite.include() val bearerDid = DidWeb.create("localhost") @@ -68,7 +53,6 @@ class DidWebTests { @Test fun test_invalid_domain() { - testSuite.include() val exception = assertThrows { DidWeb.create("invalid domain") @@ -80,7 +64,6 @@ class DidWebTests { @Test fun test_should_allow_http_for_localhost() { - testSuite.include() assertDoesNotThrow { DidWeb.create("http://localhost") @@ -102,7 +85,6 @@ class DidWebTests { @Test fun test_must_be_https() { - testSuite.include() val exception = assertThrows { DidWeb.create("http://example.com") @@ -120,7 +102,6 @@ class DidWebTests { @Test fun test_should_trim_did_json() { - testSuite.include() val bearerDid = DidWeb.create("https://example.com/did.json") assertEquals("did:web:example.com", bearerDid.did.uri) @@ -128,7 +109,6 @@ class DidWebTests { @Test fun test_should_trim_well_known() { - testSuite.include() val bearerDid = DidWeb.create("https://example.com/.well-known/did.json") assertEquals("did:web:example.com", bearerDid.did.uri) @@ -136,7 +116,6 @@ class DidWebTests { @Test fun test_should_percent_encode_colons() { - testSuite.include() val bearerDid = DidWeb.create("https://example.com:8080") assertEquals("did:web:example.com%3A8080", bearerDid.did.uri) @@ -144,7 +123,6 @@ class DidWebTests { @Test fun test_should_replace_path_with_colons() { - testSuite.include() val bearerDid = DidWeb.create("https://example.com/path/to/resource") assertEquals("did:web:example.com:path:to:resource", bearerDid.did.uri) @@ -152,7 +130,6 @@ class DidWebTests { @Test fun test_should_add_optional_verification_methods() { - testSuite.include() val additionalVerificationMethod = VerificationMethod( id = "did:web:example.com#key-1", @@ -179,7 +156,6 @@ class DidWebTests { @Test fun test_should_add_optional_services() { - testSuite.include() val service = Service( id = "did:web:example.com#service-0", @@ -197,7 +173,6 @@ class DidWebTests { @Test fun test_should_add_optional_also_known_as() { - testSuite.include() val alsoKnownAs = listOf("https://alias.example.com") @@ -211,7 +186,6 @@ class DidWebTests { @Test fun test_should_add_optional_controllers() { - testSuite.include() val controllers = listOf("did:web:controller.example.com") @@ -227,20 +201,9 @@ class DidWebTests { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class Resolve { - private val testSuite = UnitTestSuite("did_web_resolve") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } @Test fun test_invalid_did() { - testSuite.include() val resolutionResult = DidWeb.resolve("something invalid") assertEquals(ResolutionMetadataError.INVALID_DID, resolutionResult.resolutionMetadata.error) @@ -248,7 +211,6 @@ class DidWebTests { @Test fun test_create_then_resolve() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() diff --git a/bound/kt/src/test/kotlin/web5/sdk/vc/VerifiableCredentialTest.kt b/bound/kt/src/test/kotlin/web5/sdk/vc/VerifiableCredentialTest.kt index 312867da..2c5b92f8 100644 --- a/bound/kt/src/test/kotlin/web5/sdk/vc/VerifiableCredentialTest.kt +++ b/bound/kt/src/test/kotlin/web5/sdk/vc/VerifiableCredentialTest.kt @@ -6,7 +6,6 @@ import okhttp3.mockwebserver.MockWebServer import org.junit.jupiter.api.* import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.fail -import web5.sdk.UnitTestSuite import web5.sdk.dids.BearerDid import web5.sdk.dids.methods.jwk.DidJwk import web5.sdk.Web5Exception @@ -25,27 +24,15 @@ class VerifiableCredentialTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class Create { - private val testSuite = UnitTestSuite("verifiable_credential_1_1_create") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } @Test fun test_default_context_added_if_not_supplied() { - testSuite.include() val vc = VerifiableCredential.create(ISSUER, CREDENTIAL_SUBJECT) assertEquals(listOf("https://www.w3.org/2018/credentials/v1"), vc.context) } @Test fun test_default_context_not_duplicated_if_supplied() { - testSuite.include() val options = VerifiableCredentialCreateOptions( context = listOf("https://www.w3.org/2018/credentials/v1") ) @@ -56,7 +43,6 @@ class VerifiableCredentialTest { @Test fun test_developer_provided_context_appended_to_default() { - testSuite.include() val customContext = "https://example.com/custom-context" val options = VerifiableCredentialCreateOptions( context = listOf(customContext) @@ -68,14 +54,12 @@ class VerifiableCredentialTest { @Test fun test_default_type_added_if_not_supplied() { - testSuite.include() val vc = VerifiableCredential.create(ISSUER, CREDENTIAL_SUBJECT, VerifiableCredentialCreateOptions()) assertEquals(listOf("VerifiableCredential"), vc.type) } @Test fun test_default_type_not_duplicated_if_supplied() { - testSuite.include() val options = VerifiableCredentialCreateOptions( type = listOf("VerifiableCredential") ) @@ -86,7 +70,6 @@ class VerifiableCredentialTest { @Test fun test_developer_provided_type_appended_to_default() { - testSuite.include() val customType = "CustomType" val options = VerifiableCredentialCreateOptions( type = listOf(customType) @@ -98,7 +81,6 @@ class VerifiableCredentialTest { @Test fun test_id_generated_if_not_supplied() { - testSuite.include() val vc = VerifiableCredential.create(ISSUER, CREDENTIAL_SUBJECT, VerifiableCredentialCreateOptions()) val uuidPattern = Pattern.compile("^urn:uuid:[0-9a-fA-F-]{36}$") assertTrue(uuidPattern.matcher(vc.id).matches()) @@ -106,7 +88,6 @@ class VerifiableCredentialTest { @Test fun test_id_must_be_set_if_supplied() { - testSuite.include() val customId = "custom-id" val options = VerifiableCredentialCreateOptions( id = customId @@ -118,7 +99,6 @@ class VerifiableCredentialTest { @Test fun test_issuer_string_must_not_be_empty() { - testSuite.include() val emptyIssuer = Issuer.StringIssuer("") val exception = assertThrows { @@ -130,14 +110,12 @@ class VerifiableCredentialTest { @Test fun test_issuer_string_must_be_set() { - testSuite.include() val vc = VerifiableCredential.create(ISSUER, CREDENTIAL_SUBJECT, VerifiableCredentialCreateOptions()) assertEquals(ISSUER, vc.issuer) } @Test fun test_issuer_string_must_be_valid_did() { - testSuite.include() val exception = assertThrows { VerifiableCredential.create(Issuer.StringIssuer("did:something-invalid"), CREDENTIAL_SUBJECT, VerifiableCredentialCreateOptions()) @@ -148,7 +126,6 @@ class VerifiableCredentialTest { @Test fun test_issuer_object_id_must_not_be_empty() { - testSuite.include() val issuer = Issuer.ObjectIssuer("", "Example Name") val exception = assertThrows { @@ -160,7 +137,6 @@ class VerifiableCredentialTest { @Test fun test_issuer_object_id_must_be_valid_did() { - testSuite.include() val exception = assertThrows { VerifiableCredential.create(Issuer.ObjectIssuer("did:something-invalid", "some name"), CREDENTIAL_SUBJECT, VerifiableCredentialCreateOptions()) @@ -171,7 +147,6 @@ class VerifiableCredentialTest { @Test fun test_issuer_object_name_must_not_be_empty() { - testSuite.include() val issuer = Issuer.ObjectIssuer(ISSUER_DID_URI, "") val exception = assertThrows { @@ -183,7 +158,6 @@ class VerifiableCredentialTest { @Test fun test_issuer_object_must_be_set() { - testSuite.include() val issuer = Issuer.ObjectIssuer(ISSUER_DID_URI, "Example Name") val vc = VerifiableCredential.create(issuer, CREDENTIAL_SUBJECT, VerifiableCredentialCreateOptions()) @@ -192,7 +166,6 @@ class VerifiableCredentialTest { @Test fun test_issuer_object_supports_additional_properties() { - testSuite.include() val additionalProperties = mapOf("extra_key" to "extra_value") val issuer = Issuer.ObjectIssuer( @@ -212,7 +185,6 @@ class VerifiableCredentialTest { @Test fun test_credential_subject_id_must_not_be_empty() { - testSuite.include() val credentialSubject = CredentialSubject("") val exception = assertThrows { @@ -224,14 +196,12 @@ class VerifiableCredentialTest { @Test fun test_credential_subject_must_be_set() { - testSuite.include() val vc = VerifiableCredential.create(ISSUER, CREDENTIAL_SUBJECT, VerifiableCredentialCreateOptions()) assertEquals(CREDENTIAL_SUBJECT, vc.credentialSubject) } @Test fun test_credential_subject_supports_additional_properties() { - testSuite.include() val additionalProperties = mapOf("extra_key" to "extra_value") val credentialSubject = CredentialSubject( @@ -245,7 +215,6 @@ class VerifiableCredentialTest { @Test fun test_issuance_date_must_be_set() { - testSuite.include() val issuanceDate = Date() val options = VerifiableCredentialCreateOptions( @@ -258,7 +227,6 @@ class VerifiableCredentialTest { @Test fun test_issuance_date_must_be_now_if_not_supplied() { - testSuite.include() val vc = VerifiableCredential.create(ISSUER, CREDENTIAL_SUBJECT, VerifiableCredentialCreateOptions()) val now = Date() @@ -270,7 +238,6 @@ class VerifiableCredentialTest { @Test fun test_expiration_date_must_be_set_if_supplied() { - testSuite.include() val expirationDate = Date() val options = VerifiableCredentialCreateOptions( expirationDate = expirationDate @@ -282,7 +249,6 @@ class VerifiableCredentialTest { @Test fun test_evidence_must_be_set_if_supplied() { - testSuite.include() val evidence = listOf(mapOf("A Key" to "A Value")) val options = VerifiableCredentialCreateOptions(evidence = evidence) @@ -292,7 +258,6 @@ class VerifiableCredentialTest { @Test fun test_schema_type_must_be_jsonschema() { - testSuite.include() val invalidSchemaType = CredentialSchema( id = "https://example.com/schemas/invalid.json", @@ -312,7 +277,6 @@ class VerifiableCredentialTest { @Test fun test_schema_resolve_network_issue() { - testSuite.include() val invalidUrl = "https://invalid-url.com/schemas/email.json" val schema = CredentialSchema( @@ -333,7 +297,6 @@ class VerifiableCredentialTest { @Test fun test_schema_resolve_non_success() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -366,7 +329,6 @@ class VerifiableCredentialTest { @Test fun test_schema_resolve_invalid_response_body() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -400,7 +362,6 @@ class VerifiableCredentialTest { @Test fun test_schema_invalid_json_schema() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -443,7 +404,6 @@ class VerifiableCredentialTest { @Test fun test_schema_do_not_support_draft04() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -487,7 +447,6 @@ class VerifiableCredentialTest { @Test fun test_schema_do_not_support_draft06() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -530,7 +489,6 @@ class VerifiableCredentialTest { @Test fun test_schema_fails_validation() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -591,7 +549,6 @@ class VerifiableCredentialTest { @Test fun test_schema_example_from_spec() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start() @@ -656,20 +613,8 @@ class VerifiableCredentialTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class FromVcJwt { - private val testSuite = UnitTestSuite("verifiable_credential_1_1_from_vc_jwt") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_missing_kid_jose_header() { - testSuite.include() val vcJwtWithMissingKid = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmEzYzY3NGI5LTliNGUtNGE2OS1hYzUwLWM3N2JhYzY0OTg2MCIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKclZ6YzNjbnA2VTNGUExYSkxUekpIY1hwd04zRk9TRGhEYWtORmJFMHpabmhMUmtWcVdFTmtaRWxWSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yN1QyMDo0NzoyNS4xMTk2MjQrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnJWemMzY25wNlUzRlBMWEpMVHpKSGNYcHdOM0ZPU0RoRGFrTkZiRTB6Wm5oTFJrVnFXRU5rWkVsVkluMCIsImp0aSI6InVybjp1dWlkOmEzYzY3NGI5LTliNGUtNGE2OS1hYzUwLWM3N2JhYzY0OTg2MCIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDc5MTY0NSwiaWF0IjoxNzI0NzkxNjQ1fQ.ocOyYhqFwz4Jvkdwpa69oFDXCOr2n-_IXSHg5elFebOM0T_lx3Cs6DgQJ7YLLk--mAOvPqrH05bh92BSaLB_DQ" @@ -682,7 +627,6 @@ class VerifiableCredentialTest { @Test fun test_empty_kid_jose_header() { - testSuite.include() val vcJwtWithEmptyKid = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6IiJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmE5MzcwYTZjLWFmNDAtNDU3Zi1iNDNiLWM0YmYzMzcwZTg1OSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKNE5XODFYM3BHTTE5a1QzaDBlbFZzTUVjNGREQnZkVlUyZFRsVFFVdEpiVkZXZFRaa1lsSlpiMUJqSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yN1QyMDozODo0Ni45MjcxMzYrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSjROVzgxWDNwR00xOWtUM2gwZWxWc01FYzRkREJ2ZFZVMmRUbFRRVXRKYlZGV2RUWmtZbEpaYjFCakluMCIsImp0aSI6InVybjp1dWlkOmE5MzcwYTZjLWFmNDAtNDU3Zi1iNDNiLWM0YmYzMzcwZTg1OSIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDc5MTEyNiwiaWF0IjoxNzI0NzkxMTI2fQ.0LzNrPzFY4CsEWRqYdo8pogGDonZqjRqfx9k30NEoWASw8pas6YC-mlDSAQ-4qQaE-otQ6p7zoMeopfw9M1CCQ" @@ -695,7 +639,6 @@ class VerifiableCredentialTest { @Test fun test_kid_invalid_did_uri() { - testSuite.include() val vcJwtWithInvalidDidUri = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImludmFsaWQgZGlkIHVyaSJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmFhYzFmN2M5LTIzOWQtNGE4OC05NDBiLTEwOTk3NmViNWYyNCIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiaW52YWxpZCBkaWQgdXJpIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMjozMDowOC41OTAxOTcrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImludmFsaWQgZGlkIHVyaSIsImp0aSI6InVybjp1dWlkOmFhYzFmN2M5LTIzOWQtNGE4OC05NDBiLTEwOTk3NmViNWYyNCIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg0ODIwOCwiaWF0IjoxNzI0ODQ4MjA4fQ.YdmnfP0wIK5HDu8Lft52UFdZCzfdFO0rclAOF-mWt6Y1vqAgoyuOn7AnX1Lx782-iWaekKApCGqCTaXepzj4CQ" @@ -708,7 +651,6 @@ class VerifiableCredentialTest { @Test fun test_kid_fail_to_resolve_did() { - testSuite.include() val vcJwtWithInvalidDidResolution = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpkaHQ6c29tZXRoaW5nLWludmFsaWQifQ.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjhiNGM1NmI5LTM1ODgtNGM0Mi1iOTg3LWEwZTAxNDFmNzA2YSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmRodDpzb21ldGhpbmctaW52YWxpZCIsImlzc3VhbmNlRGF0ZSI6IjIwMjQtMDgtMjhUMTI6MzQ6NDguMzMzMjg5KzAwOjAwIiwiZXhwaXJhdGlvbkRhdGUiOm51bGwsImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImlkIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5In19LCJpc3MiOiJkaWQ6ZGh0OnNvbWV0aGluZy1pbnZhbGlkIiwianRpIjoidXJuOnV1aWQ6OGI0YzU2YjktMzU4OC00YzQyLWI5ODctYTBlMDE0MWY3MDZhIiwic3ViIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODQ4NDg4LCJpYXQiOjE3MjQ4NDg0ODh9.hXbWLVU8ef38O5SY-HshVhXPM1RadFEAGRj0ds5Yjw1_lweWxe1-CNJxLmo0D4BiRCo4T4hCWP_bkwRoteImBA" @@ -721,7 +663,6 @@ class VerifiableCredentialTest { @Test fun test_kid_missing_verification_method() { - testSuite.include() val vcJwtWithMissingVerificationMethod = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmZNblZ0WDJFM2EwMU1OM1p0TXpGdlRWbGhjVE5WWWpGTWRWbzBhazFUTjNaT2NsTndlbWxvVWpkWkluMCMwLWludmFsaWQifQ.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmM5ZjUzNTY0LTdkMjYtNGE1NS1iN2E4LTk2MTU4ZTBhNWVhNSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKZk1uVnRYMkUzYTAxTU4zWnRNekZ2VFZsaGNUTlZZakZNZFZvMGFrMVROM1pPY2xOd2VtbG9VamRaSW4wIzAtaW52YWxpZCIsImlzc3VhbmNlRGF0ZSI6IjIwMjQtMDgtMjhUMTI6NDA6NDIuMjk2Njc4KzAwOjAwIiwiZXhwaXJhdGlvbkRhdGUiOm51bGwsImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImlkIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5In19LCJpc3MiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUpmTW5WdFgyRTNhMDFNTjNadE16RnZUVmxoY1ROVllqRk1kVm8wYWsxVE4zWk9jbE53ZW1sb1VqZFpJbjAjMC1pbnZhbGlkIiwianRpIjoidXJuOnV1aWQ6YzlmNTM1NjQtN2QyNi00YTU1LWI3YTgtOTYxNThlMGE1ZWE1Iiwic3ViIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODQ4ODQyLCJpYXQiOjE3MjQ4NDg4NDJ9.g-KcBy9jJ87PvIZkBUDPkBVF-dlnSTsLUVxOxB4az5q64aIDFJNTffVETD3Cq0fjXKX3tZq3QpfzmNoiTo4xBQ" @@ -734,7 +675,6 @@ class VerifiableCredentialTest { @Test fun test_fails_cryptographic_verification() { - testSuite.include() val vcJwtWithInvalidSignature = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZDI1NTE5Iiwia2lkIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKMmJGOUNOVTB6UzFw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IkIoWa_KpZprOWwVbSyVjcI_Ndo3SGCutUSiBboYH9sFomdGb7_0AeVDCg" @@ -747,7 +687,6 @@ class VerifiableCredentialTest { @Test fun test_passes_cryptographic_verification() { - testSuite.include() val vcJwtValid = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSkhWelpGVERsSVRUbHRkSGx5Y0dsWWRGRlVNR3B4Wms1MmFXTm5RVGxCVkRnME1IWTFZMDh5YjFSckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjZmYTQ2MDVjLWFlZGItNGQ2NC05NzdiLTFmY2NmYTU1ZTM1ZiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKSFZ6WkZURGxJVFRsdGRIbHljR2xZZEZGVU1HcHhaazUyYVdOblFUbEJWRGcwTUhZMVkwOHliMVJySW4wIzAiLCJpc3N1YW5jZURhdGUiOiIyMDI0LTA4LTI4VDEyOjQyOjI3Ljc3Mjg4OSswMDowMCIsImV4cGlyYXRpb25EYXRlIjpudWxsLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSJ9fSwiaXNzIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKSFZ6WkZURGxJVFRsdGRIbHljR2xZZEZGVU1HcHhaazUyYVdOblFUbEJWRGcwTUhZMVkwOHliMVJySW4wIzAiLCJqdGkiOiJ1cm46dXVpZDo2ZmE0NjA1Yy1hZWRiLTRkNjQtOTc3Yi0xZmNjZmE1NWUzNWYiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjQ4NDg5NDcsImlhdCI6MTcyNDg0ODk0N30.-JwIGYZ9HlJASYxdRBWY5KlwP0iJUxWUOU6BsOR74VeC-zKgZb9WWZR08OVD-wv0X8KD5--0K5Dr9r5fL3B0Aw" @@ -757,7 +696,6 @@ class VerifiableCredentialTest { @Test fun test_can_skip_cryptographic_verification() { - testSuite.include() val vcJwtWithInvalidSignature = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSkhWelpGVERsSVRUbHRkSGx5Y0dsWWRGRlVNR3B4Wms1MmFXTm5RVGxCVkRnME1IWTFZMDh5YjFSckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjZmYTQ2MDVjLWFlZGItNGQ2NC05NzdiLTFmY2NmYTU1ZTM1ZiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKSFZ6WkZURGxJVFRsdGRIbHljR2xZZEZGVU1HcHhaazUyYVdOblFUbEJWRGcwTUhZMVkwOHliMVJySW4wIzAiLCJpc3N1YW5jZURhdGUiOiIyMDI0LTA4LTI4VDEyOjQyOjI3Ljc3Mjg4OSswMDowMCIsImV4cGlyYXRpb25EYXRlIjpudWxsLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSJ9fSwiaXNzIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKSFZ6WkZURGxJVFRsdGRIbHljR2xZZEZGVU1HcHhaazUyYVdOblFUbEJWRGcwTUhZMVkwOHliMVJySW4wIzAiLCJqdGkiOiJ1cm46dXVpZDo2ZmE0NjA1Yy1hZWRiLTRkNjQtOTc3Yi0xZmNjZmE1NWUzNWYiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjQ4NDg5NDcsImlhdCI6MTcyNDg0ODk0N30.-JwIGYZ9HlJASYxdRBWY5KlwP0iJUxWUOU6BsOR74VeC-zKgZb9WWZR08OVD-wv0X8KD5--0K5Dr9r5fL3B0Aw-invalid-signature" @@ -767,7 +705,6 @@ class VerifiableCredentialTest { @Test fun test_can_skip_data_model_validation() { - testSuite.include() // expired would throw an error, but since verify=false it doesn't val vcJwtWithExpired = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpjV3hxVTJaZlgzbE9TVVpKTVVwaWNYQkVSVEJuVUZGT2FVazBiVkZqV2pONmRtZFVVbmg2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1Njc2MDQ2Njd9.pP_8QVzTqxuhUlIWpXDWQ3Py_VlDA4uX82xdD9GOdmRT2UK-K5Gn7A5qdUxBPhXifiRVnH_Q8NbWZCUQ8jZUBg" @@ -779,7 +716,6 @@ class VerifiableCredentialTest { @Test fun test_can_skip_credential_schema_validation() { - testSuite.include() val vcJwtWithInvalidSchema = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXlkMjFXVjFwblMySk1iM0JPVEhWTmRYUlNSV2gwTWtWMmJEbExkVkpFTFY5MlVrRnpWMlZwUm01TkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjE1OTY4MDA4LTI1OTEtNGY0MS1hOWI1LWU2YmUxNDU5ZDcxNiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJeWQyMVdWMXBuUzJKTWIzQk9USFZOZFhSU1JXaDBNa1YyYkRsTGRWSkVMVjkyVWtGelYyVnBSbTVOSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0zMFQxNDo1NTozNS41MTc5NjUrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifSwiY3JlZGVudGlhbFNjaGVtYSI6eyJpZCI6ImludmFsaWQgdXJsL3NjaGVtYXMvZW1haWwuanNvbiIsInR5cGUiOiJKc29uU2NoZW1hIn19LCJpc3MiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUl5ZDIxV1YxcG5TMkpNYjNCT1RIVk5kWFJTUldoME1rVjJiRGxMZFZKRUxWOTJVa0Z6VjJWcFJtNU5JbjAiLCJqdGkiOiJ1cm46dXVpZDoxNTk2ODAwOC0yNTkxLTRmNDEtYTliNS1lNmJlMTQ1OWQ3MTYiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjUwMjk3MzUsImlhdCI6MTcyNTAyOTczNX0.8zNS9RWIpvTlMvAzaI9dNSjKKM1drFig7bKhQeQ6Mv9hWXwazvDhxthy3D25EmITWAPiJfGcMPDqoDobETf8DA" @@ -789,7 +725,6 @@ class VerifiableCredentialTest { @Test fun test_decode_issuer_string() { - testSuite.include() val vcJwtWithIssuerAsString = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnlkMmhYU1VOWWNsSjNiMFphUm1SMU0wbHNOaTFCTkdVdGRqazNRbE14UmtaUmFWRTRhV05tV2t0ckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjc0NTY5ZmIzLWMyZTktNGZiMy1hOThkLWY3NGFjNzVjYTg5NSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKeWQyaFhTVU5ZY2xKM2IwWmFSbVIxTTBsc05pMUJOR1V0ZGprM1FsTXhSa1pSYVZFNGFXTm1Xa3RySW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxNjozNjoyOS4zNDc4ODArMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnlkMmhYU1VOWWNsSjNiMFphUm1SMU0wbHNOaTFCTkdVdGRqazNRbE14UmtaUmFWRTRhV05tV2t0ckluMCIsImp0aSI6InVybjp1dWlkOjc0NTY5ZmIzLWMyZTktNGZiMy1hOThkLWY3NGFjNzVjYTg5NSIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg2Mjk4OSwiaWF0IjoxNzI0ODYyOTg5fQ.0DSZ2XbPtjtrtxNKo3tImoByb1-jlQxZQN11lsngaFSe4lhy4mYmaxGAby4wIl-c_cLEkgBULfF3Qa_dlNSTCw" @@ -808,7 +743,6 @@ class VerifiableCredentialTest { @Test fun test_decode_issuer_object() { - testSuite.include() val vcJwtWithIssuerObject = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRS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NhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODYzMjExLCJpYXQiOjE3MjQ4NjMyMTF9.Mv-wlUcnj0w-OWuoMBCciaQXrAogXL3qqgZnthTRI9f55S5PidYiSapWFxFqc4SzxTVSpe64H2vF7kfGU-QpBw" @@ -828,7 +762,6 @@ class VerifiableCredentialTest { @Test fun test_decode_evidence() { - testSuite.include() val vcJwtWithEvidence = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmljbll0T1VKSGRUVlhNVFV4VkVKVk9GY3hVVkozU1dwSWRXVmlVVGc1TlRCQ2VuRTFjR1ZxV25wSkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjkxYWM1NzBmLTRjMDMtNDIxZi1iZGY4LWQ3Y2YyNzQ1YzVmNSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKaWNuWXRPVUpIZFRWWE1UVXhWRUpWT0ZjeFVWSjNTV3BJZFdWaVVUZzVOVEJDZW5FMWNHVnFXbnBKSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0zMFQxMDowMToyNC4yNTgzNjYrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifSwiZXZpZGVuY2UiOlt7IkEgS2V5IjoiQSBWYWx1ZSJ9XX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmljbll0T1VKSGRUVlhNVFV4VkVKVk9GY3hVVkozU1dwSWRXVmlVVGc1TlRCQ2VuRTFjR1ZxV25wSkluMCIsImp0aSI6InVybjp1dWlkOjkxYWM1NzBmLTRjMDMtNDIxZi1iZGY4LWQ3Y2YyNzQ1YzVmNSIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNTAxMjA4NCwiaWF0IjoxNzI1MDEyMDg0fQ.M7t4Ox08v-rC-naPSfIqlE1KKhZ1nrx_QA2HbuW38AkgxnSZOYEpXEG1UTAzh6mdwKZin9jwoGrj29u24K1ABA" val vc = VerifiableCredential.fromVcJwt(vcJwtWithEvidence, false) @@ -839,7 +772,6 @@ class VerifiableCredentialTest { @Test fun test_decode_credential_schema() { - testSuite.include() val vcJwtWithCredentialSchema = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSTFUMXB2TVd4bU9VcHlOeTFZTkdGWU4yRmxka2N5WVU5MGEwWmxlSFZuYzBwcVZVbEtWVU5UYVVkUkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjNhMDU2NjE1LWNlZDMtNGQ4Zi05ODRhLTUwMzQ2Y2FlNDQ2ZiIsInR5cGUiOlsi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6 @@ class VerifiableCredentialTest { @Test fun test_decode_missing_vc_claim() { - testSuite.include() val vcJwtWithMissingVcClaim = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSlNSbkZSVlVWS1RFOVhlbXh3T1ZaRk1rdEtSalp6UjBwT00yVnpaWHBsY0hSSE0ySTFlbTh4YjAwNEluMCMwIn0.eyJpc3MiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUpTUm5GUlZVVktURTlYZW14d09WWkZNa3RLUmpaelIwcE9NMlZ6WlhwbGNIUkhNMkkxZW04eGIwMDRJbjAiLCJqdGkiOiJ1cm46dXVpZDozNmU0ZjllNi0yYzdjLTQ0NGMtOTI4OS0zNDhmY2IxNDZlYjYiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjQ4NTA1MjIsImlhdCI6MTcyNDg1MDUyMn0.SqwZC0q9RuHp9hAtFmE6sBYeJ1uHuuq1hyijF0NmW9nksSBqtDpfNroNlitK_Tl-CLWtwbTpK3b3JduTfzGEAw" @@ -868,7 +799,6 @@ class VerifiableCredentialTest { @Test fun test_decode_missing_jti_claim() { - testSuite.include() val vcJwtWithMissingJtiClaim = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSm5jMjlTZGsxUFlXMHliMlJQTlY4NWVqbExlV2xzV1VzM1Y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@@ -881,7 +811,6 @@ class VerifiableCredentialTest { @Test fun test_decode_missing_issuer_claim() { - testSuite.include() val vcJwtWithMissingIssuerClaim = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpjamREVWtVek1HbzNjVVU0Y2taVVJYQXdSbFJzYnpKVVVXVmlZa1ZHTVVvelJHaHRTVWhaVTNFd0luMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjRjYzU0NWU0LWI5ZDgtNDdkNS04Zjk0LTA4MmM0ZGViNzAyZCIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKemNqZERVa1V6TUdvM2NVVTRja1pVUlhBd1JsUnNiekpVVVdWaVlrVkdNVW96UkdodFNVaFpVM0V3SW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzoxMTo1Mi4zMjg4MTMrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImp0aSI6InVybjp1dWlkOjRjYzU0NWU0LWI5ZDgtNDdkNS04Zjk0LTA4MmM0ZGViNzAyZCIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg1MDcxMiwiaWF0IjoxNzI0ODUwNzEyfQ.hwR6edt6ItlN0HHkDcxzhE3N5hLk-5-VYDLrqkalUoTKB41vsfaPvGnt_UQK3EAuekQgrTQ0SuCq-6ut0EdlBw" @@ -894,7 +823,6 @@ class VerifiableCredentialTest { @Test fun test_decode_missing_subject_claim() { - testSuite.include() val vcJwtWithMissingSubjectClaim = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSldiRFprTjFFMWRXOTNSMVk1TWxsRlVWSkxOMnROWkdRM1lYcFJiMGxsU0hac1FXaFNSMVJmTlRJMEluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjBmYTE0MTgxLTllMWYtNDk0ZC05ZmVmLWMwYjgxZDE1ZGJiYiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKV2JEWmtOMUUxZFc5M1IxWTVNbGxGVVZKTE4ydE5aR1EzWVhwUmIwbGxTSFpzUVdoU1IxUmZOVEkwSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzoxMjo0NS40NTg4MjYrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSldiRFprTjFFMWRXOTNSMVk1TWxsRlVWSkxOMnROWkdRM1lYcFJiMGxsU0hac1FXaFNSMVJmTlRJMEluMCIsImp0aSI6InVybjp1dWlkOjBmYTE0MTgxLTllMWYtNDk0ZC05ZmVmLWMwYjgxZDE1ZGJiYiIsIm5iZiI6MTcyNDg1MDc2NSwiaWF0IjoxNzI0ODUwNzY1fQ.61IFQhdASbbcYKUzMfhO7WPmikBd8AoE468FTlqRysxXck7kNa3bAAow3jK2uhYrIWLyRu3kuBp7JyYhLavjBw" @@ -907,7 +835,6 @@ class VerifiableCredentialTest { @Test fun test_decode_missing_nbf_claim() { - testSuite.include() val vcJwtWithMissingNbfClaim = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXdOR1ZzZGxGdlJWbDBZbEJIT0RsWlVtaGpTR2RJT1cwMlMzSjZiRVkyUWpGUldrZGxOR2RGUjJKakluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjk3OGZhZTIxLTVmMDYtNDBmNy1iZTJmLTM4MzRmZGMwZDY0NSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJd05HVnNkbEZ2UlZsMFlsQkhPRGxaVW1oalNHZElPVzAyUzNKNmJFWTJRakZSV2tkbE5HZEZSMkpqSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzoxMzoyNi4zMzQzNjYrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXdOR1ZzZGxGdlJWbDBZbEJIT0RsWlVtaGpTR2RJT1cwMlMzSjZiRVkyUWpGUldrZGxOR2RGUjJKakluMCIsImp0aSI6InVybjp1dWlkOjk3OGZhZTIxLTVmMDYtNDBmNy1iZTJmLTM4MzRmZGMwZDY0NSIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsImlhdCI6MTcyNDg1MDgwNn0.ZXfuZmvddH1nvmub8WDpQ2UEOhuiLaN6WL2q3XDhn0eouM_bNVa7vmCUCUZc3sfJ1YCtnAGCJOlJxSGnD3tOCw" @@ -920,7 +847,6 @@ class VerifiableCredentialTest { @Test fun test_decode_claim_mismatch_id() { - testSuite.include() val vcJwtWithMismatchId = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnZTWHBSUjJkTmNGTlNPSEpRWTNkd1IxZEJTRnBaV0hwUFdYRlRiMFkyTWtoM09HTlJRamRJUzIxM0luMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3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iwibmJmIjoxNzI0ODUxMDY1LCJpYXQiOjE3MjQ4NTEwNjV9.x0UY38J4lEwmrXR4qrzhnk58btjZfMf8DVhdgBoj9M0JOgJqCDFCzwcS5weVCpNAv3gN72Qo32RH9Tx0eYyoDA" @@ -946,7 +871,6 @@ class VerifiableCredentialTest { @Test fun test_decode_claim_mismatch_subject() { - testSuite.include() val vcJwtWithMismatchSubject = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXdVRmh0UkVNMlNIWnVia1E0Vmw5QkxWbDVSelZ1TWtSa2IxQkdTVFkxY2tkb2MwVTVZWFZsWW5CckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjAwNDJiYTQ4LWU0ZGYtNGVhMS04ZmJjLWJjYmI4ODY3ZjFhMCIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJd1VGaHRSRU0yU0hadWJrUTRWbDlCTFZsNVJ6VnVNa1JrYjFCR1NUWTFja2RvYzBVNVlYVmxZbkJySW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzoxOToxMC4xNjM0ODkrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJzb21ldGhpbmcgaW52YWxpZCJ9fSwiaXNzIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJd1VGaHRSRU0yU0hadWJrUTRWbDlCTFZsNVJ6VnVNa1JrYjFCR1NUWTFja2RvYzBVNVlYVmxZbkJySW4wIiwianRpIjoidXJuOnV1aWQ6MDA0MmJhNDgtZTRkZi00ZWExLThmYmMtYmNiYjg4NjdmMWEwIiwic3ViIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODUxMTUwLCJpYXQiOjE3MjQ4NTExNTB9.bAm9kKJX2-Rcw679VS7cUPbqg9awuq5Lwu9wiZoGcE0TCSc59rQTIP4nvxlP22o3V-VVs_DbfpJU-qB4duDSCA" @@ -959,7 +883,6 @@ class VerifiableCredentialTest { @Test fun test_decode_claim_misconfigured_exp() { - testSuite.include() val vcJwtWithMisconfiguredExp = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnJkWFI2V21WM01EVTBMVlUwUVRBM2FsYzJZbkkxUlV4NU1UQlpOSGxPVTFCaVkyOTNXakJ3TjJWakluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjYxZjgwM2I4LWUxMDQtNDdhOC04YWE1LTk4YzQ1ZTFiOGUzMSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKcmRYUjZXbVYzTURVMExWVTBRVEEzYWxjMlluSTFSVXg1TVRCWk5IbE9VMUJpWTI5M1dqQndOMlZqSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzoyMzo0My45NDg4MzQrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6IjIwMjktMDgtMjJUMTM6MjM6NDMuOTQ4NzYwKzAwOjAwIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnJkWFI2V21WM01EVTBMVlUwUVRBM2FsYzJZbkkxUlV4NU1UQlpOSGxPVTFCaVkyOTNXakJ3TjJWakluMCIsImp0aSI6InVybjp1dWlkOjYxZjgwM2I4LWUxMDQtNDdhOC04YWE1LTk4YzQ1ZTFiOGUzMSIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg1MTQyMywiaWF0IjoxNzI0ODUxNDIzfQ.AWYyvLRISXwLH5gAXb5CcwBXNwaRKwacGqstXjnk-xIHx9gmm5xj8zGONvcKE2Xx0t9j3pNHicrhkp5wcOkABQ" @@ -972,7 +895,6 @@ class VerifiableCredentialTest { @Test fun test_decode_claim_mismatch_exp() { - testSuite.include() val vcJwtWithMismatchExp = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSk1lWEJmUjJVelVEZGtjbVZhYTJSV1VsTnJZbm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1MTY1MywiaWF0IjoxNzI0ODUxNjUzLCJleHAiOjE4ODUxMjM2NTN9.lAaTG8RhL2D92iNI6psZrv1uhtHYAO0m0AacGIQrW0XIThg-Livef36_CN9t4Lz2Ta5US2Be2VP6D3lCA-z1DQ" @@ -985,7 +907,6 @@ class VerifiableCredentialTest { @Test fun test_validate_dm_empty_id() { - testSuite.include() val vcJwtWithEmptyId = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmxja0pYTmpoTVpXWlVZbGhEU0Zwck5VeG5OVVl5U3pSalJrVmlNVmhNYlVWa1VVNWxTbVJKV2pkTkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6IiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKbGNrSlhOamhNWldaVVlsaERTRnByTlV4bk5VWXlTelJqUmtWaU1WaE1iVVZrVVU1bFNtUkpXamROSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzozMDo1My44NDQ2ODMrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6IjIwMjktMDgtMjJUMTM6MzA6NTMuODQ0NjMwKzAwOjAwIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmxja0pYTmpoTVpXWlVZbGhEU0Zwck5VeG5OVVl5U3pSalJrVmlNVmhNYlVWa1VVNWxTbVJKV2pkTkluMCIsImp0aSI6IiIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg1MTg1MywiaWF0IjoxNzI0ODUxODUzLCJleHAiOjE4ODIwOTk4NTN9.X_jkleLbhdAo0vm7KtN0qr6nR6hvWrXxk08UslfZAhZCkDN2kqLvWhoHps3GNznmGAuhJxwhZ0SN60OV7pp1DQ" @@ -998,7 +919,6 @@ class VerifiableCredentialTest { @Test fun test_validate_dm_empty_context() { - testSuite.include() val vcJwtWithEmptyContext = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSjFSbXRGTVdkblNGcENaME4yY1doa1VqRkJZelZqUkd0Q2IybDFRMnhOYm5CTVVFNDRYM1ZOVjBRd0luMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6W10sImlkIjoidXJuOnV1aWQ6ODVmM2MzNWUtYTI5Yi00YmQ2LTk1MmMtNzhlYWJiOTIzNzI4IiwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCJdLCJpc3N1ZXIiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUoxUm10Rk1XZG5TRnBDWjBOMmNXaGtVakZCWXpWalJHdENiMmwxUTJ4TmJuQk1VRTQ0WDNWTlYwUXdJbjAiLCJpc3N1YW5jZURhdGUiOiIyMDI0LTA4LTI4VDEzOjMyOjM1LjI2MzM1NiswMDowMCIsImV4cGlyYXRpb25EYXRlIjpudWxsLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSJ9fSwiaXNzIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKMVJtdEZNV2RuU0ZwQ1owTjJjV2hrVWpGQll6VmpSR3RDYjJsMVEyeE5ibkJNVUU0NFgzVk5WMFF3SW4wIiwianRpIjoidXJuOnV1aWQ6ODVmM2MzNWUtYTI5Yi00YmQ2LTk1MmMtNzhlYWJiOTIzNzI4Iiwic3ViIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODUxOTU1LCJpYXQiOjE3MjQ4NTE5NTV9.2GaazffucPj-LfdnO9OtMwij0PQK9crDC7rMMcwV9nt50Q3ACc1UtYCruMWsfYMc_CKfl5g7m6-zwDW8SpDzAw" @@ -1011,7 +931,6 @@ class VerifiableCredentialTest { @Test fun test_validate_dm_context_base_mismatch() { - testSuite.include() val vcJwtWithoutBaseContext = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnFSVWRmU1V4TlZDMVVUMGgyTjIxeFJ6UlJWVmRMTWs1dU9FcGlUVU5OWldKQ1pXVjRkVGxIYlhWWkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJhIGNvbnRleHQiXSwiaWQiOiJ1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C00OWI0LWI1YzMtODFlOTU4M2M5NzI4Iiwic3ViIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODUyMTM2LCJpYXQiOjE3MjQ4NTIxMzZ9.EY1q2nZHnPk-hnzdScvf6QYA0ko_sshHWOnPxU9tkU-RhxdklRoO9JQgmoHZC1FdDgEfgs4nDFNUKyX-FlJPBw" @@ -1037,7 +955,6 @@ class VerifiableCredentialTest { @Test fun test_validate_dm_type_base_mismatch() { - testSuite.include() val vcJwtWithoutBaseType = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSlJTMjVyVDNvd2RETkpRWGRqVWtGamQyTjFkVWxKUkZsT2NHWlhkWFJvY21SVE5EVktiemRFU1dsckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmQ1NTdkODY3LWRlNTgtNDE3Ny1iZjE4LTM1ZjQ3NDA5NDlmMSIsInR5cGUiOlsiYSB0eXBlIl0sImlzc3VlciI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSlJTMjVyVDNvd2RETkpRWGRqVWtGamQyTjFkVWxKUkZsT2NHWlhkWFJvY21SVE5EVktiemRFU1dsckluMCIsImlzc3VhbmNlRGF0ZSI6IjIwMjQtMDgtMjhUMTM6MzY6MzUuNDgwMTkwKzAwOjAwIiwiZXhwaXJhdGlvbkRhdGUiOm51bGwsImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImlkIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5In19LCJpc3MiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUpSUzI1clQzb3dkRE5KUVhkalVrRmpkMk4xZFVsSlJGbE9jR1pYZFhSb2NtUlRORFZLYnpkRVNXbHJJbjAiLCJqdGkiOiJ1cm46dXVpZDpkNTU3ZDg2Ny1kZTU4LTQxNzctYmYxOC0zNWY0NzQwOTQ5ZjEiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjQ4NTIxOTUsImlhdCI6MTcyNDg1MjE5NX0.S3vchUrNfdgXTQFeu7HcI5F0ZdkQdYkd4IqAXF8_uhcOe_sX9joDWspBSxwP3BY6ESCPIpJoms_dPIp01RWABA" @@ -1050,7 +967,6 @@ class VerifiableCredentialTest { @Test fun test_validate_dm_empty_issuer() { - testSuite.include() val vcJwtWithEmptyIssuer = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnRPSEZRTVhoR1p6RndZMlpqZUY5UWVrUnJOMjFPYVhoak9YQTFWamN4WlVZelYwRTViSGwzTWpsckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmFhMmNjNWNkLTg4N2QtNDFkMi1iZTM3LTIzMjMxMGVkODdjMiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzozOToxNS42MjMzOTMrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6IiIsImp0aSI6InVybjp1dWlkOmFhMmNjNWNkLTg4N2QtNDFkMi1iZTM3LTIzMjMxMGVkODdjMiIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg1MjM1NSwiaWF0IjoxNzI0ODUyMzU1fQ.mRYZKF3qNz_Vyg8xpemuBOipGLOliYy9xJ6b9ZqcMNjZbb8GtEyiaBv8rgF2jqmHreRT71wHaT3P6mV9GsQOCA" @@ -1063,7 +979,6 @@ class VerifiableCredentialTest { @Test fun test_validate_dm_empty_subject() { - testSuite.include() val vcJwtWithEmptySubject = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpOakV6U1hobGFWWk9WMW81YzBaM1NrdE1OSEI2WkdaRlRsWXRWVEZxYkMweVNIcFpXV2hCUWxWM0luMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjNkNGMzMjQxLWU0NDUtNGE2Ny1hYmE0LTIxYjBmM2NkMmMxYyIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKek5qRXpTWGhsYVZaT1YxbzVjMFozU2t0TU5IQjZaR1pGVGxZdFZURnFiQzB5U0hwWldXaEJRbFYzSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzo0MToxMC4xNzM2NzIrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiIifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpOakV6U1hobGFWWk9WMW81YzBaM1NrdE1OSEI2WkdaRlRsWXRWVEZxYkMweVNIcFpXV2hCUWxWM0luMCIsImp0aSI6InVybjp1dWlkOjNkNGMzMjQxLWU0NDUtNGE2Ny1hYmE0LTIxYjBmM2NkMmMxYyIsInN1YiI6IiIsIm5iZiI6MTcyNDg1MjQ3MCwiaWF0IjoxNzI0ODUyNDcwfQ.Ek9NMfHyb8BzJ7GnV0JRQPVl-UQyMOCMZ2_ABMx9Cvh8d8T81wMjrYUPp6v57-veqKntYFO_WZciL2FC_VZWAw" @@ -1076,7 +991,6 @@ class VerifiableCredentialTest { @Test fun test_validate_dm_issuance_in_future() { - testSuite.include() val vcJwtWithIssuanceDateInFuture = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmhhazFPTms1Zk1rOVRWbVl5TFdGd1VsOW1VbWRwVG1OMVNVMXphVWMzTVhaM2FYVnBVSGd4YTFOTkluMCMwIn0.eyJ2YyI6e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UievVAfKWUQFpOvBQ" @@ -1089,7 +1003,6 @@ class VerifiableCredentialTest { @Test fun test_validate_dm_credential_expired() { - testSuite.include() val vcJwtWithExpired = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpjV3hxVTJaZlgzbE9TVVpKTVVwaWNYQkVSVEJuVUZGT2FVazBiVkZqV2pONmRtZFVVbmg2WTAxbkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmFkNzBmN2Y2LWExNTctNGYxZi1hZjI5LTdjYmJkNDRmODlmMCIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKemNXeHFVMlpmWDNsT1NVWkpNVXBpY1hCRVJUQm5VRkZPYVVrMGJWRmpXak42ZG1kVVVuaDZZMDFuSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzo0NDoyNy45MTUwMjUrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6IjIwMTktMDktMDRUMTM6NDQ6MjcuOTE0ODY0KzAwOjAwIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpjV3hxVTJaZlgzbE9TVVpKTVVwaWNYQkVSVEJuVUZGT2FVazBiVkZqV2pONmRtZFVVbmg2WTAxbkluMCIsImp0aSI6InVybjp1dWlkOmFkNzBmN2Y2LWExNTctNGYxZi1hZjI5LTdjYmJkNDRmODlmMCIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg1MjY2NywiaWF0IjoxNzI0ODUyNjY3LCJleHAiOjE1Njc2MDQ2Njd9.pP_8QVzTqxuhUlIWpXDWQ3Py_VlDA4uX82xdD9GOdmRT2UK-K5Gn7A5qdUxBPhXifiRVnH_Q8NbWZCUQ8jZUBg" @@ -1102,7 +1015,6 @@ class VerifiableCredentialTest { @Test fun test_schema_type_must_be_jsonschema() { - testSuite.include() val vcJwtWithWrongSchemaType = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXhlbTlYY0VWTWN6TnhiV0p5VW5GblRFbzBjbDlCZUhCYVNFSmpjMUZJVGtSaVRGYzBOM1JmVGpkSkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjQ1NGY1NWJmLWYzMjAtNDQyOS1iNmViLTRkMzdlNTMzNDkwYyIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJeGVtOVhjRVZNY3pOeGJXSnlVbkZuVEVvMGNsOUJlSEJhU0VKamMxRklUa1JpVEZjME4zUmZUamRKSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0zMFQxNTowMjo1NC4zNjg1NjMrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifSwiY3JlZGVudGlhbFNjaGVtYSI6eyJpZCI6Imh0dHBzOi8vZXhhbXBsZS5jb20iLCJ0eXBlIjoic29tZXRoaW5nIGludmFsaWFkIn19LCJpc3MiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUl4ZW05WGNFVk1jek54YldKeVVuRm5URW8wY2w5QmVIQmFTRUpqYzFGSVRrUmlURmMwTjNSZlRqZEpJbjAiLCJqdGkiOiJ1cm46dXVpZDo0NTRmNTViZi1mMzIwLTQ0MjktYjZlYi00ZDM3ZTUzMzQ5MGMiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjUwMzAxNzQsImlhdCI6MTcyNTAzMDE3NH0.8gxVx3_Qd1Lvao-y5PZ56XS3lMQvrFtBVMgfNDIdW9eoQkBQMNv79YKIxFCig0LHanzg_vyzX7tBviW6xJUuDw" @@ -1115,7 +1027,6 @@ class VerifiableCredentialTest { @Test fun test_schema_resolve_network_issue() { - testSuite.include() val vcJwtWithInvalidUrl = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9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DpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNTAzMDMyMCwiaWF0IjoxNzI1MDMwMzIwfQ.3sH7qzI7QrQMdkWIvqf7k8Mr2dMGjWBLrv4QB8gEz0t83RSFMtG-fWT-YVkUlo1qMvC4gNjT2Jc0eObCAA7VDQ" @@ -1128,7 +1039,6 @@ class VerifiableCredentialTest { @Test fun test_schema_resolve_non_success() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start(40001) @@ -1151,7 +1061,6 @@ class VerifiableCredentialTest { @Test fun test_schema_resolve_invalid_response_body() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start(40002) @@ -1175,7 +1084,6 @@ class VerifiableCredentialTest { @Test fun test_schema_invalid_json_schema() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start(40003) @@ -1219,7 +1127,6 @@ class VerifiableCredentialTest { @Test fun test_schema_do_not_support_draft04() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start(40004) @@ -1263,7 +1170,6 @@ class VerifiableCredentialTest { @Test fun test_schema_do_not_support_draft06() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start(40005) @@ -1307,7 +1213,6 @@ class VerifiableCredentialTest { @Test fun test_schema_fails_validation() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start(40006) @@ -1351,7 +1256,6 @@ class VerifiableCredentialTest { @Test fun test_schema_example_from_spec() { - testSuite.include() val mockWebServer = MockWebServer() mockWebServer.start(40007) @@ -1397,20 +1301,8 @@ class VerifiableCredentialTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) inner class Sign { - private val testSuite = UnitTestSuite("verifiable_credential_1_1_sign") - - @AfterAll - fun verifyAllTestsIncluded() { - if (testSuite.tests.isNotEmpty()) { - println("The following tests were not included or executed:") - testSuite.tests.forEach { println(it) } - fail("Not all tests were executed! ${testSuite.tests}") - } - } - @Test fun test_can_sign_then_verify() { - testSuite.include() val bearerDid = DidJwk.create() val vc = VerifiableCredential.create( @@ -1426,7 +1318,6 @@ class VerifiableCredentialTest { @Test fun test_bearer_did_mismatch_issuer() { - testSuite.include() val bearerDid = DidJwk.create() val vc = VerifiableCredential.create( @@ -1447,7 +1338,6 @@ class VerifiableCredentialTest { @Test fun test_defaults_to_first_vm() { - testSuite.include() val bearerDid = DidJwk.create() val vc = VerifiableCredential.create( @@ -1464,7 +1354,6 @@ class VerifiableCredentialTest { @Test fun test_vm_must_be_assertion_method() { - testSuite.include() val bearerDid = DidJwk.create() val vc = VerifiableCredential.create( diff --git a/crates/web5/src/credentials/create.rs b/crates/web5/src/credentials/create.rs index d5f134ed..f170db37 100644 --- a/crates/web5/src/credentials/create.rs +++ b/crates/web5/src/credentials/create.rs @@ -106,8 +106,6 @@ mod tests { use super::*; use crate::credentials::credential_schema::{CredentialSchema, CREDENTIAL_SCHEMA_TYPE}; use crate::json::JsonValue; - use crate::{test_helpers::UnitTestSuite, test_name}; - use lazy_static::lazy_static; use mockito::Server; use regex::Regex; use std::collections::HashMap; @@ -159,27 +157,8 @@ mod tests { use crate::{credentials::issuer::ObjectIssuer, json::JsonObject}; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = - UnitTestSuite::new("verifiable_credential_1_1_create"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_default_context_added_if_not_supplied() { - TEST_SUITE.include(test_name!()); - let vc = create_vc( issuer(), credential_subject(), @@ -192,8 +171,6 @@ mod tests { #[test] fn test_default_context_not_duplicated_if_supplied() { - TEST_SUITE.include(test_name!()); - let options = VerifiableCredentialCreateOptions { context: Some(vec![BASE_CONTEXT.to_string()]), ..Default::default() @@ -206,8 +183,6 @@ mod tests { #[test] fn test_developer_provided_context_appended_to_default() { - TEST_SUITE.include(test_name!()); - let custom_context = "https://example.com/custom-context"; let options = VerifiableCredentialCreateOptions { context: Some(vec![custom_context.to_string()]), @@ -221,8 +196,6 @@ mod tests { #[test] fn test_default_type_added_if_not_supplied() { - TEST_SUITE.include(test_name!()); - let vc = create_vc( issuer(), credential_subject(), @@ -235,8 +208,6 @@ mod tests { #[test] fn test_default_type_not_duplicated_if_supplied() { - TEST_SUITE.include(test_name!()); - let options = VerifiableCredentialCreateOptions { r#type: Some(vec![BASE_TYPE.to_string()]), ..Default::default() @@ -249,8 +220,6 @@ mod tests { #[test] fn test_developer_provided_type_appended_to_default() { - TEST_SUITE.include(test_name!()); - let custom_type = "CustomType"; let options = VerifiableCredentialCreateOptions { r#type: Some(vec![custom_type.to_string()]), @@ -264,8 +233,6 @@ mod tests { #[test] fn test_id_generated_if_not_supplied() { - TEST_SUITE.include(test_name!()); - let vc = create_vc( issuer(), credential_subject(), @@ -279,8 +246,6 @@ mod tests { #[test] fn test_id_must_be_set_if_supplied() { - TEST_SUITE.include(test_name!()); - let custom_id = "custom-id"; let options = VerifiableCredentialCreateOptions { id: Some(custom_id.to_string()), @@ -294,8 +259,6 @@ mod tests { #[test] fn test_issuer_string_must_not_be_empty() { - TEST_SUITE.include(test_name!()); - let empty_issuer = Issuer::from(""); let result = create_vc( empty_issuer, @@ -313,8 +276,6 @@ mod tests { #[test] fn test_issuer_string_must_be_set() { - TEST_SUITE.include(test_name!()); - let vc = create_vc( issuer(), credential_subject(), @@ -327,8 +288,6 @@ mod tests { #[test] fn test_issuer_string_must_be_valid_did() { - TEST_SUITE.include(test_name!()); - let result = create_vc( Issuer::String("did:invalid-123".to_string()), credential_subject(), @@ -345,8 +304,6 @@ mod tests { #[test] fn test_issuer_object_id_must_not_be_empty() { - TEST_SUITE.include(test_name!()); - let issuer = Issuer::Object(ObjectIssuer { id: "".to_string(), name: "Example Name".to_string(), @@ -369,8 +326,6 @@ mod tests { #[test] fn test_issuer_object_id_must_be_valid_did() { - TEST_SUITE.include(test_name!()); - let result = create_vc( issuer(), CredentialSubject { @@ -393,8 +348,6 @@ mod tests { #[test] fn test_issuer_object_name_must_not_be_empty() { - TEST_SUITE.include(test_name!()); - let issuer = Issuer::Object(ObjectIssuer { id: ISSUER_DID_URI.to_string(), name: "".to_string(), @@ -417,8 +370,6 @@ mod tests { #[test] fn test_issuer_object_must_be_set() { - TEST_SUITE.include(test_name!()); - let issuer = Issuer::Object(ObjectIssuer { id: ISSUER_DID_URI.to_string(), name: "Example Name".to_string(), @@ -437,8 +388,6 @@ mod tests { #[test] fn test_issuer_object_supports_additional_properties() { - TEST_SUITE.include(test_name!()); - let additional_properties = JsonObject { properties: HashMap::from([( "extra_key".to_string(), @@ -469,8 +418,6 @@ mod tests { #[test] fn test_credential_subject_id_must_not_be_empty() { - TEST_SUITE.include(test_name!()); - let credential_subject = CredentialSubject::from(""); let result = create_vc( @@ -489,8 +436,6 @@ mod tests { #[test] fn test_credential_subject_must_be_set() { - TEST_SUITE.include(test_name!()); - let vc = create_vc( issuer(), credential_subject(), @@ -503,8 +448,6 @@ mod tests { #[test] fn test_credential_subject_supports_additional_properties() { - TEST_SUITE.include(test_name!()); - let additional_properties = JsonObject { properties: HashMap::from([( "extra_key".to_string(), @@ -532,8 +475,6 @@ mod tests { #[test] fn test_issuance_date_must_be_set() { - TEST_SUITE.include(test_name!()); - let issuance_date = SystemTime::now(); let options = VerifiableCredentialCreateOptions { @@ -548,8 +489,6 @@ mod tests { #[test] fn test_issuance_date_must_be_now_if_not_supplied() { - TEST_SUITE.include(test_name!()); - let vc = create_vc( issuer(), credential_subject(), @@ -565,8 +504,6 @@ mod tests { #[test] fn test_expiration_date_must_be_set_if_supplied() { - TEST_SUITE.include(test_name!()); - let expiration_date = SystemTime::now(); let options = VerifiableCredentialCreateOptions { expiration_date: Some(expiration_date), @@ -580,8 +517,6 @@ mod tests { #[test] fn test_evidence_must_be_set_if_supplied() { - TEST_SUITE.include(test_name!()); - let mut evidence_item = JsonObject::new(); evidence_item.insert_value("A Key", JsonValue::String("A Value".to_string())); let evidence = vec![evidence_item]; @@ -598,8 +533,6 @@ mod tests { #[test] fn test_schema_type_must_be_jsonschema() { - TEST_SUITE.include(test_name!()); - let result = create_vc( issuer(), credential_subject(), @@ -625,8 +558,6 @@ mod tests { #[test] fn test_schema_resolve_network_issue() { - TEST_SUITE.include(test_name!()); - let url = "invalid url".to_string(); // here let result = create_vc( @@ -651,8 +582,6 @@ mod tests { #[test] fn test_schema_resolve_non_success() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new(); let url = mock_server.url(); @@ -683,8 +612,6 @@ mod tests { #[test] fn test_schema_resolve_invalid_response_body() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new(); let url = mock_server.url(); @@ -717,8 +644,6 @@ mod tests { #[test] fn test_schema_invalid_json_schema() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new(); let url = mock_server.url(); @@ -754,8 +679,6 @@ mod tests { #[test] fn test_schema_do_not_support_draft04() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new(); let url = mock_server.url(); @@ -791,8 +714,6 @@ mod tests { #[test] fn test_schema_do_not_support_draft06() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new(); let url = mock_server.url(); @@ -828,8 +749,6 @@ mod tests { #[test] fn test_schema_fails_validation() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new(); let url = mock_server.url(); @@ -862,8 +781,6 @@ mod tests { #[test] fn test_schema_example_from_spec() { - TEST_SUITE.include(test_name!()); - // using Example 1 & Example 2 from here https://www.w3.org/TR/vc-json-schema/#jsonschema let mut mock_server = Server::new(); diff --git a/crates/web5/src/credentials/sign.rs b/crates/web5/src/credentials/sign.rs index 7d56e99d..ac134d15 100644 --- a/crates/web5/src/credentials/sign.rs +++ b/crates/web5/src/credentials/sign.rs @@ -55,8 +55,6 @@ pub fn sign_with_did( mod tests { use super::*; use crate::credentials::credential_subject::CredentialSubject; - use crate::{test_helpers::UnitTestSuite, test_name}; - use lazy_static::lazy_static; const SUBJECT_DID_URI: &str = "did:dht:qgmmpyjw5hwnqfgzn7wmrm33ady8gb8z9ideib6m9gj4ys6wny8y"; @@ -69,27 +67,8 @@ mod tests { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = - UnitTestSuite::new("verifiable_credential_1_1_sign"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_can_sign_then_verify() { - TEST_SUITE.include(test_name!()); - let bearer_did = DidJwk::create(None).unwrap(); let vc = VerifiableCredential::create( Issuer::String(bearer_did.did.uri.clone()), @@ -108,8 +87,6 @@ mod tests { #[test] fn test_bearer_did_mismatch_issuer() { - TEST_SUITE.include(test_name!()); - let bearer_did = DidJwk::create(None).unwrap(); let vc = VerifiableCredential::create( Issuer::String(bearer_did.did.uri.clone()), @@ -137,8 +114,6 @@ mod tests { #[test] fn test_defaults_to_first_vm() { - TEST_SUITE.include(test_name!()); - let bearer_did = DidJwk::create(None).unwrap(); let vc = VerifiableCredential::create( Issuer::String(bearer_did.did.uri.clone()), @@ -157,8 +132,6 @@ mod tests { #[test] fn test_vm_must_be_assertion_method() { - TEST_SUITE.include(test_name!()); - let mut bearer_did = DidJwk::create(None).unwrap(); let vc = VerifiableCredential::create( Issuer::String(bearer_did.did.uri.clone()), diff --git a/crates/web5/src/credentials/verifiable_credential_1_1.rs b/crates/web5/src/credentials/verifiable_credential_1_1.rs index e4ad81bb..84671ff7 100644 --- a/crates/web5/src/credentials/verifiable_credential_1_1.rs +++ b/crates/web5/src/credentials/verifiable_credential_1_1.rs @@ -235,20 +235,11 @@ mod tests { mod from_vc_jwt { use super::*; use crate::credentials::credential_schema::CREDENTIAL_SCHEMA_TYPE; + use crate::dids::resolution::resolution_metadata::ResolutionMetadataError; use crate::json::JsonValue; use crate::{credentials::VerificationError, errors::Web5Error}; - use crate::{ - dids::resolution::resolution_metadata::ResolutionMetadataError, - test_helpers::UnitTestSuite, test_name, - }; - use lazy_static::lazy_static; use mockito::{Server, ServerOpts}; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = - UnitTestSuite::new("verifiable_credential_1_1_from_vc_jwt"); - } - fn assert_credential_error(result: Result, expected_error: VerificationError) where T: std::fmt::Debug, @@ -290,22 +281,8 @@ mod tests { ) } - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_missing_kid_jose_header() { - TEST_SUITE.include(test_name!()); - let vc_jwt_without_kid = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmEzYzY3NGI5LTliNGUtNGE2OS1hYzUwLWM3N2JhYzY0OTg2MCIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKclZ6YzNjbnA2VTNGUExYSkxUekpIY1hwd04zRk9TRGhEYWtORmJFMHpabmhMUmtWcVdFTmtaRWxWSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yN1QyMDo0NzoyNS4xMTk2MjQrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnJWemMzY25wNlUzRlBMWEpMVHpKSGNYcHdOM0ZPU0RoRGFrTkZiRTB6Wm5oTFJrVnFXRU5rWkVsVkluMCIsImp0aSI6InVybjp1dWlkOmEzYzY3NGI5LTliNGUtNGE2OS1hYzUwLWM3N2JhYzY0OTg2MCIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDc5MTY0NSwiaWF0IjoxNzI0NzkxNjQ1fQ.ocOyYhqFwz4Jvkdwpa69oFDXCOr2n-_IXSHg5elFebOM0T_lx3Cs6DgQJ7YLLk--mAOvPqrH05bh92BSaLB_DQ"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_without_kid, true); @@ -315,8 +292,6 @@ mod tests { #[test] fn test_empty_kid_jose_header() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_empty_kid = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6IiJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmE5MzcwYTZjLWFmND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ri() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_invalid_did_uri = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImludmFsaWQgZGlkIHVyaSJ9.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmFhYzFmN2M5LTIzOWQtNGE4OC05NDBiLTEwOTk3NmViNWYyNCIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiaW52YWxpZCBkaWQgdXJpIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMjozMDowOC41OTAxOTcrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImludmFsaWQgZGlkIHVyaSIsImp0aSI6InVybjp1dWlkOmFhYzFmN2M5LTIzOWQtNGE4OC05NDBiLTEwOTk3NmViNWYyNCIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg0ODIwOCwiaWF0IjoxNzI0ODQ4MjA4fQ.YdmnfP0wIK5HDu8Lft52UFdZCzfdFO0rclAOF-mWt6Y1vqAgoyuOn7AnX1Lx782-iWaekKApCGqCTaXepzj4CQ"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_invalid_did_uri, true); @@ -347,8 +320,6 @@ mod tests { #[test] fn test_kid_fail_to_resolve_did() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_invalid_did_resolution = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpkaHQ6c29tZXRoaW5nLWludmFsaWQifQ.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjhiNGM1NmI5LTM1ODgtNGM0Mi1iOTg3LWEwZTAxNDFmNzA2YSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmRodDpzb21ldGhpbmctaW52YWxpZCIsImlzc3VhbmNlRGF0ZSI6IjIwMjQtMDgtMjhUMTI6MzQ6NDguMzMzMjg5KzAwOjAwIiwiZXhwaXJhdGlvbkRhdGUiOm51bGwsImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImlkIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5In19LCJpc3MiOiJkaWQ6ZGh0OnNvbWV0aGluZy1pbnZhbGlkIiwianRpIjoidXJuOnV1aWQ6OGI0YzU2YjktMzU4OC00YzQyLWI5ODctYTBlMDE0MWY3MDZhIiwic3ViIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODQ4NDg4LCJpYXQiOjE3MjQ4NDg0ODh9.hXbWLVU8ef38O5SY-HshVhXPM1RadFEAGRj0ds5Yjw1_lweWxe1-CNJxLmo0D4BiRCo4T4hCWP_bkwRoteImBA"#; let result = @@ -364,8 +335,6 @@ mod tests { #[test] fn test_kid_missing_verification_method() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_missing_vm = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSm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jZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODQ4ODQyLCJpYXQiOjE3MjQ4NDg4NDJ9.g-KcBy9jJ87PvIZkBUDPkBVF-dlnSTsLUVxOxB4az5q64aIDFJNTffVETD3Cq0fjXKX3tZq3QpfzmNoiTo4xBQ"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_missing_vm, true); @@ -380,8 +349,6 @@ mod tests { #[test] fn test_fails_cryptographic_verification() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_invalid_signature = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZDI1NTE5Iiwia2lkIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKMmJGOUNOVTB6UzFwclNXdDNTMDg1VGpKRlVFTTFjVE5IVGxoamQwWktObFl0VlU5RkxTMUlVa3MwSW4wIzAifQ.eyJpc3MiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUoyYkY5Q05VMHpTMXByU1d0M1MwODVUakpGVUVNMWNUTkhUbGhqZDBaS05sWXRWVTlGTFMxSVVrczBJbjAiLCJqdGkiOiJ1cm46dXVpZDoyMWUxNWRjYi0xM2MzLTQwYTYtYWJiNS01NTA3Nzg5Zjk4YmEiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjU4OTU2NTYsImlhdCI6MTcyNTg5NTY1NiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCJdLCJpc3N1ZXIiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUoyYkY5Q05VMHpTMXByU1d0M1MwODVUakpGVUVNMWNUTkhUbGhqZDBaS05sWXRWVTlGTFMxSVVrczBJbjAiLCJpZCI6InVybjp1dWlkOjIxZTE1ZGNiLTEzYzMtNDBhNi1hYmI1LTU1MDc3ODlmOThiYSIsImlzc3VhbmNlRGF0ZSI6IjIwMjQtMDktMDlUMTU6Mjc6MzZaIn19.6AR3aNzlMDgRpniSMhOGfXN3wUS0IkIoWa_KpZprOWwVbSyVjcI_Ndo3SGCutUSiBboYH9sFomdGb7_0AeVDCg"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_invalid_signature, true); @@ -396,8 +363,6 @@ mod tests { #[test] fn test_passes_cryptographic_verification() { - TEST_SUITE.include(test_name!()); - let vc_jwt_valid = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSkhWelpGVERsSVRUbHRkSGx5Y0dsWWRGRlVNR3B4Wms1MmFXTm5RVGxCVkRnME1IWTFZMDh5YjFSckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjZmYTQ2MDVjLWFlZGItNGQ2NC05NzdiLTFmY2NmYTU1ZTM1ZiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKSFZ6WkZURGxJVFRsdGRIbHljR2xZZEZGVU1HcHhaazUyYVdOblFUbEJWRGcwTUhZMVkwOHliMVJySW4wIzAiLCJpc3N1YW5jZURhdGUiOiIyMDI0LTA4LTI4VDEyOjQyOjI3Ljc3Mjg4OSswMDowMCIsImV4cGlyYXRpb25EYXRlIjpudWxsLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSJ9fSwiaXNzIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKSFZ6WkZURGxJVFRsdGRIbHljR2xZZEZGVU1HcHhaazUyYVdOblFUbEJWRGcwTUhZMVkwOHliMVJySW4wIzAiLCJqdGkiOiJ1cm46dXVpZDo2ZmE0NjA1Yy1hZWRiLTRkNjQtOTc3Yi0xZmNjZmE1NWUzNWYiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjQ4NDg5NDcsImlhdCI6MTcyNDg0ODk0N30.-JwIGYZ9HlJASYxdRBWY5KlwP0iJUxWUOU6BsOR74VeC-zKgZb9WWZR08OVD-wv0X8KD5--0K5Dr9r5fL3B0Aw"#; let vc = VerifiableCredential::from_vc_jwt(vc_jwt_valid, true) @@ -410,8 +375,6 @@ mod tests { #[test] fn test_can_skip_cryptographic_verification() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_invalid_signature = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZ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CJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjQ4NDg5NDcsImlhdCI6MTcyNDg0ODk0N30.-JwIGYZ9HlJASYxdRBWY5KlwP0iJUxWUOU6BsOR74VeC-zKgZb9WWZR08OVD-wv0X8KD5--0K5Dr9r5fL3B0Aw-invalid-signature"#; let vc = VerifiableCredential::from_vc_jwt(vc_jwt_with_invalid_signature, false) @@ -421,8 +384,6 @@ mod tests { #[test] fn test_can_skip_data_model_validation() { - TEST_SUITE.include(test_name!()); - // expired would throw an error, but since verify=false it doesn't let vc_jwt_with_expired = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpjV3hxVTJaZlgzbE9TVVpKTVVwaWNYQkVSVEJuVUZGT2FVazBiVkZqV2pONmRtZFVVbmg2WTAxbkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmFkNzBmN2Y2LWExNTctNGYxZi1hZjI5LTdjYmJkNDRmODlmMCIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKemNXeHFVMlpmWDNsT1NVWkpNVXBpY1hCRVJUQm5VRkZPYVVrMGJWRmpXak42ZG1kVVVuaDZZMDFuSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzo0NDoyNy45MTUwMjUrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6IjIwMTktMDktMDRUMTM6NDQ6MjcuOTE0ODY0KzAwOjAwIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpjV3hxVTJaZlgzbE9TVVpKTVVwaWNYQkVSVEJuVUZGT2FVazBiVkZqV2pONmRtZFVVbmg2WTAxbkluMCIsImp0aSI6InVybjp1dWlkOmFkNzBmN2Y2LWExNTctNGYxZi1hZjI5LTdjYmJkNDRmODlmMCIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg1MjY2NywiaWF0IjoxNzI0ODUyNjY3LCJleHAiOjE1Njc2MDQ2Njd9.pP_8QVzTqxuhUlIWpXDWQ3Py_VlDA4uX82xdD9GOdmRT2UK-K5Gn7A5qdUxBPhXifiRVnH_Q8NbWZCUQ8jZUBg"#; @@ -433,8 +394,6 @@ mod tests { #[test] fn test_can_skip_credential_schema_validation() { - TEST_SUITE.include(test_name!()); - // expired would throw an error, but since verify=false it doesn't let vc_jwt_with_invalid_schema = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXlkMjFXVjFwblMySk1iM0JPVEhWTmRYUlNSV2gwTWtWMmJEbExkVkpFTFY5MlVrRnpWMlZwUm01TkluMCMwIn0.eyJ2YyI6eyJAY29udGV4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UwMjk3MzUsImlhdCI6MTcyNTAyOTczNX0.8zNS9RWIpvTlMvAzaI9dNSjKKM1drFig7bKhQeQ6Mv9hWXwazvDhxthy3D25EmITWAPiJfGcMPDqoDobETf8DA"#; @@ -445,8 +404,6 @@ mod tests { #[test] fn test_decode_issuer_string() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_issuer_as_string = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnlkMmhYU1VOWWNsSjNiMFphUm1SMU0wbHNOaTFCTkdVdGRqazNRbE14UmtaUmFWRTRhV05tV2t0ckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjc0NTY5ZmIzLWMyZTktNGZiMy1hOThkLWY3NGFjNzVjYTg5NSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKeWQyaFhTVU5ZY2xKM2IwWmFSbVIxTTBsc05pMUJOR1V0ZGprM1FsTXhSa1pSYVZFNGFXTm1Xa3RySW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxNjozNjoyOS4zNDc4ODArMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnlkMmhYU1VOWWNsSjNiMFphUm1SMU0wbHNOaTFCTkdVdGRqazNRbE14UmtaUmFWRTRhV05tV2t0ckluMCIsImp0aSI6InVybjp1dWlkOjc0NTY5ZmIzLWMyZTktNGZiMy1hOThkLWY3NGFjNzVjYTg5NSIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg2Mjk4OSwiaWF0IjoxNzI0ODYyOTg5fQ.0DSZ2XbPtjtrtxNKo3tImoByb1-jlQxZQN11lsngaFSe4lhy4mYmaxGAby4wIl-c_cLEkgBULfF3Qa_dlNSTCw"#; let vc = VerifiableCredential::from_vc_jwt(&vc_jwt_with_issuer_as_string, false) @@ -464,8 +421,6 @@ mod tests { #[test] fn test_decode_issuer_object() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_issuer_object = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSTFVazF5YVVNMVZsaHVielpTVkRoTVdWVnJibnBKWm5OamFUUXlZbXhCYVdsTFdrcENaR2huVm5WQkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjcwNWM0MTZiLTU1ODYtNDUzMS1hMmRmLWI3YzdhNTMxMGY5NiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjp7ImlkIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJMVVrMXlhVU0xVmxodWJ6WlNWRGhNV1ZWcmJucEpabk5qYVRReVlteEJhV2xMV2twQ1pHaG5WblZCSW4wIiwibmFtZSI6InNvbWUgbmFtZSJ9LCJpc3N1YW5jZURhdGUiOiIyMDI0LTA4LTI4VDE2OjQwOjExLjUwNDIyMCswMDowMCIsImV4cGlyYXRpb25EYXRlIjpudWxsLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSJ9fSwiaXNzIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJMVVrMXlhVU0xVmxodWJ6WlNWRGhNV1ZWcmJucEpabk5qYVRReVlteEJhV2xMV2twQ1pHaG5WblZCSW4wIiwianRpIjoidXJuOnV1aWQ6NzA1YzQxNmItNTU4Ni00NTMxLWEyZGYtYjdjN2E1MzEwZjk2Iiwic3ViIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODYzMjExLCJpYXQiOjE3MjQ4NjMyMTF9.Mv-wlUcnj0w-OWuoMBCciaQXrAogXL3qqgZnthTRI9f55S5PidYiSapWFxFqc4SzxTVSpe64H2vF7kfGU-QpBw"#; let vc = VerifiableCredential::from_vc_jwt(&vc_jwt_with_issuer_object, false) @@ -484,8 +439,6 @@ mod tests { #[test] fn test_decode_evidence() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_evidence = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5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Q1YzVmNSIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNTAxMjA4NCwiaWF0IjoxNzI1MDEyMDg0fQ.M7t4Ox08v-rC-naPSfIqlE1KKhZ1nrx_QA2HbuW38AkgxnSZOYEpXEG1UTAzh6mdwKZin9jwoGrj29u24K1ABA"#; let vc = VerifiableCredential::from_vc_jwt(&vc_jwt_with_evidence, false) .expect("should be valid vc jwt"); @@ -498,8 +451,6 @@ mod tests { #[test] fn test_decode_credential_schema() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_credential_schema = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSTFUMXB2TVd4bU9VcHlOeTFZTkdGWU4yRmxka2N5WVU5MGEwWmxlSFZuYzBwcVZVbEtWVU5UYVVkUkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjNhMDU2NjE1LWNlZDMtNGQ4Zi05ODRhLTUwMzQ2Y2FlNDQ2ZiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJMVQxcHZNV3htT1VweU55MVlOR0ZZTjJGbGRrY3lZVTkwYTBabGVIVm5jMHBxVlVsS1ZVTlRhVWRSSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0zMFQxNDo1OToyMi4xMDMzODUrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifSwiY3JlZGVudGlhbFNjaGVtYSI6eyJpZCI6Imh0dHBzOi8vZXhhbXBsZS5jb20vc2NoZW1hcy9lbWFpbC5qc29uIiwidHlwZSI6Ikpzb25TY2hlbWEifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSTFUMXB2TVd4bU9VcHlOeTFZTkdGWU4yRmxka2N5WVU5MGEwWmxlSFZuYzBwcVZVbEtWVU5UYVVkUkluMCIsImp0aSI6InVybjp1dWlkOjNhMDU2NjE1LWNlZDMtNGQ4Zi05ODRhLTUwMzQ2Y2FlNDQ2ZiIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNTAyOTk2MiwiaWF0IjoxNzI1MDI5OTYyfQ.ZQkusfYLJSpfLVF9OuWrrhw8NdcBnjlalMFZbsfAxJp8i74KH47RkMsVVPadLPuKwbozgcDRCKPsokrl33TuCw"#; let vc = VerifiableCredential::from_vc_jwt(&vc_jwt_with_credential_schema, false) .expect("should be valid vc jwt"); @@ -514,8 +465,6 @@ mod tests { #[test] fn test_decode_missing_vc_claim() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_missing_vc_claim = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSlNSbkZSVlVWS1RFOVhlbXh3T1ZaRk1rdEtSalp6UjBwT00yVnpaWHBsY0hSSE0ySTFlbTh4YjAwNEluMCMwIn0.eyJpc3MiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUpTUm5GUlZVVktURTlYZW14d09WWkZNa3RLUmpaelIwcE9NMlZ6WlhwbGNIUkhNMkkxZW04eGIwMDRJbjAiLCJqdGkiOiJ1cm46dXVpZDozNmU0ZjllNi0yYzdjLTQ0NGMtOTI4OS0zNDhmY2IxNDZlYjYiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjQ4NTA1MjIsImlhdCI6MTcyNDg1MDUyMn0.SqwZC0q9RuHp9hAtFmE6sBYeJ1uHuuq1hyijF0NmW9nksSBqtDpfNroNlitK_Tl-CLWtwbTpK3b3JduTfzGEAw"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_missing_vc_claim, true); assert_credential_error(result, VerificationError::MissingClaim("vc".to_string())); @@ -523,8 +472,6 @@ mod tests { #[test] fn test_decode_missing_jti_claim() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_missing_jti_claim = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSm5jMjlTZGsxUFlXMHliMlJQTlY4NWVqbExlV2xzV1VzM1Yzb3RZa1owWW5wdlVrWm1iVTlUTVRJNEluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjEwODM2MzgwLWI2MmMtNGVmZC04YmU0LTZhNzJiMDZjYWI4NyIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKbmMyOVNkazFQWVcweWIyUlBOVjg1ZWpsTGVXbHNXVXMzVjNvdFlrWjBZbnB2VWtabWJVOVRNVEk0SW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzoxMDo1NS4yMDYwOTIrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSm5jMjlTZGsxUFlXMHliMlJQTlY4NWVqbExlV2xzV1VzM1Yzb3RZa1owWW5wdlVrWm1iVTlUTVRJNEluMCIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg1MDY1NSwiaWF0IjoxNzI0ODUwNjU1fQ.1XDmdvB1GDsCHw9Qwp0HA5r8W-JnZB4lz9Yqo0C2V_EEe-uk88bQSl8P9HV8ViNyBC_YaYatLiPTD4jBZY77DA"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_missing_jti_claim, true); assert_credential_error(result, VerificationError::MissingClaim("jti".to_string())); @@ -532,8 +479,6 @@ mod tests { #[test] fn test_decode_missing_issuer_claim() { - TEST_SUITE.include(test_name!()); - let v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Q.hwR6edt6ItlN0HHkDcxzhE3N5hLk-5-VYDLrqkalUoTKB41vsfaPvGnt_UQK3EAuekQgrTQ0SuCq-6ut0EdlBw"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_missing_iss_claim, true); @@ -548,8 +493,6 @@ mod tests { #[test] fn test_decode_missing_subject_claim() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_missing_sub_claim = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSldiRFprTjFFMWRXOTNSMVk1TWxsRlVWSkxOMnROWkdRM1lYcFJiMGxsU0hac1FXaFNSMVJmTlRJMEluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjBmYTE0MTgxLTllMWYtNDk0ZC05ZmVmLWMwYjgxZDE1ZGJiYiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKV2JEWmtOMUUxZFc5M1IxWTVNbGxGVVZKTE4ydE5aR1EzWVhwUmIwbGxTSFpzUVdoU1IxUmZOVEkwSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzoxMjo0NS40NTg4MjYrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSldiRFprTjFFMWRXOTNSMVk1TWxsRlVWSkxOMnROWkdRM1lYcFJiMGxsU0hac1FXaFNSMVJmTlRJMEluMCIsImp0aSI6InVybjp1dWlkOjBmYTE0MTgxLTllMWYtNDk0ZC05ZmVmLWMwYjgxZDE1ZGJiYiIsIm5iZiI6MTcyNDg1MDc2NSwiaWF0IjoxNzI0ODUwNzY1fQ.61IFQhdASbbcYKUzMfhO7WPmikBd8AoE468FTlqRysxXck7kNa3bAAow3jK2uhYrIWLyRu3kuBp7JyYhLavjBw"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_missing_sub_claim, true); @@ -564,8 +507,6 @@ mod tests { #[test] fn test_decode_missing_nbf_claim() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_missing_nbf_claim = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXdOR1ZzZGxGdlJWbDBZbEJIT0RsWlVtaGpTR2RJT1cwMlMzSjZiRVkyUWpGUldrZGxOR2RGUjJKakluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjk3OGZhZTIxLTVmMDYtNDBmNy1iZTJmLTM4MzRmZGMwZDY0NSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJd05HVnNkbEZ2UlZsMFlsQkhPRGxaVW1oalNHZElPVzAyUzNKNmJFWTJRakZSV2tkbE5HZEZSMkpqSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzoxMzoyNi4zMzQzNjYrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXdOR1ZzZGxGdlJWbDBZbEJIT0RsWlVtaGpTR2RJT1cwMlMzSjZiRVkyUWpGUldrZGxOR2RGUjJKakluMCIsImp0aSI6InVybjp1dWlkOjk3OGZhZTIxLTVmMDYtNDBmNy1iZTJmLTM4MzRmZGMwZDY0NSIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsImlhdCI6MTcyNDg1MDgwNn0.ZXfuZmvddH1nvmub8WDpQ2UEOhuiLaN6WL2q3XDhn0eouM_bNVa7vmCUCUZc3sfJ1YCtnAGCJOlJxSGnD3tOCw"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_missing_nbf_claim, true); @@ -583,8 +524,6 @@ mod tests { #[test] fn test_decode_claim_mismatch_id() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_mismatch_id = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnZTWHBSUjJkTmNGTlNPSEpRWT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DVYLlVxuZTNJl-Km-j2S1KusTjRTDkg1DqQoiVvp2Is0kr5WoAFBA"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_mismatch_id, true); @@ -599,8 +538,6 @@ mod tests { #[test] fn test_decode_claim_mismatch_issuer() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_mismatch_issuer = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXpWRVZsYWs0emIzSXpUbXR4WkZWVllYQjZaMVZ5TFcxblZFTkNkWEZRWVZkT1JWcE9lRXcwWkhRd0luMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjJiNzQzNWY0LWU0YjctNGQyZC1iN2M2LTVkOTE5ODRlNDlhOCIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoic29tZXRoaW5nIGludmFsaWQiLCJpc3N1YW5jZURhdGUiOiIyMDI0LTA4LTI4VDEzOjE3OjQ1LjI4ODk2NiswMDowMCIsImV4cGlyYXRpb25EYXRlIjpudWxsLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSJ9fSwiaXNzIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJelZFVmxhazR6YjNJelRtdHhaRlZWWVhCNloxVnlMVzFuVkVOQ2RYRlFZVmRPUlZwT2VFdzBaSFF3SW4wIiwianRpIjoidXJuOnV1aWQ6MmI3NDM1ZjQtZTRiNy00ZDJkLWI3YzYtNWQ5MTk4NGU0OWE4Iiwic3ViIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODUxMDY1LCJpYXQiOjE3MjQ4NTEwNjV9.x0UY38J4lEwmrXR4qrzhnk58btjZfMf8DVhdgBoj9M0JOgJqCDFCzwcS5weVCpNAv3gN72Qo32RH9Tx0eYyoDA"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_mismatch_issuer, true); @@ -615,8 +552,6 @@ mod tests { #[test] fn test_decode_claim_mismatch_subject() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_mismatch_subject = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXdVRmh0UkVNMlNIWnVia1E0Vmw5QkxWbDVSelZ1TWtSa2IxQkdTVFkxY2tkb2MwVTVZWFZsWW5CckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjAwNDJiYTQ4LWU0ZGYtNGVhMS04ZmJjLWJjYmI4ODY3ZjFhMCIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJd1VGaHRSRU0yU0hadWJrUTRWbDlCTFZsNVJ6VnVNa1JrYjFCR1NUWTFja2RvYzBVNVlYVmxZbkJySW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzoxOToxMC4xNjM0ODkrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJzb21ldGhpbmcgaW52YWxpZCJ9fSwiaXNzIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJd1VGaHRSRU0yU0hadWJrUTRWbDlCTFZsNVJ6VnVNa1JrYjFCR1NUWTFja2RvYzBVNVlYVmxZbkJySW4wIiwianRpIjoidXJuOnV1aWQ6MDA0MmJhNDgtZTRkZi00ZWExLThmYmMtYmNiYjg4NjdmMWEwIiwic3ViIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODUxMTUwLCJpYXQiOjE3MjQ4NTExNTB9.bAm9kKJX2-Rcw679VS7cUPbqg9awuq5Lwu9wiZoGcE0TCSc59rQTIP4nvxlP22o3V-VVs_DbfpJU-qB4duDSCA"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_mismatch_subject, true); @@ -631,8 +566,6 @@ mod tests { #[test] fn test_decode_claim_misconfigured_exp() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_misconfigured_exp = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnJkWFI2V21WM01EVTBMVlUwUVRBM2FsYzJZbkkxUlV4NU1UQlpOSGxPVTFCaVkyOTNXakJ3TjJWakluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJd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erifiableCredential::from_vc_jwt(vc_jwt_with_misconfigured_exp, true); @@ -652,8 +585,6 @@ mod tests { #[test] fn test_decode_claim_mismatch_exp() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_mismatch_exp = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSk1lWEJmUjJVelVEZGtjbVZhYTJSV1VsTnJZbmROVldkcVkxUTRhMHd6VUVVMk1Hc3pZMGgzVTJ0ckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjRhMjA2YmMzLWZmOTYtNDMwNS1iMzM4LTJiZGQ1ODRiYzkyOSIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKTWVYQmZSMlV6VURka2NtVmFhMlJXVWxOclluZE5WV2RxWTFRNGEwd3pVRVUyTUdzelkwaDNVMnRySW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzoyNzozMy40Mjg1NjMrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6IjIwMjktMDgtMjJUMTM6Mjc6MzMuNDI4NDgyKzAwOjAwIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSk1lWEJmUjJVelVEZGtjbVZhYTJSV1VsTnJZbmROVldkcVkxUTRhMHd6VUVVMk1Hc3pZMGgzVTJ0ckluMCIsImp0aSI6InVybjp1dWlkOjRhMjA2YmMzLWZmOTYtNDMwNS1iMzM4LTJiZGQ1ODRiYzkyOSIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg1MTY1MywiaWF0IjoxNzI0ODUxNjUzLCJleHAiOjE4ODUxMjM2NTN9.lAaTG8RhL2D92iNI6psZrv1uhtHYAO0m0AacGIQrW0XIThg-Livef36_CN9t4Lz2Ta5US2Be2VP6D3lCA-z1DQ"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_mismatch_exp, true); @@ -673,8 +604,6 @@ mod tests { #[test] fn test_validate_dm_empty_id() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_empty_id = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmxja0pYTmpoTVpXWlVZbGhEU0Zwck5VeG5OVVl5U3pSalJrVmlNVmhNYlVWa1VVNWxTbVJKV2pkTkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6IiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKbGNrSlhOamhNWldaVVlsaERTRnByTlV4bk5VWXlTelJqUmtWaU1WaE1iVVZrVVU1bFNtUkpXamROSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzozMDo1My44NDQ2ODMrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6IjIwMjktMDgtMjJUMTM6MzA6NTMuODQ0NjMwKzAwOjAwIiwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmxja0pYTmpoTVpXWlVZbGhEU0Zwck5VeG5OVVl5U3pSalJrVmlNVmhNYlVWa1VVNWxTbVJKV2pkTkluMCIsImp0aSI6IiIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg1MTg1MywiaWF0IjoxNzI0ODUxODUzLCJleHAiOjE4ODIwOTk4NTN9.X_jkleLbhdAo0vm7KtN0qr6nR6hvWrXxk08UslfZAhZCkDN2kqLvWhoHps3GNznmGAuhJxwhZ0SN60OV7pp1DQ"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_empty_id, true); @@ -694,8 +623,6 @@ mod tests { #[test] fn test_validate_dm_empty_context() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_empty_context = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSjFSbXRGTVdkblNGcENaME4yY1doa1VqRkJZel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UtYCruMWsfYMc_CKfl5g7m6-zwDW8SpDzAw"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_empty_context, true); @@ -715,8 +642,6 @@ mod tests { #[test] fn test_validate_dm_context_base_mismatch() { - TEST_SUITE.include(test_name!()); - let vc_jwt_without_base_context = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnFSVWRmU1V4TlZDMVVUMGgyTjIxeFJ6UlJWVmRMTWs1dU9FcGlUVU5OWldKQ1pXVjRkVGxIYlhWWkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJhIGNvbnRleHQiXSwiaWQiOiJ1cm46dXVpZDo4N2VmMDI1MC0yYWE2LTQyNTctYjIxMi0xYzAyMWFhZDY2Y2YiLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIl0sImlzc3VlciI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnFSVWRmU1V4TlZDMVVUMGgyTjIxeFJ6UlJWVmRMTWs1dU9FcGlUVU5OWldKQ1pXVjRkVGxIYlhWWkluMCIsImlzc3VhbmNlRGF0ZSI6IjIwMjQtMDgtMjhUMTM6MzQ6MjcuODk4MDkwKzAwOjAwIiwiZXhwaXJhdGlvbkRhdGUiOm51bGwsImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImlkIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5In19LCJpc3MiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUpxUlVkZlNVeE5WQzFVVDBoMk4yMXhSelJSVlZkTE1rNXVPRXBpVFVOTlpXSkNaV1Y0ZFRsSGJYVlpJbjAiLCJqdGkiOiJ1cm46dXVpZDo4N2VmMDI1MC0yYWE2LTQyNTctYjIxMi0xYzAyMWFhZDY2Y2YiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjQ4NTIwNjcsImlhdCI6MTcyNDg1MjA2N30.cgkGQF5CXqHw_C1KNaKLFeIzPzmBuWRzRk-7KgvEYc1jJzwoXoOWB6cn-8I3MjWAgd_NeM1Yt656lJ60gy0RAQ"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_without_base_context, true); @@ -735,8 +660,6 @@ mod tests { #[test] fn test_validate_dm_empty_type() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_empty_type = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSTJSV2Q2T0RZeGExRjNVMTh3U25SWVVqQlJha3BtWldOemQyVkJiRWN3UzBadGMwZGxUa0ZoZVdwQkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmNmNjQ1MTNiLTIwODQtNDliNC1iNWMzLTgxZTk1ODNjOTcyOCIsInR5cGUiOltdLCJpc3N1ZXIiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUkyUldkNk9EWXhhMUYzVTE4d1NuUllVakJSYWtwbVpXTnpkMlZCYkVjd1MwWnRjMGRsVGtGaGVXcEJJbjAiLCJpc3N1YW5jZURhdGUiOiIyMDI0LTA4LTI4VDEzOjM1OjM2LjkxMzQyNyswMDowMCIsImV4cGlyYXRpb25EYXRlIjpudWxsLCJjcmVkZW50aWFsU3ViamVjdCI6eyJpZCI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSJ9fSwiaXNzIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJMlJXZDZPRFl4YTFGM1UxOHdTblJZVWpCUmFrcG1aV056ZDJWQmJFY3dTMFp0YzBkbFRrRmhlV3BCSW4wIiwianRpIjoidXJuOnV1aWQ6Y2Y2NDUxM2ItMjA4NC00OWI0LWI1YzMtODFlOTU4M2M5NzI4Iiwic3ViIjoiZGlkOmRodDpxZ21tcHlqdzVod25xZmd6bjd3bXJtMzNhZHk4Z2I4ejlpZGVpYjZtOWdqNHlzNndueTh5IiwibmJmIjoxNzI0ODUyMTM2LCJpYXQiOjE3MjQ4NTIxMzZ9.EY1q2nZHnPk-hnzdScvf6QYA0ko_sshHWOnPxU9tkU-RhxdklRoO9JQgmoHZC1FdDgEfgs4nDFNUKyX-FlJPBw"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_empty_type, true); @@ -756,8 +679,6 @@ mod tests { #[test] fn test_validate_dm_type_base_mismatch() { - TEST_SUITE.include(test_name!()); - let vc_jwt_without_base_type = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSlJTMjVyVDNvd2RETkpRWGRqVWtGamQyTjFkVWxKU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kQdYkd4IqAXF8_uhcOe_sX9joDWspBSxwP3BY6ESCPIpJoms_dPIp01RWABA"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_without_base_type, true); @@ -777,8 +698,6 @@ mod tests { #[test] fn test_validate_dm_empty_issuer() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_empty_issuer = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnRPSEZRTVhoR1p6RndZMlpqZUY5UWVrUnJOMjFPYVhoak9YQTFWamN4WlVZelYwRTViSGwzTWpsckluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmFhMmNjNWNkLTg4N2QtNDFkMi1iZTM3LTIzMjMxMGVkODdjMiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzozOToxNS42MjMzOTMrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6IiIsImp0aSI6InVybjp1dWlkOmFhMmNjNWNkLTg4N2QtNDFkMi1iZTM3LTIzMjMxMGVkODdjMiIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTcyNDg1MjM1NSwiaWF0IjoxNzI0ODUyMzU1fQ.mRYZKF3qNz_Vyg8xpemuBOipGLOliYy9xJ6b9ZqcMNjZbb8GtEyiaBv8rgF2jqmHreRT71wHaT3P6mV9GsQOCA"#; let vc = decode(vc_jwt_with_empty_issuer, true).unwrap(); @@ -797,8 +716,6 @@ mod tests { #[test] fn test_validate_dm_empty_subject() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_empty_subject = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpOakV6U1hobGFWWk9WMW81YzBaM1NrdE1OSEI2WkdaRlRsWXRWVEZxYkMweVNIcFpXV2hCUWxWM0luMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjNkNGMzMjQxLWU0NDUtNGE2Ny1hYmE0LTIxYjBmM2NkMmMxYyIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKek5qRXpTWGhsYVZaT1YxbzVjMFozU2t0TU5IQjZaR1pGVGxZdFZURnFiQzB5U0hwWldXaEJRbFYzSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0yOFQxMzo0MToxMC4xNzM2NzIrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiIifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpOakV6U1hobGFWWk9WMW81YzBaM1NrdE1OSEI2WkdaRlRsWXRWVEZxYkMweVNIcFpXV2hCUWxWM0luMCIsImp0aSI6InVybjp1dWlkOjNkNGMzMjQxLWU0NDUtNGE2Ny1hYmE0LTIxYjBmM2NkMmMxYyIsInN1YiI6IiIsIm5iZiI6MTcyNDg1MjQ3MCwiaWF0IjoxNzI0ODUyNDcwfQ.Ek9NMfHyb8BzJ7GnV0JRQPVl-UQyMOCMZ2_ABMx9Cvh8d8T81wMjrYUPp6v57-veqKntYFO_WZciL2FC_VZWAw"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_empty_subject, true); @@ -818,8 +735,6 @@ mod tests { #[test] fn test_validate_dm_issuance_in_future() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_issuance_date_in_future = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmhhazFPTms1Zk1rOVRWbVl5TFdGd1VsOW1VbWRwVG1OMVNVMXphVWMzTVhaM2FYVnBVSGd4YTFOTkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjJiODhmMDhmLTVkOGItNDJiYS1iYmY0LTg4MjU1MjlmOGE2NyIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lKaGFrMU9OazVmTWs5VFZtWXlMV0Z3VWw5bVVtZHBUbU4xU1UxemFVYzNNWFozYVhWcFVIZ3hhMU5OSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyOS0wOC0yMlQxMzo0Mjo1Ni43OTA2OTcrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifX0sImlzcyI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmhhazFPTms1Zk1rOVRWbVl5TFdGd1VsOW1VbWRwVG1OMVNVMXphVWMzTVhaM2FYVnBVSGd4YTFOTkluMCIsImp0aSI6InVybjp1dWlkOjJiODhmMDhmLTVkOGItNDJiYS1iYmY0LTg4MjU1MjlmOGE2NyIsInN1YiI6ImRpZDpkaHQ6cWdtbXB5anc1aHducWZnem43d21ybTMzYWR5OGdiOHo5aWRlaWI2bTlnajR5czZ3bnk4eSIsIm5iZiI6MTg4MjEwMDU3NiwiaWF0IjoxNzI0ODUyNTc2fQ.QM4LHyJ8wW1_A0PcuhpsorI3FOA9NLX9-u7a6MkAMXrQoxwNFIfHZeHuwLGVBshmco2emUievVAfKWUQFpOvBQ"#; let result = @@ -840,8 +755,6 @@ mod tests { #[test] fn test_validate_dm_credential_expired() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_expired = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSnpjV3hxVTJaZlgzbE9TVVpKTVVwaWNYQkVSVEJuVUZGT2FVazBiVkZqV2pONmRtZFVVbmg2WTAxbkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcm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qdUxBPhXifiRVnH_Q8NbWZCUQ8jZUBg"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_expired, true); @@ -861,8 +774,6 @@ mod tests { #[test] fn test_schema_type_must_be_jsonschema() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_wrong_schema_type = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSXhlbTlYY0VWTWN6TnhiV0p5VW5GblRFbzBjbDlCZUhCYVNFSmpjMUZJVGtSaVRGYzBOM1JmVGpkSkluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOjQ1NGY1NWJmLWYzMjAtNDQyOS1iNmViLTRkMzdlNTMzNDkwYyIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiaXNzdWVyIjoiZGlkOmp3azpleUpoYkdjaU9pSkZaREkxTlRFNUlpd2lhM1I1SWpvaVQwdFFJaXdpWTNKMklqb2lSV1F5TlRVeE9TSXNJbmdpT2lJeGVtOVhjRVZNY3pOeGJXSnlVbkZuVEVvMGNsOUJlSEJhU0VKamMxRklUa1JpVEZjME4zUmZUamRKSW4wIiwiaXNzdWFuY2VEYXRlIjoiMjAyNC0wOC0zMFQxNTowMjo1NC4zNjg1NjMrMDA6MDAiLCJleHBpcmF0aW9uRGF0ZSI6bnVsbCwiY3JlZGVudGlhbFN1YmplY3QiOnsiaWQiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkifSwiY3JlZGVudGlhbFNjaGVtYSI6eyJpZCI6Imh0dHBzOi8vZXhhbXBsZS5jb20iLCJ0eXBlIjoic29tZXRoaW5nIGludmFsaWFkIn19LCJpc3MiOiJkaWQ6andrOmV5SmhiR2NpT2lKRlpESTFOVEU1SWl3aWEzUjVJam9pVDB0UUlpd2lZM0oySWpvaVJXUXlOVFV4T1NJc0luZ2lPaUl4ZW05WGNFVk1jek54YldKeVVuRm5URW8wY2w5QmVIQmFTRUpqYzFGSVRrUmlURmMwTjNSZlRqZEpJbjAiLCJqdGkiOiJ1cm46dXVpZDo0NTRmNTViZi1mMzIwLTQ0MjktYjZlYi00ZDM3ZTUzMzQ5MGMiLCJzdWIiOiJkaWQ6ZGh0OnFnbW1weWp3NWh3bnFmZ3puN3dtcm0zM2FkeThnYjh6OWlkZWliNm05Z2o0eXM2d255OHkiLCJuYmYiOjE3MjUwMzAxNzQsImlhdCI6MTcyNTAzMDE3NH0.8gxVx3_Qd1Lvao-y5PZ56XS3lMQvrFtBVMgfNDIdW9eoQkBQMNv79YKIxFCig0LHanzg_vyzX7tBviW6xJUuDw"#; let result = VerifiableCredential::from_vc_jwt(vc_jwt_with_wrong_schema_type, true); @@ -880,8 +791,6 @@ mod tests { #[test] fn test_schema_resolve_network_issue() { - TEST_SUITE.include(test_name!()); - let vc_jwt_with_invalid_url = r#"eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImRpZDpqd2s6ZXlKaGJHY2lPaUpGWkRJMU5URTVJaXdpYTNSNUlqb2lUMHRRSWl3aVkzSjJJam9pUldReU5UVXhPU0lzSW5naU9pSmZYelYxVEU1bWNVWTRRbTB6ZVhnMmJVRndMVlJJV25sSk5WcDJWQzFmYVVKbExWZDJiMHRuTTFwakluMCMwIn0.eyJ2YyI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSJdLCJpZCI6InVybjp1dWlkOmRlNDY2N2YxLTMzM2ItNDg4OC1hMDc5LTdkMGU1N2JiZmFlZiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlb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schema_resolve_non_success() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new_with_opts(ServerOpts { port: 40001, ..Default::default() @@ -927,8 +834,6 @@ mod tests { #[test] fn test_schema_resolve_invalid_response_body() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new_with_opts(ServerOpts { port: 40002, ..Default::default() @@ -957,8 +862,6 @@ mod tests { #[test] fn test_schema_invalid_json_schema() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new_with_opts(ServerOpts { port: 40003, ..Default::default() @@ -990,8 +893,6 @@ mod tests { #[test] fn test_schema_do_not_support_draft04() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new_with_opts(ServerOpts { port: 40004, ..Default::default() @@ -1023,8 +924,6 @@ mod tests { #[test] fn test_schema_do_not_support_draft06() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new_with_opts(ServerOpts { port: 40005, ..Default::default() @@ -1056,8 +955,6 @@ mod tests { #[test] fn test_schema_fails_validation() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new_with_opts(ServerOpts { port: 40006, ..Default::default() @@ -1090,8 +987,6 @@ mod tests { #[test] fn test_schema_example_from_spec() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new_with_opts(ServerOpts { port: 40007, ..Default::default() diff --git a/crates/web5/src/crypto/dsa/ed25519.rs b/crates/web5/src/crypto/dsa/ed25519.rs index 442df22e..51041ef0 100644 --- a/crates/web5/src/crypto/dsa/ed25519.rs +++ b/crates/web5/src/crypto/dsa/ed25519.rs @@ -224,57 +224,31 @@ impl Verifier for Ed25519Verifier { #[cfg(test)] mod tests { use super::*; - use crate::{test_helpers::UnitTestSuite, test_name}; use general_purpose::URL_SAFE_NO_PAD; - use lazy_static::lazy_static; mod generate { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("ed25519_generate"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_must_set_alg() { - TEST_SUITE.include(test_name!()); - let jwk = Ed25519Generator::generate(); assert_eq!(jwk.alg, Some("Ed25519".to_string())); } #[test] fn test_must_set_kty() { - TEST_SUITE.include(test_name!()); - let jwk = Ed25519Generator::generate(); assert_eq!(jwk.kty, "OKP".to_string()); } #[test] fn test_must_set_crv() { - TEST_SUITE.include(test_name!()); - let jwk = Ed25519Generator::generate(); assert_eq!(jwk.crv, "Ed25519"); } #[test] fn test_must_set_public_key_with_correct_length() { - TEST_SUITE.include(test_name!()); - let jwk = Ed25519Generator::generate(); let public_key_bytes = URL_SAFE_NO_PAD .decode(&jwk.x) @@ -284,8 +258,6 @@ mod tests { #[test] fn test_must_set_private_key_with_correct_length() { - TEST_SUITE.include(test_name!()); - let jwk = Ed25519Generator::generate(); let private_key_bytes = jwk.d.expect("Private key is missing"); let decoded_private_key_bytes = URL_SAFE_NO_PAD @@ -298,20 +270,8 @@ mod tests { mod sign { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("ed25519_sign"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - std::thread::sleep(std::time::Duration::from_millis(100)); - TEST_SUITE.assert_coverage(); - } - #[test] fn test_with_valid_key() { - TEST_SUITE.include(test_name!()); - let jwk = Ed25519Generator::generate(); let signer = Ed25519Signer::new(jwk); @@ -333,8 +293,6 @@ mod tests { #[test] fn test_with_invalid_private_key() { - TEST_SUITE.include(test_name!()); - let mut jwk = Ed25519Generator::generate(); // Set an invalid private key (wrong length) @@ -360,8 +318,6 @@ mod tests { #[test] fn test_with_missing_private_key() { - TEST_SUITE.include(test_name!()); - let mut jwk = Ed25519Generator::generate(); // Remove the private key @@ -385,10 +341,6 @@ mod tests { mod verify { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("ed25519_verify"); - } - fn generate_keys() -> (Jwk, Jwk) { let private_jwk = Ed25519Generator::generate(); let mut public_jwk = private_jwk.clone(); @@ -396,16 +348,8 @@ mod tests { (public_jwk, private_jwk) } - #[test] - fn z_assert_all_suite_cases_covered() { - std::thread::sleep(std::time::Duration::from_millis(100)); - TEST_SUITE.assert_coverage(); - } - #[test] fn test_with_valid_signature() { - TEST_SUITE.include(test_name!()); - let (public_jwk, private_jwk) = generate_keys(); let signer = Ed25519Signer::new(private_jwk); let verifier = Ed25519Verifier::new(public_jwk); @@ -423,8 +367,6 @@ mod tests { #[test] fn test_with_private_key() { - TEST_SUITE.include(test_name!()); - let (_, private_jwk) = generate_keys(); let verifier = Ed25519Verifier::new(private_jwk); // this is not allowed @@ -447,8 +389,6 @@ mod tests { #[test] fn test_with_invalid_signature() { - TEST_SUITE.include(test_name!()); - let (public_jwk, _) = generate_keys(); let verifier = Ed25519Verifier::new(public_jwk); @@ -469,8 +409,6 @@ mod tests { #[test] fn test_with_invalid_public_key() { - TEST_SUITE.include(test_name!()); - let (mut public_jwk, private_jwk) = generate_keys(); public_jwk.x = URL_SAFE_NO_PAD.encode(&[0u8; PUBLIC_KEY_LENGTH - 1]); @@ -498,8 +436,6 @@ mod tests { #[test] fn test_with_invalid_signature_length() { - TEST_SUITE.include(test_name!()); - let (public_jwk, _) = generate_keys(); let verifier = Ed25519Verifier::new(public_jwk); diff --git a/crates/web5/src/crypto/dsa/secp256k1.rs b/crates/web5/src/crypto/dsa/secp256k1.rs index 97c3951c..76d8a970 100644 --- a/crates/web5/src/crypto/dsa/secp256k1.rs +++ b/crates/web5/src/crypto/dsa/secp256k1.rs @@ -210,57 +210,30 @@ impl Verifier for Secp256k1Verifier { #[cfg(test)] mod tests { use super::*; - use crate::test_helpers::UnitTestSuite; - use crate::test_name; - use lazy_static::lazy_static; mod generate { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("secp256k1_generate"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_must_set_alg() { - TEST_SUITE.include(test_name!()); - let jwk = Secp256k1Generator::generate(); assert_eq!(jwk.alg, Some("ES256K".to_string())); } #[test] fn test_must_set_kty() { - TEST_SUITE.include(test_name!()); - let jwk = Secp256k1Generator::generate(); assert_eq!(jwk.kty, "EC".to_string()); } #[test] fn test_must_set_crv() { - TEST_SUITE.include(test_name!()); - let jwk = Secp256k1Generator::generate(); assert_eq!(jwk.crv, "secp256k1"); } #[test] fn test_must_set_public_key_with_correct_length() { - TEST_SUITE.include(test_name!()); - let jwk = Secp256k1Generator::generate(); let x_bytes = general_purpose::URL_SAFE_NO_PAD .decode(&jwk.x) @@ -274,8 +247,6 @@ mod tests { #[test] fn test_must_set_private_key_with_correct_length() { - TEST_SUITE.include(test_name!()); - let jwk = Secp256k1Generator::generate(); let private_key_bytes = jwk.d.expect("Private key is missing"); let decoded_private_key_bytes = general_purpose::URL_SAFE_NO_PAD @@ -288,26 +259,8 @@ mod tests { mod sign { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("secp256k1_sign"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_with_valid_key() { - TEST_SUITE.include(test_name!()); - let jwk = Secp256k1Generator::generate(); let signer = Secp256k1Signer::new(jwk); @@ -329,8 +282,6 @@ mod tests { #[test] fn test_with_invalid_private_key() { - TEST_SUITE.include(test_name!()); - let mut jwk = Secp256k1Generator::generate(); // Set an invalid private key (wrong length) @@ -352,8 +303,6 @@ mod tests { #[test] fn test_with_missing_private_key() { - TEST_SUITE.include(test_name!()); - let mut jwk = Secp256k1Generator::generate(); // Remove the private key @@ -377,22 +326,6 @@ mod tests { mod verify { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("secp256k1_verify"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - fn generate_keys() -> (Jwk, Jwk) { let private_jwk = Secp256k1Generator::generate(); let public_jwk = to_public_jwk(&private_jwk); @@ -401,8 +334,6 @@ mod tests { #[test] fn test_with_valid_signature() { - TEST_SUITE.include(test_name!()); - let (public_jwk, private_jwk) = generate_keys(); let signer = Secp256k1Signer::new(private_jwk); let verifier = Secp256k1Verifier::new(public_jwk); @@ -420,8 +351,6 @@ mod tests { #[test] fn test_with_private_key() { - TEST_SUITE.include(test_name!()); - let (_, private_jwk) = generate_keys(); let verifier = Secp256k1Verifier::new(private_jwk); // Should not use a private key for verification @@ -444,8 +373,6 @@ mod tests { #[test] fn test_with_invalid_signature() { - TEST_SUITE.include(test_name!()); - let (public_jwk, private_jwk) = generate_keys(); let signer = Secp256k1Signer::new(private_jwk); let verifier = Secp256k1Verifier::new(public_jwk); @@ -470,8 +397,6 @@ mod tests { #[test] fn test_with_invalid_public_key() { - TEST_SUITE.include(test_name!()); - let (mut public_jwk, private_jwk) = generate_keys(); public_jwk.x = general_purpose::URL_SAFE_NO_PAD.encode(&[0u8; 31]); // Invalid length @@ -495,8 +420,6 @@ mod tests { #[test] fn test_with_invalid_signature_length() { - TEST_SUITE.include(test_name!()); - let (public_jwk, _) = generate_keys(); let verifier = Secp256k1Verifier::new(public_jwk); diff --git a/crates/web5/src/crypto/jwk.rs b/crates/web5/src/crypto/jwk.rs index 1b737b6b..cebcad14 100644 --- a/crates/web5/src/crypto/jwk.rs +++ b/crates/web5/src/crypto/jwk.rs @@ -97,32 +97,12 @@ impl Jwk { #[cfg(test)] mod tests { use super::*; - use crate::{errors::Web5Error, test_helpers::UnitTestSuite, test_name}; - use lazy_static::lazy_static; mod compute_thumbprint { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("jwk_compute_thumbprint"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_ec_valid() { - TEST_SUITE.include(test_name!()); - let jwk = Jwk { kty: "EC".to_string(), crv: "secp256k1".to_string(), @@ -137,8 +117,6 @@ mod tests { #[test] fn test_okp_valid() { - TEST_SUITE.include(test_name!()); - let jwk = Jwk { kty: "OKP".to_string(), crv: "Ed25519".to_string(), @@ -152,8 +130,6 @@ mod tests { #[test] fn test_unsupported_kty() { - TEST_SUITE.include(test_name!()); - let jwk = Jwk { kty: "RSA".to_string(), crv: "RS256".to_string(), @@ -169,8 +145,6 @@ mod tests { #[test] fn test_empty_kty() { - TEST_SUITE.include(test_name!()); - let jwk = Jwk { kty: "".to_string(), crv: "Ed25519".to_string(), @@ -185,8 +159,6 @@ mod tests { #[test] fn test_empty_x() { - TEST_SUITE.include(test_name!()); - let jwk = Jwk { kty: "OKP".to_string(), crv: "Ed25519".to_string(), @@ -201,8 +173,6 @@ mod tests { #[test] fn test_empty_crv() { - TEST_SUITE.include(test_name!()); - let jwk = Jwk { kty: "EC".to_string(), crv: "".to_string(), @@ -218,8 +188,6 @@ mod tests { #[test] fn test_ec_missing_y() { - TEST_SUITE.include(test_name!()); - let jwk = Jwk { kty: "EC".to_string(), crv: "P-256".to_string(), @@ -234,8 +202,6 @@ mod tests { #[test] fn test_ec_empty_y() { - TEST_SUITE.include(test_name!()); - let jwk = Jwk { kty: "EC".to_string(), crv: "P-256".to_string(), diff --git a/crates/web5/src/crypto/key_managers/in_memory_key_manager.rs b/crates/web5/src/crypto/key_managers/in_memory_key_manager.rs index 566a3c81..8a5bf3ae 100644 --- a/crates/web5/src/crypto/key_managers/in_memory_key_manager.rs +++ b/crates/web5/src/crypto/key_managers/in_memory_key_manager.rs @@ -168,33 +168,12 @@ impl KeyExporter for InMemoryKeyManager { mod tests { use super::*; use crate::crypto::dsa::ed25519::Ed25519Generator; - use crate::{test_helpers::UnitTestSuite, test_name}; - use lazy_static::lazy_static; mod import_private_jwk { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = - UnitTestSuite::new("in_memory_key_manager_import_private_jwk"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_must_be_private_jwk() { - TEST_SUITE.include(test_name!()); - let key_manager = InMemoryKeyManager::new(); let private_jwk = Ed25519Generator::generate(); let mut public_jwk = private_jwk.clone(); @@ -210,8 +189,6 @@ mod tests { #[test] fn test_successfully_imports_and_returns_public_jwk() { - TEST_SUITE.include(test_name!()); - let key_manager = InMemoryKeyManager::new(); let private_jwk = Ed25519Generator::generate(); @@ -226,27 +203,8 @@ mod tests { mod get_signer { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = - UnitTestSuite::new("in_memory_key_manager_get_signer"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_must_be_public_key() { - TEST_SUITE.include(test_name!()); - let key_manager = InMemoryKeyManager::new(); let private_jwk = Ed25519Generator::generate(); let result = key_manager.get_signer(private_jwk); @@ -260,8 +218,6 @@ mod tests { #[test] fn test_not_found() { - TEST_SUITE.include(test_name!()); - let key_manager = InMemoryKeyManager::new(); let mut public_jwk = Ed25519Generator::generate(); public_jwk.d = None; @@ -282,8 +238,6 @@ mod tests { #[test] fn test_found() { - TEST_SUITE.include(test_name!()); - let key_manager = InMemoryKeyManager::new(); let private_jwk = Ed25519Generator::generate(); let mut public_jwk = private_jwk.clone(); @@ -300,27 +254,8 @@ mod tests { mod export_private_jwks { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = - UnitTestSuite::new("in_memory_key_manager_export_private_jwks"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_export_empty_list() { - TEST_SUITE.include(test_name!()); - let key_manager = InMemoryKeyManager::new(); let result = key_manager.export_private_jwks().unwrap(); assert!(result.is_empty()); @@ -328,8 +263,6 @@ mod tests { #[test] fn test_export_single_key() { - TEST_SUITE.include(test_name!()); - let key_manager = InMemoryKeyManager::new(); let private_jwk = Ed25519Generator::generate(); key_manager.import_private_jwk(private_jwk.clone()).unwrap(); @@ -341,8 +274,6 @@ mod tests { #[test] fn test_export_multiple_keys() { - TEST_SUITE.include(test_name!()); - let key_manager = InMemoryKeyManager::new(); let private_jwk1 = Ed25519Generator::generate(); let private_jwk2 = Ed25519Generator::generate(); diff --git a/crates/web5/src/crypto/mod.rs b/crates/web5/src/crypto/mod.rs index e0425d1a..fe46659f 100644 --- a/crates/web5/src/crypto/mod.rs +++ b/crates/web5/src/crypto/mod.rs @@ -1,5 +1,4 @@ pub mod dsa; +pub mod jwk; pub mod key_managers; pub mod x25519; - -pub mod jwk; diff --git a/crates/web5/src/dids/bearer_did.rs b/crates/web5/src/dids/bearer_did.rs index 8869f89c..cb92c6ad 100644 --- a/crates/web5/src/dids/bearer_did.rs +++ b/crates/web5/src/dids/bearer_did.rs @@ -136,33 +136,12 @@ impl BearerDid { mod tests { use super::*; use crate::dids::methods::did_jwk::{DidJwk, DidJwkCreateOptions}; - use crate::{test_helpers::UnitTestSuite, test_name}; - use lazy_static::lazy_static; mod from_portable_did { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = - UnitTestSuite::new("bearer_did_from_portable_did"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_can_instantiate_successfully() { - TEST_SUITE.include(test_name!()); - let key_manager = Arc::new(InMemoryKeyManager::new()); let did_jwk_bearer_did = DidJwk::create(Some(DidJwkCreateOptions { key_manager: Some(key_manager.clone()), @@ -184,26 +163,8 @@ mod tests { mod get_signer { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("bearer_did_get_signer"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_verification_method_id_empty() { - TEST_SUITE.include(test_name!()); - let bearer_did = DidJwk::create(None).unwrap(); let result = bearer_did.get_signer(""); @@ -217,8 +178,6 @@ mod tests { #[test] fn test_not_found_by_verification_method_id() { - TEST_SUITE.include(test_name!()); - let bearer_did = DidJwk::create(None).unwrap(); let result = bearer_did.get_signer("something invalid"); @@ -232,8 +191,6 @@ mod tests { #[test] fn test_found_by_verification_method_id() { - TEST_SUITE.include(test_name!()); - let bearer_did = DidJwk::create(None).unwrap(); let result = bearer_did.get_signer(&bearer_did.document.verification_method[0].id); @@ -244,26 +201,8 @@ mod tests { mod to_portable_did { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("bearer_did_to_portable_did"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_can_export() { - TEST_SUITE.include(test_name!()); - let key_manager = Arc::new(InMemoryKeyManager::new()); let bearer_did = DidJwk::create(Some(DidJwkCreateOptions { key_manager: Some(key_manager.clone()), diff --git a/crates/web5/src/dids/did.rs b/crates/web5/src/dids/did.rs index e768ba1b..f9df89b9 100644 --- a/crates/web5/src/dids/did.rs +++ b/crates/web5/src/dids/did.rs @@ -150,28 +150,9 @@ mod tests { mod new { use super::*; - use crate::{test_helpers::UnitTestSuite, test_name}; - - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("did_parse"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } #[test] fn test_did_empty_string_should_error() { - TEST_SUITE.include(test_name!()); - let uri = ""; let result = Did::parse(uri); assert!(result.is_err(), "Expected error for input: {}", uri); @@ -183,8 +164,6 @@ mod tests { #[test] fn test_did_incomplete_scheme_should_error() { - TEST_SUITE.include(test_name!()); - let uri = "did:"; let result = Did::parse(uri); assert!(result.is_err(), "Expected error for input: {}", uri); @@ -196,8 +175,6 @@ mod tests { #[test] fn test_did_missing_id_part_should_error() { - TEST_SUITE.include(test_name!()); - let uri = "did:uport"; let result = Did::parse(uri); assert!(result.is_err(), "Expected error for input: {}", uri); @@ -209,8 +186,6 @@ mod tests { #[test] fn test_did_missing_id_should_error() { - TEST_SUITE.include(test_name!()); - let uri = "did:uport:"; let result = Did::parse(uri); assert!(result.is_err(), "Expected error for input: {}", uri); @@ -222,8 +197,6 @@ mod tests { #[test] fn test_did_invalid_characters_in_id_should_error() { - TEST_SUITE.include(test_name!()); - let uri = "did:uport:1234_12313***"; let result = Did::parse(uri); assert!(result.is_err(), "Expected error for input: {}", uri); @@ -235,8 +208,6 @@ mod tests { #[test] fn test_did_invalid_bare_id_should_error() { - TEST_SUITE.include(test_name!()); - let uri = "2nQtiQG6Cgm1GYTBaaKAgr76uY7iSexUkqX"; let result = Did::parse(uri); assert!(result.is_err(), "Expected error for input: {}", uri); @@ -248,8 +219,6 @@ mod tests { #[test] fn test_did_invalid_percent_encoding_should_error() { - TEST_SUITE.include(test_name!()); - let uri = "did:method:%12%1"; let result = Did::parse(uri); assert!(result.is_err(), "Expected error for input: {}", uri); @@ -261,8 +230,6 @@ mod tests { #[test] fn test_did_invalid_percent_encoding_incomplete_should_error() { - TEST_SUITE.include(test_name!()); - let uri = "did:method:%1233%Ay"; let result = Did::parse(uri); assert!(result.is_err(), "Expected error for input: {}", uri); @@ -274,8 +241,6 @@ mod tests { #[test] fn test_did_capitalized_method_should_error() { - TEST_SUITE.include(test_name!()); - let uri = "did:CAP:id"; let result = Did::parse(uri); assert!(result.is_err(), "Expected error for input: {}", uri); @@ -287,8 +252,6 @@ mod tests { #[test] fn test_did_invalid_additional_id_should_error() { - TEST_SUITE.include(test_name!()); - let uri = "did:method:id::anotherid%r9"; let result = Did::parse(uri); assert!(result.is_err(), "Expected error for input: {}", uri); @@ -300,8 +263,6 @@ mod tests { #[test] fn test_did_valid_did_no_params_path_query_fragment() { - TEST_SUITE.include(test_name!()); - let uri = "did:example:123456789abcdefghi"; let expected = Did { uri: uri.to_string(), @@ -316,8 +277,6 @@ mod tests { #[test] fn test_did_valid_did_with_params() { - TEST_SUITE.include(test_name!()); - let uri = "did:example:123456789abcdefghi;foo=bar;baz=qux"; let expected = Did { uri: "did:example:123456789abcdefghi".to_string(), @@ -336,8 +295,6 @@ mod tests { #[test] fn test_did_valid_did_with_query() { - TEST_SUITE.include(test_name!()); - let uri = "did:example:123456789abcdefghi?foo=bar&baz=qux"; let expected = Did { uri: "did:example:123456789abcdefghi".to_string(), @@ -353,8 +310,6 @@ mod tests { #[test] fn test_did_valid_did_with_fragment() { - TEST_SUITE.include(test_name!()); - let uri = "did:example:123456789abcdefghi#keys-1"; let expected = Did { uri: "did:example:123456789abcdefghi".to_string(), @@ -370,8 +325,6 @@ mod tests { #[test] fn test_did_valid_did_with_query_and_fragment() { - TEST_SUITE.include(test_name!()); - let uri = "did:example:123456789abcdefghi?foo=bar&baz=qux#keys-1"; let expected = Did { uri: "did:example:123456789abcdefghi".to_string(), @@ -388,8 +341,6 @@ mod tests { #[test] fn test_did_valid_did_with_params_query_and_fragment() { - TEST_SUITE.include(test_name!()); - let uri = "did:example:123456789abcdefghi;foo=bar;baz=qux?foo=bar&baz=qux#keys-1"; let expected = Did { uri: "did:example:123456789abcdefghi".to_string(), @@ -410,8 +361,6 @@ mod tests { #[test] fn test_did_valid_did_with_path() { - TEST_SUITE.include(test_name!()); - let uri = "did:example:123456789abcdefghi/path/to/resource"; let expected = Did { uri: "did:example:123456789abcdefghi".to_string(), diff --git a/crates/web5/src/dids/methods/did_dht/mod.rs b/crates/web5/src/dids/methods/did_dht/mod.rs index 7bbf17d2..291d7ee7 100644 --- a/crates/web5/src/dids/methods/did_dht/mod.rs +++ b/crates/web5/src/dids/methods/did_dht/mod.rs @@ -312,32 +312,12 @@ impl DidDht { #[cfg(test)] mod tests { use super::*; - use crate::{test_helpers::UnitTestSuite, test_name}; - use lazy_static::lazy_static; mod create { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("did_dht_create"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_can_specify_key_manager() { - TEST_SUITE.include(test_name!()); - let key_manager = Arc::new(InMemoryKeyManager::new()); let result = DidDht::create(Some(DidDhtCreateOptions { publish: Some(false), @@ -357,8 +337,6 @@ mod tests { #[test] fn test_can_specify_publish_and_gateway_url() { - TEST_SUITE.include(test_name!()); - let mut mock_server = mockito::Server::new(); let gateway_url = mock_server.url(); @@ -382,8 +360,6 @@ mod tests { #[test] fn test_should_add_optional_verification_methods() { - TEST_SUITE.include(test_name!()); - let additional_verification_method = VerificationMethod { id: "did:web:example.com#key-1".to_string(), r#type: "JsonWebKey".to_string(), @@ -409,8 +385,6 @@ mod tests { #[test] fn test_should_add_optional_services() { - TEST_SUITE.include(test_name!()); - let service = Service { id: "did:web:example.com#service-0".to_string(), r#type: "SomeService".to_string(), @@ -431,8 +405,6 @@ mod tests { #[test] fn test_should_add_optional_also_known_as() { - TEST_SUITE.include(test_name!()); - let also_known_as = vec!["https://alias.example.com".to_string()]; let result = DidDht::create(Some(DidDhtCreateOptions { @@ -449,8 +421,6 @@ mod tests { #[test] fn test_should_add_optional_controllers() { - TEST_SUITE.include(test_name!()); - let controllers = vec!["did:web:controller.example.com".to_string()]; let result = DidDht::create(Some(DidDhtCreateOptions { @@ -469,26 +439,8 @@ mod tests { mod publish { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("did_dht_publish"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_can_specify_gateway_url() { - TEST_SUITE.include(test_name!()); - let mut mock_server = mockito::Server::new(); let gateway_url = mock_server.url(); @@ -517,8 +469,6 @@ mod tests { #[test] fn test_can_handle_network_error() { - TEST_SUITE.include(test_name!()); - let mut mock_server = mockito::Server::new(); let gateway_url = mock_server.url(); @@ -553,26 +503,8 @@ mod tests { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("did_dht_resolve"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_invalid_did() { - TEST_SUITE.include(test_name!()); - let resolution_result = DidDht::resolve("something invalid", None); assert_eq!( resolution_result.resolution_metadata.error, @@ -582,8 +514,6 @@ mod tests { #[test] fn test_method_not_supported() { - TEST_SUITE.include(test_name!()); - let resolution_result = DidDht::resolve("did:web:example", None); assert_eq!( resolution_result.resolution_metadata.error, @@ -593,8 +523,6 @@ mod tests { #[test] fn test_not_found() { - TEST_SUITE.include(test_name!()); - let bearer_did = DidDht::create(Some(DidDhtCreateOptions { publish: Some(false), ..Default::default() @@ -622,8 +550,6 @@ mod tests { #[test] fn test_internal_error() { - TEST_SUITE.include(test_name!()); - let bearer_did = DidDht::create(Some(DidDhtCreateOptions { publish: Some(false), ..Default::default() @@ -651,8 +577,6 @@ mod tests { #[test] fn test_can_create_then_resolve() { - TEST_SUITE.include(test_name!()); - let mut mock_server = mockito::Server::new(); let gateway_url = mock_server.url(); diff --git a/crates/web5/src/dids/methods/did_jwk.rs b/crates/web5/src/dids/methods/did_jwk.rs index 58da3474..9ec58857 100644 --- a/crates/web5/src/dids/methods/did_jwk.rs +++ b/crates/web5/src/dids/methods/did_jwk.rs @@ -173,32 +173,12 @@ impl DidJwk { #[cfg(test)] mod tests { use super::*; - use crate::{test_helpers::UnitTestSuite, test_name}; - use lazy_static::lazy_static; mod create { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("did_jwk_create"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_can_specify_key_manager() { - TEST_SUITE.include(test_name!()); - let key_manager = Arc::new(InMemoryKeyManager::new()); let result = DidJwk::create(Some(DidJwkCreateOptions { key_manager: Some(key_manager.clone()), @@ -217,8 +197,6 @@ mod tests { #[test] fn test_can_specify_secp256k1() { - TEST_SUITE.include(test_name!()); - let result = DidJwk::create(Some(DidJwkCreateOptions { dsa: Some(Dsa::Secp256k1), ..Default::default() @@ -237,8 +215,6 @@ mod tests { #[test] fn test_defaults_to_ed25519() { - TEST_SUITE.include(test_name!()); - let result = DidJwk::create(None); assert!(result.is_ok()); @@ -255,26 +231,8 @@ mod tests { mod resolve { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("did_jwk_resolve"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_invalid_did() { - TEST_SUITE.include(test_name!()); - let resolution_result = DidJwk::resolve("something invalid"); assert_eq!( resolution_result.resolution_metadata.error, @@ -284,8 +242,6 @@ mod tests { #[test] fn test_create_then_resolve() { - TEST_SUITE.include(test_name!()); - let result = DidJwk::create(None); assert!(result.is_ok()); let bearer_did = result.unwrap(); diff --git a/crates/web5/src/dids/methods/did_web/mod.rs b/crates/web5/src/dids/methods/did_web/mod.rs index f3d78480..b74af5ed 100644 --- a/crates/web5/src/dids/methods/did_web/mod.rs +++ b/crates/web5/src/dids/methods/did_web/mod.rs @@ -218,32 +218,12 @@ impl DidWeb { #[cfg(test)] mod tests { use super::*; - use crate::{test_helpers::UnitTestSuite, test_name}; - use lazy_static::lazy_static; mod create { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("did_web_create"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_can_specify_key_manager() { - TEST_SUITE.include(test_name!()); - let key_manager = Arc::new(InMemoryKeyManager::new()); let result = DidWeb::create( "localhost", @@ -265,8 +245,6 @@ mod tests { #[test] fn test_can_specify_secp256k1() { - TEST_SUITE.include(test_name!()); - let result = DidWeb::create( "localhost", Some(DidWebCreateOptions { @@ -288,8 +266,6 @@ mod tests { #[test] fn test_defaults_to_ed25519() { - TEST_SUITE.include(test_name!()); - let result = DidWeb::create("localhost", None); assert!(result.is_ok()); @@ -304,8 +280,6 @@ mod tests { #[test] fn test_invalid_domain() { - TEST_SUITE.include(test_name!()); - let result = DidWeb::create("invalid domain", None); assert!(result.is_err()); @@ -318,8 +292,6 @@ mod tests { #[test] fn test_should_allow_http_for_localhost() { - TEST_SUITE.include(test_name!()); - let result = DidWeb::create("http://localhost", None); assert!(result.is_ok()); @@ -341,8 +313,6 @@ mod tests { #[test] fn test_must_be_https() { - TEST_SUITE.include(test_name!()); - let result = DidWeb::create("http://example.com", None); assert!(result.is_err()); @@ -361,8 +331,6 @@ mod tests { #[test] fn test_should_trim_did_json() { - TEST_SUITE.include(test_name!()); - let result = DidWeb::create("https://example.com/did.json", None); assert!(result.is_ok()); @@ -372,8 +340,6 @@ mod tests { #[test] fn test_should_trim_well_known() { - TEST_SUITE.include(test_name!()); - let result = DidWeb::create("https://example.com/.well-known/did.json", None); assert!(result.is_ok()); @@ -383,8 +349,6 @@ mod tests { #[test] fn test_should_percent_encode_colons() { - TEST_SUITE.include(test_name!()); - let result = DidWeb::create("https://example.com:8080", None); assert!(result.is_ok()); @@ -394,8 +358,6 @@ mod tests { #[test] fn test_should_replace_path_with_colons() { - TEST_SUITE.include(test_name!()); - let result = DidWeb::create("https://example.com/path/to/resource", None); assert!(result.is_ok()); @@ -408,8 +370,6 @@ mod tests { #[test] fn test_should_add_optional_verification_methods() { - TEST_SUITE.include(test_name!()); - let additional_verification_method = VerificationMethod { id: "did:web:example.com#key-1".to_string(), r#type: "JsonWebKey".to_string(), @@ -437,8 +397,6 @@ mod tests { #[test] fn test_should_add_optional_services() { - TEST_SUITE.include(test_name!()); - let service = Service { id: "did:web:example.com#service-0".to_string(), r#type: "SomeService".to_string(), @@ -461,8 +419,6 @@ mod tests { #[test] fn test_should_add_optional_also_known_as() { - TEST_SUITE.include(test_name!()); - let also_known_as = vec!["https://alias.example.com".to_string()]; let result = DidWeb::create( @@ -481,8 +437,6 @@ mod tests { #[test] fn test_should_add_optional_controllers() { - TEST_SUITE.include(test_name!()); - let controllers = vec!["did:web:controller.example.com".to_string()]; let result = DidWeb::create( @@ -504,26 +458,8 @@ mod tests { use super::*; use mockito::Server; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("did_web_resolve"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_invalid_did() { - TEST_SUITE.include(test_name!()); - let resolution_result = DidWeb::resolve("something invalid"); assert_eq!( resolution_result.resolution_metadata.error, @@ -533,8 +469,6 @@ mod tests { #[test] fn test_create_then_resolve() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new(); let url = mock_server.url(); diff --git a/crates/web5/src/dids/resolution/resolution_result.rs b/crates/web5/src/dids/resolution/resolution_result.rs index a43b9d1d..ae057eef 100644 --- a/crates/web5/src/dids/resolution/resolution_result.rs +++ b/crates/web5/src/dids/resolution/resolution_result.rs @@ -93,33 +93,13 @@ impl From for ResolutionResult { #[cfg(test)] mod tests { use super::*; - use crate::{test_helpers::UnitTestSuite, test_name}; - use lazy_static::lazy_static; use mockito::Server; mod resolve { use super::*; - lazy_static! { - static ref TEST_SUITE: UnitTestSuite = UnitTestSuite::new("resolution_result_resolve"); - } - - #[test] - fn z_assert_all_suite_cases_covered() { - // fn name prefixed with `z_*` b/c rust test harness executes in alphabetical order, - // unless intentionally executed with "shuffle" https://doc.rust-lang.org/rustc/tests/index.html#--shuffle - // this may not work if shuffled or if test list grows to the extent of 100ms being insufficient wait time - - // wait 100ms to be last-in-queue of mutex lock - std::thread::sleep(std::time::Duration::from_millis(100)); - - TEST_SUITE.assert_coverage() - } - #[test] fn test_invalid_did() { - TEST_SUITE.include(test_name!()); - let resolution_result = ResolutionResult::resolve("something invalid"); assert_eq!( resolution_result.resolution_metadata.error, @@ -129,8 +109,6 @@ mod tests { #[test] fn test_did_jwk() { - TEST_SUITE.include(test_name!()); - let bearer_did = DidJwk::create(None).unwrap(); let resolution_result = ResolutionResult::resolve(&bearer_did.did.uri); @@ -140,8 +118,6 @@ mod tests { #[test] fn test_did_web() { - TEST_SUITE.include(test_name!()); - let mut mock_server = Server::new(); let url = mock_server.url(); @@ -163,8 +139,6 @@ mod tests { #[test] fn test_method_not_supported() { - TEST_SUITE.include(test_name!()); - let resolution_result = ResolutionResult::resolve("did:example:123"); assert!(resolution_result.resolution_metadata.error.is_some()); assert_eq!( diff --git a/crates/web5/src/lib.rs b/crates/web5/src/lib.rs index 9b21b451..dc2eb8f3 100644 --- a/crates/web5/src/lib.rs +++ b/crates/web5/src/lib.rs @@ -7,7 +7,5 @@ pub mod errors; mod jose; pub mod json; -#[cfg(test)] -mod test_helpers; #[cfg(test)] mod test_vectors; diff --git a/crates/web5/src/test_helpers.rs b/crates/web5/src/test_helpers.rs deleted file mode 100644 index b6d8a9e9..00000000 --- a/crates/web5/src/test_helpers.rs +++ /dev/null @@ -1,57 +0,0 @@ -use std::{fs, sync::Mutex}; - -#[macro_export] -macro_rules! test_name { - () => {{ - let current_fn = { - fn f() {} - fn type_name_of(_: T) -> &'static str { - std::any::type_name::() - } - let name = type_name_of(f); - &name[..name.len() - 3] // Strip off "::f" - }; - - let test_name = current_fn.split("::").last().unwrap(); - test_name - }}; -} - -pub(crate) struct UnitTestSuite { - tests: Mutex>, -} - -impl UnitTestSuite { - pub(crate) fn new(name: &str) -> Self { - let file_path = format!( - "{}/../../tests/unit_test_cases/{}.json", - env!("CARGO_MANIFEST_DIR"), - name - ); - let file_content = - fs::read_to_string(file_path).expect("Failed to read test cases JSON file"); - - Self { - tests: Mutex::new( - serde_json::from_str::>(&file_content) - .expect("Failed to parse test cases JSON file"), - ), - } - } - - pub(crate) fn include(&self, test_name: &str) { - let mut tests = self.tests.lock().unwrap(); - if let Some(pos) = tests.iter().position(|x| *x == test_name) { - tests.remove(pos); - } else { - panic!("test {} not included in the test suite", test_name); - } - } - - pub(crate) fn assert_coverage(&self) { - let tests = self.tests.lock().unwrap(); - if !tests.is_empty() { - panic!("The following test cases were not covered: {:?}", *tests); - } - } -} diff --git a/tests/unit_test_cases.sh b/tests/unit_test_cases.sh new file mode 100755 index 00000000..5792d0e2 --- /dev/null +++ b/tests/unit_test_cases.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Directory containing the JSON test case files +JSON_DIR="tests/unit_test_cases" + +# Initialize error flag +error_flag=0 + +# Loop through each JSON file in the directory +for json_file in "$JSON_DIR"/*.json; do + # Extract test names from the JSON file using jq + test_names=$(jq -r '.test_names[]' "$json_file") + + # Extract the test files from the JSON + jq -c '.test_files[] | select(type=="object")' "$json_file" | while read test_file; do + # Extract language and file path + language=$(echo "$test_file" | jq -r '.language') + file_path=$(echo "$test_file" | jq -r '.path') + + # Read the content of the test file + if [[ -f "$file_path" ]]; then + file_content=$(cat "$file_path") + else + echo " File not found: $file_path" + error_flag=1 # Set error flag + continue + fi + + # Loop through each test name + for test_name in $test_names; do + # Check if the test name exists in the file content + if ! grep -q "$test_name" <<< "$file_content"; then + echo " Missing test: $test_name in $file_path" + error_flag=1 # Set error flag + fi + done + done +done + +# Exit with error if any issues were found +if [[ $error_flag -ne 0 ]]; then + exit 1 +fi diff --git a/tests/unit_test_cases/bearer_did_from_portable_did.json b/tests/unit_test_cases/bearer_did_from_portable_did.json index 94dddad9..dac0a4e3 100644 --- a/tests/unit_test_cases/bearer_did_from_portable_did.json +++ b/tests/unit_test_cases/bearer_did_from_portable_did.json @@ -1,3 +1,11 @@ -[ - "test_can_instantiate_successfully" -] +{ + "test_names": [ + "test_can_instantiate_successfully" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/BearerDidTest.kt" + } + ] +} diff --git a/tests/unit_test_cases/bearer_did_get_signer.json b/tests/unit_test_cases/bearer_did_get_signer.json index 3641a833..5773e5cb 100644 --- a/tests/unit_test_cases/bearer_did_get_signer.json +++ b/tests/unit_test_cases/bearer_did_get_signer.json @@ -1,5 +1,17 @@ -[ - "test_verification_method_id_empty", - "test_not_found_by_verification_method_id", - "test_found_by_verification_method_id" -] +{ + "test_names": [ + "test_verification_method_id_empty", + "test_not_found_by_verification_method_id", + "test_found_by_verification_method_id" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/BearerDidTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/bearer_did.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/bearer_did_to_portable_did.json b/tests/unit_test_cases/bearer_did_to_portable_did.json index bbeed859..9f4fa8b4 100644 --- a/tests/unit_test_cases/bearer_did_to_portable_did.json +++ b/tests/unit_test_cases/bearer_did_to_portable_did.json @@ -1,3 +1,15 @@ -[ - "test_can_export" -] +{ + "test_names": [ + "test_can_export" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/BearerDidTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/bearer_did.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/did_dht_create.json b/tests/unit_test_cases/did_dht_create.json index e65626d4..67334977 100644 --- a/tests/unit_test_cases/did_dht_create.json +++ b/tests/unit_test_cases/did_dht_create.json @@ -1,8 +1,20 @@ -[ - "test_can_specify_key_manager", - "test_can_specify_publish_and_gateway_url", - "test_should_add_optional_verification_methods", - "test_should_add_optional_services", - "test_should_add_optional_also_known_as", - "test_should_add_optional_controllers" -] +{ + "test_names": [ + "test_can_specify_key_manager", + "test_can_specify_publish_and_gateway_url", + "test_should_add_optional_verification_methods", + "test_should_add_optional_services", + "test_should_add_optional_also_known_as", + "test_should_add_optional_controllers" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/methods/dht/DidDhtTests.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/methods/did_dht/mod.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/did_dht_publish.json b/tests/unit_test_cases/did_dht_publish.json index 5a67f9d4..5146cbd9 100644 --- a/tests/unit_test_cases/did_dht_publish.json +++ b/tests/unit_test_cases/did_dht_publish.json @@ -1,4 +1,16 @@ -[ - "test_can_specify_gateway_url", - "test_can_handle_network_error" -] +{ + "test_names": [ + "test_can_specify_gateway_url", + "test_can_handle_network_error" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/methods/dht/DidDhtTests.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/methods/did_dht/mod.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/did_dht_resolve.json b/tests/unit_test_cases/did_dht_resolve.json index bdef7ca8..7d1a8610 100644 --- a/tests/unit_test_cases/did_dht_resolve.json +++ b/tests/unit_test_cases/did_dht_resolve.json @@ -1,7 +1,19 @@ -[ - "test_invalid_did", - "test_method_not_supported", - "test_not_found", - "test_internal_error", - "test_can_create_then_resolve" -] +{ + "test_names": [ + "test_invalid_did", + "test_method_not_supported", + "test_not_found", + "test_internal_error", + "test_can_create_then_resolve" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/methods/dht/DidDhtTests.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/methods/did_dht/mod.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/did_jwk_create.json b/tests/unit_test_cases/did_jwk_create.json index f8feae03..b1df4bd5 100644 --- a/tests/unit_test_cases/did_jwk_create.json +++ b/tests/unit_test_cases/did_jwk_create.json @@ -1,5 +1,17 @@ -[ - "test_can_specify_key_manager", - "test_can_specify_secp256k1", - "test_defaults_to_ed25519" -] +{ + "test_names": [ + "test_can_specify_key_manager", + "test_can_specify_secp256k1", + "test_defaults_to_ed25519" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/methods/jwk/DidJwkTests.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/methods/did_jwk.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/did_jwk_resolve.json b/tests/unit_test_cases/did_jwk_resolve.json index 6ba98d69..78e6c8c2 100644 --- a/tests/unit_test_cases/did_jwk_resolve.json +++ b/tests/unit_test_cases/did_jwk_resolve.json @@ -1 +1,16 @@ -["test_invalid_did", "test_create_then_resolve"] +{ + "test_names": [ + "test_invalid_did", + "test_create_then_resolve" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/methods/jwk/DidJwkTests.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/methods/did_jwk.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/did_parse.json b/tests/unit_test_cases/did_parse.json index 0fc28488..b14c3b21 100644 --- a/tests/unit_test_cases/did_parse.json +++ b/tests/unit_test_cases/did_parse.json @@ -1,19 +1,31 @@ -[ - "test_did_empty_string_should_error", - "test_did_incomplete_scheme_should_error", - "test_did_missing_id_part_should_error", - "test_did_missing_id_should_error", - "test_did_invalid_characters_in_id_should_error", - "test_did_invalid_bare_id_should_error", - "test_did_invalid_percent_encoding_should_error", - "test_did_invalid_percent_encoding_incomplete_should_error", - "test_did_capitalized_method_should_error", - "test_did_invalid_additional_id_should_error", - "test_did_valid_did_no_params_path_query_fragment", - "test_did_valid_did_with_params", - "test_did_valid_did_with_query", - "test_did_valid_did_with_fragment", - "test_did_valid_did_with_query_and_fragment", - "test_did_valid_did_with_params_query_and_fragment", - "test_did_valid_did_with_path" -] +{ + "test_names": [ + "test_did_empty_string_should_error", + "test_did_incomplete_scheme_should_error", + "test_did_missing_id_part_should_error", + "test_did_missing_id_should_error", + "test_did_invalid_characters_in_id_should_error", + "test_did_invalid_bare_id_should_error", + "test_did_invalid_percent_encoding_should_error", + "test_did_invalid_percent_encoding_incomplete_should_error", + "test_did_capitalized_method_should_error", + "test_did_invalid_additional_id_should_error", + "test_did_valid_did_no_params_path_query_fragment", + "test_did_valid_did_with_params", + "test_did_valid_did_with_query", + "test_did_valid_did_with_fragment", + "test_did_valid_did_with_query_and_fragment", + "test_did_valid_did_with_params_query_and_fragment", + "test_did_valid_did_with_path" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/DidTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/did.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/did_web_create.json b/tests/unit_test_cases/did_web_create.json index 9bade6a8..567d3948 100644 --- a/tests/unit_test_cases/did_web_create.json +++ b/tests/unit_test_cases/did_web_create.json @@ -1,16 +1,28 @@ -[ - "test_can_specify_key_manager", - "test_can_specify_secp256k1", - "test_defaults_to_ed25519", - "test_invalid_domain", - "test_should_allow_http_for_localhost", - "test_must_be_https", - "test_should_trim_did_json", - "test_should_trim_well_known", - "test_should_percent_encode_colons", - "test_should_replace_path_with_colons", - "test_should_add_optional_verification_methods", - "test_should_add_optional_services", - "test_should_add_optional_also_known_as", - "test_should_add_optional_controllers" -] +{ + "test_names": [ + "test_can_specify_key_manager", + "test_can_specify_secp256k1", + "test_defaults_to_ed25519", + "test_invalid_domain", + "test_should_allow_http_for_localhost", + "test_must_be_https", + "test_should_trim_did_json", + "test_should_trim_well_known", + "test_should_percent_encode_colons", + "test_should_replace_path_with_colons", + "test_should_add_optional_verification_methods", + "test_should_add_optional_services", + "test_should_add_optional_also_known_as", + "test_should_add_optional_controllers" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/methods/web/DidWebTests.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/methods/did_web/mod.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/did_web_resolve.json b/tests/unit_test_cases/did_web_resolve.json index 6ba98d69..f30e9d2e 100644 --- a/tests/unit_test_cases/did_web_resolve.json +++ b/tests/unit_test_cases/did_web_resolve.json @@ -1 +1,16 @@ -["test_invalid_did", "test_create_then_resolve"] +{ + "test_names": [ + "test_invalid_did", + "test_create_then_resolve" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/methods/web/DidWebTests.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/methods/did_web/mod.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/ed25519_generate.json b/tests/unit_test_cases/ed25519_generate.json index 76513941..57d97b7d 100644 --- a/tests/unit_test_cases/ed25519_generate.json +++ b/tests/unit_test_cases/ed25519_generate.json @@ -1,7 +1,19 @@ -[ - "test_must_set_alg", - "test_must_set_kty", - "test_must_set_crv", - "test_must_set_public_key_with_correct_length", - "test_must_set_private_key_with_correct_length" -] +{ + "test_names": [ + "test_must_set_alg", + "test_must_set_kty", + "test_must_set_crv", + "test_must_set_public_key_with_correct_length", + "test_must_set_private_key_with_correct_length" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/crypto/Ed25519GeneratorTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/crypto/dsa/ed25519.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/ed25519_sign.json b/tests/unit_test_cases/ed25519_sign.json index 55edacad..f3b83c7e 100644 --- a/tests/unit_test_cases/ed25519_sign.json +++ b/tests/unit_test_cases/ed25519_sign.json @@ -1,5 +1,17 @@ -[ - "test_with_valid_key", - "test_with_invalid_private_key", - "test_with_missing_private_key" -] +{ + "test_names": [ + "test_with_valid_key", + "test_with_invalid_private_key", + "test_with_missing_private_key" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/crypto/signers/Ed25519SignerTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/crypto/dsa/ed25519.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/ed25519_verify.json b/tests/unit_test_cases/ed25519_verify.json index 4e31615f..5adf3400 100644 --- a/tests/unit_test_cases/ed25519_verify.json +++ b/tests/unit_test_cases/ed25519_verify.json @@ -1,7 +1,19 @@ -[ - "test_with_valid_signature", - "test_with_private_key", - "test_with_invalid_signature", - "test_with_invalid_public_key", - "test_with_invalid_signature_length" -] +{ + "test_names": [ + "test_with_valid_signature", + "test_with_private_key", + "test_with_invalid_signature", + "test_with_invalid_public_key", + "test_with_invalid_signature_length" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/crypto/verifiers/Ed25519VerifierTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/crypto/dsa/ed25519.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/in_memory_key_manager_export_private_jwks.json b/tests/unit_test_cases/in_memory_key_manager_export_private_jwks.json index bb7cdbb5..fabdba24 100644 --- a/tests/unit_test_cases/in_memory_key_manager_export_private_jwks.json +++ b/tests/unit_test_cases/in_memory_key_manager_export_private_jwks.json @@ -1,5 +1,17 @@ -[ - "test_export_empty_list", - "test_export_single_key", - "test_export_multiple_keys" -] +{ + "test_names": [ + "test_export_empty_list", + "test_export_single_key", + "test_export_multiple_keys" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/crypto/keys/InMemoryKeyManagerTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/crypto/key_managers/in_memory_key_manager.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/in_memory_key_manager_get_signer.json b/tests/unit_test_cases/in_memory_key_manager_get_signer.json index 12ed31ad..77c0c541 100644 --- a/tests/unit_test_cases/in_memory_key_manager_get_signer.json +++ b/tests/unit_test_cases/in_memory_key_manager_get_signer.json @@ -1 +1,17 @@ -["test_must_be_public_key", "test_not_found", "test_found"] +{ + "test_names": [ + "test_must_be_public_key", + "test_not_found", + "test_found" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/crypto/keys/InMemoryKeyManagerTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/crypto/key_managers/in_memory_key_manager.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/in_memory_key_manager_import_private_jwk.json b/tests/unit_test_cases/in_memory_key_manager_import_private_jwk.json index 91584984..5997bef4 100644 --- a/tests/unit_test_cases/in_memory_key_manager_import_private_jwk.json +++ b/tests/unit_test_cases/in_memory_key_manager_import_private_jwk.json @@ -1 +1,16 @@ -["test_must_be_private_jwk", "test_successfully_imports_and_returns_public_jwk"] +{ + "test_names": [ + "test_must_be_private_jwk", + "test_successfully_imports_and_returns_public_jwk" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/crypto/keys/InMemoryKeyManagerTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/crypto/key_managers/in_memory_key_manager.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/jwk_compute_thumbprint.json b/tests/unit_test_cases/jwk_compute_thumbprint.json index 2e7735a5..60cc4d88 100644 --- a/tests/unit_test_cases/jwk_compute_thumbprint.json +++ b/tests/unit_test_cases/jwk_compute_thumbprint.json @@ -1,10 +1,22 @@ -[ - "test_ec_valid", - "test_okp_valid", - "test_unsupported_kty", - "test_empty_kty", - "test_empty_x", - "test_empty_crv", - "test_ec_missing_y", - "test_ec_empty_y" -] +{ + "test_names": [ + "test_ec_valid", + "test_okp_valid", + "test_unsupported_kty", + "test_empty_kty", + "test_empty_x", + "test_empty_crv", + "test_ec_missing_y", + "test_ec_empty_y" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/crypto/keys/JwkTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/crypto/jwk.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/resolution_result_resolve.json b/tests/unit_test_cases/resolution_result_resolve.json index ffd5a28e..48e349ec 100644 --- a/tests/unit_test_cases/resolution_result_resolve.json +++ b/tests/unit_test_cases/resolution_result_resolve.json @@ -1,6 +1,18 @@ -[ - "test_invalid_did", - "test_did_jwk", - "test_did_web", - "test_method_not_supported" -] +{ + "test_names": [ + "test_invalid_did", + "test_did_jwk", + "test_did_web", + "test_method_not_supported" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/dids/ResolutionResultTests.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/dids/resolution/resolution_result.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/verifiable_credential_1_1_create.json b/tests/unit_test_cases/verifiable_credential_1_1_create.json index 82b81eff..58e4001e 100644 --- a/tests/unit_test_cases/verifiable_credential_1_1_create.json +++ b/tests/unit_test_cases/verifiable_credential_1_1_create.json @@ -1,34 +1,46 @@ -[ - "test_default_context_added_if_not_supplied", - "test_default_context_not_duplicated_if_supplied", - "test_developer_provided_context_appended_to_default", - "test_default_type_added_if_not_supplied", - "test_default_type_not_duplicated_if_supplied", - "test_developer_provided_type_appended_to_default", - "test_id_generated_if_not_supplied", - "test_id_must_be_set_if_supplied", - "test_issuer_string_must_not_be_empty", - "test_issuer_string_must_be_set", - "test_issuer_string_must_be_valid_did", - "test_issuer_object_id_must_not_be_empty", - "test_issuer_object_id_must_be_valid_did", - "test_issuer_object_name_must_not_be_empty", - "test_issuer_object_must_be_set", - "test_issuer_object_supports_additional_properties", - "test_credential_subject_id_must_not_be_empty", - "test_credential_subject_must_be_set", - "test_credential_subject_supports_additional_properties", - "test_issuance_date_must_be_set", - "test_issuance_date_must_be_now_if_not_supplied", - "test_expiration_date_must_be_set_if_supplied", - "test_evidence_must_be_set_if_supplied", - "test_schema_type_must_be_jsonschema", - "test_schema_resolve_network_issue", - "test_schema_resolve_non_success", - "test_schema_resolve_invalid_response_body", - "test_schema_invalid_json_schema", - "test_schema_do_not_support_draft04", - "test_schema_do_not_support_draft06", - "test_schema_fails_validation", - "test_schema_example_from_spec" -] +{ + "test_names": [ + "test_default_context_added_if_not_supplied", + "test_default_context_not_duplicated_if_supplied", + "test_developer_provided_context_appended_to_default", + "test_default_type_added_if_not_supplied", + "test_default_type_not_duplicated_if_supplied", + "test_developer_provided_type_appended_to_default", + "test_id_generated_if_not_supplied", + "test_id_must_be_set_if_supplied", + "test_issuer_string_must_not_be_empty", + "test_issuer_string_must_be_set", + "test_issuer_string_must_be_valid_did", + "test_issuer_object_id_must_not_be_empty", + "test_issuer_object_id_must_be_valid_did", + "test_issuer_object_name_must_not_be_empty", + "test_issuer_object_must_be_set", + "test_issuer_object_supports_additional_properties", + "test_credential_subject_id_must_not_be_empty", + "test_credential_subject_must_be_set", + "test_credential_subject_supports_additional_properties", + "test_issuance_date_must_be_set", + "test_issuance_date_must_be_now_if_not_supplied", + "test_expiration_date_must_be_set_if_supplied", + "test_evidence_must_be_set_if_supplied", + "test_schema_type_must_be_jsonschema", + "test_schema_resolve_network_issue", + "test_schema_resolve_non_success", + "test_schema_resolve_invalid_response_body", + "test_schema_invalid_json_schema", + "test_schema_do_not_support_draft04", + "test_schema_do_not_support_draft06", + "test_schema_fails_validation", + "test_schema_example_from_spec" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/vc/VerifiableCredentialTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/credentials/create.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/verifiable_credential_1_1_from_vc_jwt.json b/tests/unit_test_cases/verifiable_credential_1_1_from_vc_jwt.json index e4ad3d8b..afb78d49 100644 --- a/tests/unit_test_cases/verifiable_credential_1_1_from_vc_jwt.json +++ b/tests/unit_test_cases/verifiable_credential_1_1_from_vc_jwt.json @@ -1,44 +1,56 @@ -[ - "test_missing_kid_jose_header", - "test_empty_kid_jose_header", - "test_kid_invalid_did_uri", - "test_kid_fail_to_resolve_did", - "test_kid_missing_verification_method", - "test_fails_cryptographic_verification", - "test_passes_cryptographic_verification", - "test_can_skip_cryptographic_verification", - "test_can_skip_data_model_validation", - "test_can_skip_credential_schema_validation", - "test_decode_issuer_string", - "test_decode_issuer_object", - "test_decode_evidence", - "test_decode_credential_schema", - "test_decode_missing_vc_claim", - "test_decode_missing_jti_claim", - "test_decode_missing_issuer_claim", - "test_decode_missing_subject_claim", - "test_decode_missing_nbf_claim", - "test_decode_claim_mismatch_id", - "test_decode_claim_mismatch_issuer", - "test_decode_claim_mismatch_subject", - "test_decode_claim_misconfigured_exp", - "test_decode_claim_mismatch_exp", - "test_validate_dm_empty_id", - "test_validate_dm_empty_context", - "test_validate_dm_context_base_mismatch", - "test_validate_dm_empty_type", - "test_validate_dm_type_base_mismatch", - "test_validate_dm_empty_issuer", - "test_validate_dm_empty_subject", - "test_validate_dm_issuance_in_future", - "test_validate_dm_credential_expired", - "test_schema_type_must_be_jsonschema", - "test_schema_resolve_network_issue", - "test_schema_resolve_non_success", - "test_schema_resolve_invalid_response_body", - "test_schema_invalid_json_schema", - "test_schema_do_not_support_draft04", - "test_schema_do_not_support_draft06", - "test_schema_fails_validation", - "test_schema_example_from_spec" -] +{ + "test_names": [ + "test_missing_kid_jose_header", + "test_empty_kid_jose_header", + "test_kid_invalid_did_uri", + "test_kid_fail_to_resolve_did", + "test_kid_missing_verification_method", + "test_fails_cryptographic_verification", + "test_passes_cryptographic_verification", + "test_can_skip_cryptographic_verification", + "test_can_skip_data_model_validation", + "test_can_skip_credential_schema_validation", + "test_decode_issuer_string", + "test_decode_issuer_object", + "test_decode_evidence", + "test_decode_credential_schema", + "test_decode_missing_vc_claim", + "test_decode_missing_jti_claim", + "test_decode_missing_issuer_claim", + "test_decode_missing_subject_claim", + "test_decode_missing_nbf_claim", + "test_decode_claim_mismatch_id", + "test_decode_claim_mismatch_issuer", + "test_decode_claim_mismatch_subject", + "test_decode_claim_misconfigured_exp", + "test_decode_claim_mismatch_exp", + "test_validate_dm_empty_id", + "test_validate_dm_empty_context", + "test_validate_dm_context_base_mismatch", + "test_validate_dm_empty_type", + "test_validate_dm_type_base_mismatch", + "test_validate_dm_empty_issuer", + "test_validate_dm_empty_subject", + "test_validate_dm_issuance_in_future", + "test_validate_dm_credential_expired", + "test_schema_type_must_be_jsonschema", + "test_schema_resolve_network_issue", + "test_schema_resolve_non_success", + "test_schema_resolve_invalid_response_body", + "test_schema_invalid_json_schema", + "test_schema_do_not_support_draft04", + "test_schema_do_not_support_draft06", + "test_schema_fails_validation", + "test_schema_example_from_spec" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/vc/VerifiableCredentialTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/credentials/verifiable_credential_1_1.rs" + } + ] +} \ No newline at end of file diff --git a/tests/unit_test_cases/verifiable_credential_1_1_sign.json b/tests/unit_test_cases/verifiable_credential_1_1_sign.json index 46491721..e2aa791f 100644 --- a/tests/unit_test_cases/verifiable_credential_1_1_sign.json +++ b/tests/unit_test_cases/verifiable_credential_1_1_sign.json @@ -1,6 +1,18 @@ -[ - "test_can_sign_then_verify", - "test_bearer_did_mismatch_issuer", - "test_defaults_to_first_vm", - "test_vm_must_be_assertion_method" -] +{ + "test_names": [ + "test_can_sign_then_verify", + "test_bearer_did_mismatch_issuer", + "test_defaults_to_first_vm", + "test_vm_must_be_assertion_method" + ], + "test_files": [ + { + "language": "kotlin", + "path": "bound/kt/src/test/kotlin/web5/sdk/vc/VerifiableCredentialTest.kt" + }, + { + "language": "rust", + "path": "crates/web5/src/credentials/sign.rs" + } + ] +} \ No newline at end of file