Skip to content

Add tests for RemoteResourceRetrieverFunction behavior#482

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

Add tests for RemoteResourceRetrieverFunction behavior#482
nodh merged 1 commit intodevelopfrom
codex/add-tests-for-remoteresourceretrieverfunction

Conversation

@nodh
Copy link
Copy Markdown
Member

@nodh nodh commented Jan 16, 2026

Motivation

  • Ensure implementations of RemoteResourceRetrieverFunction follow the documented behavior of returning the response body when present or the Location header when the server responds with a redirect.
  • Cover higher-level consumers that rely on the retriever to fetch referenced resources during request parsing and credential offer retrieval.

Description

  • Add a new test file vck-openid/src/commonTest/kotlin/at/asitplus/wallet/lib/RemoteResourceRetrieverFunctionTest.kt with unit tests exercising the retriever behavior.
  • Implement FakeRemoteResourceRetriever and FakeHttpResponse in the test to simulate responses with a body or a Location value.
  • Add a test asserting that a body payload is used by RequestParser when present (request_uri case) and a test asserting that a Location redirect is followed by WalletService when fetching a credential_offer_uri.
  • Wire the fake retriever into RequestParser and WalletService instances inside the tests to validate the end-to-end behavior.

Testing

  • Added unit tests under vck-openid/src/commonTest, specifically two tests validating body-first and location-redirect behavior.
  • No automated test runs were executed as part of this change.

Codex Task

@nodh nodh force-pushed the codex/add-tests-for-remoteresourceretrieverfunction branch from bdc5b70 to 17a5b34 Compare January 16, 2026 19:55
@nodh nodh requested a review from JesusMcCloud January 16, 2026 19:55
@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.

Seems legit

@nodh nodh merged commit ec0d284 into develop Jan 22, 2026
4 checks passed
@nodh nodh deleted the codex/add-tests-for-remoteresourceretrieverfunction 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