chore: use the API timestamp format in test fixtures - #121
Open
felipefreitag wants to merge 1 commit into
Open
Conversation
The API returns timestamps in Postgres text format, not ISO 8601. Convert the response fixtures in the util classes and the mock JSON in the test classes together, so expected objects and mock responses stay in sync. Keep ISO 8601 for scheduledAt request payloads, the signed webhook payloads in the verify tests, and revoked_at in the revoke response. No runtime changes: every timestamp field is a plain String.
klotty
approved these changes
Aug 7, 2026
klotty
left a comment
There was a problem hiding this comment.
No issues found across 32 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: All changes are in test fixtures—switching mock timestamp strings to match the API's actual Postgres text format. No runtime code, no behavioral change, no operational tradeoff.
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context for reviewers
The Resend API returns timestamps in Postgres text format:
YYYY-MM-DD HH:MM:SS[.ffffff]+00(for example2023-10-06 23:47:56.678+00). It is not ISO 8601. Fractional seconds vary from zero to six digits, so no fixed width can be assumed.Our docs, OpenAPI spec, and SDK test fixtures claimed ISO 8601 for a long time. We fixed the docs and the spec, and we are now updating every SDK so the fixtures show what the API really sends. The SDKs treat these values as opaque strings, so behavior does not change.
ISO 8601 remains correct in three places:
scheduled_atas a request parameter, webhook event payloads (millisecond precision withZ), andrevoked_atin the DELETE/oauth/grants/{id}response.What
Convert 143 fixture lines across 32 files. Each
*Util.javaexpected object mirrors the mock JSON in the matching*Test.java, so both sides change together.ContactImports,DomainClaims, and the OAuth grant list fixtures already used the correct format.What stays ISO 8601 on purpose
scheduledAtin request payloads and the javadoc on the request builders. The API accepts ISO there.WebhooksTest(verify()tests). Webhooks emit ISO, and these exact bytes feed the HMAC signature.revoked_atin the revoke OAuth grant response. That endpoint returns ISO.Verification
./gradlew test: all 22 test classes pass.Summary by cubic
Switch test fixtures to the API’s Postgres text timestamp format (e.g., "2023-10-06 23:47:56.678+00") so mocked responses and expected objects match real API behavior. No runtime changes; timestamps remain plain strings.
Written for commit 5fa8b8f. Summary will update on new commits.