Skip to content

feat: UriResolver and UriStrategy.#96

Merged
MessiasLima merged 3 commits into
mainfrom
opencode/issue76-20260701161608
Jul 1, 2026
Merged

feat: UriResolver and UriStrategy.#96
MessiasLima merged 3 commits into
mainfrom
opencode/issue76-20260701161608

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Implemented UriResolver and UriStrategy in the :android module.

Changes

  • New: android/src/main/java/dev/appoutlet/some/android/strategy/UriStrategy.kt

    • Sealed interface extending Strategy
    • Variants: Random (default), Content, File, Url
    • Shared key = UriStrategy::class
  • New: android/src/main/java/dev/appoutlet/some/android/resolver/UriResolver.kt

    • Fetches UriStrategy once in init: strategyProvider.get<UriStrategy>() ?: UriStrategy.default
    • canResolve uses exact type matching: type == typeOf<Uri>()
    • resolve chooses the scheme via when on the strategy, then randomly generates host, path, and optional query/fragment
    • Returns Uri.parse(...) result
  • New: android/src/test/java/dev/appoutlet/some/android/resolver/UriResolverTest.kt

    • Covers canResolve for Uri and non-Uri types
    • Verifies each strategy variant produces the correct scheme
    • Verifies generated URIs have non-empty host/path and are re-parseable
  • Build: Added Robolectric 4.14.1 as a test-only dependency so Uri.parse works in JVM unit tests.

Verification

./gradlew test detekt --rerun-tasks

All tests and detekt checks pass.

Closes #76

New%20session%20-%202026-07-01T16%3A16%3A07.694Z
opencode session  |  github run

Co-authored-by: MessiasLima <MessiasLima@users.noreply.github.com>
@MessiasLima MessiasLima changed the title Added UriResolver and UriStrategy. feat: UriResolver and UriStrategy. Jul 1, 2026
@MessiasLima MessiasLima merged commit 10a2596 into main Jul 1, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in Some Jul 1, 2026
@MessiasLima MessiasLima deleted the opencode/issue76-20260701161608 branch July 1, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Implement UriResolver and UriStrategy

1 participant