Skip to content

test: add unit tests for UUIDStringUtils#3

Draft
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1774289163-uuid-string-utils-tests
Draft

test: add unit tests for UUIDStringUtils#3
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1774289163-uuid-string-utils-tests

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot commented Mar 23, 2026

📜 Description

Adds 10 unit tests for UUIDStringUtils, which previously had zero test coverage. This utility converts UUID and raw long values into Sentry's dash-free lowercase hex ID strings and is used internally by SentryId and SpanId.

Tests cover:

  • toSentryIdString (32-char output): known UUID, all-zeros, all-ones, long-based overload consistency
  • toSentrySpanIdString (16-char output): known UUID, all-zeros, all-ones, long-based overload consistency
  • Structural invariants: output is always lowercase; span ID equals the first 16 characters of the full ID

💡 Motivation and Context

UUIDStringUtils is a foundational utility — if its hex encoding is wrong, every event ID and span ID in the SDK is wrong. Despite this, it had no dedicated tests. This is a test-only change with no production code modifications.

💚 How did you test it?

./gradlew :sentry:test --tests "*UUIDStringUtilsTest*"
# All 10 tests PASSED

./gradlew :sentry:spotlessApply
# Formatting clean

Reviewer checklist

  • Verify the hardcoded expected hex strings match the input UUIDs with dashes stripped (e.g. a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11a0eebc999c0b4ef8bb6d6bb9bd380a11)
  • Consider whether any additional edge cases are worth covering (e.g. UUID version/variant-specific bit patterns)

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Other zero-coverage utility classes in sentry/util that could benefit from the same treatment: ClassLoaderUtils, ErrorUtils, Objects, Pair.

Link to Devin session: https://app.devin.ai/sessions/23aaff7eb99e45c79503152f36003ab8
Requested by: @aks4396


Open with Devin

@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant