Skip to content

Add LibraryInitializer registration tests#483

Merged
nodh merged 1 commit intodevelopfrom
codex/add-tests-for-libraryinitializer
Jan 22, 2026
Merged

Add LibraryInitializer registration tests#483
nodh merged 1 commit intodevelopfrom
codex/add-tests-for-libraryinitializer

Conversation

@nodh
Copy link
Copy Markdown
Member

@nodh nodh commented Jan 16, 2026

Motivation

  • Verify that LibraryInitializer.registerExtensionLibrary correctly registers credential schemes and polymorphic serializers for CredentialSubject subtypes.
  • Ensure ISO-MDOC registration overload wires jsonValueEncoder and CborCredentialSerializer so values can be encoded/decoded in IssuerSignedItem instances.

Description

  • Add src/commonTest/kotlin/at/asitplus/wallet/lib/LibraryInitializerTest.kt containing tests that register a dummy CredentialScheme and a SerializersModule with a test CredentialSubject subclass.
  • Create a TestCredentialScheme implementation and validate registration via AttributeIndex.resolveAttributeType(...) for the vcType lookup.
  • Add an ISO-focused test that provides a jsonValueEncoder and itemValueSerializerMap, asserts JsonCredentialSerializer.encode(...) behavior, and performs a CBOR round-trip using IssuerSignedItemSerializer and coseCompliantSerializer.

Testing

  • No automated tests were executed as part of this change.
  • A new unit test file LibraryInitializerTest.kt was added that exercises LibraryInitializer.registerExtensionLibrary and ISO encoder/serializer round-trip behavior, but it has not been run in CI for this PR.

Codex Task

@nodh nodh force-pushed the codex/add-tests-for-libraryinitializer branch from b1b1683 to 993a9c5 Compare January 16, 2026 19:57
@nodh nodh requested a review from JesusMcCloud January 16, 2026 19:57
@nodh nodh self-assigned this Jan 16, 2026
Copy link
Copy Markdown
Collaborator

@JesusMcCloud JesusMcCloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I, for one, welcome our AI overlords!

@nodh nodh merged commit 5e64f5b into develop Jan 22, 2026
4 checks passed
@nodh nodh deleted the codex/add-tests-for-libraryinitializer branch January 22, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants