Skip to content

feat: Replace tautological tests with real IHttpClient injection#112

Merged
kewynakshlley merged 7 commits into
mainfrom
feat/tests
Jun 30, 2026
Merged

feat: Replace tautological tests with real IHttpClient injection#112
kewynakshlley merged 7 commits into
mainfrom
feat/tests

Conversation

@kewynakshlley

Copy link
Copy Markdown
Collaborator

No description provided.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

5 issues found across 46 files

Confidence score: 3/5

  • src/main/java/com/resend/services/domains/Domains.java in claims() drops the injected IHttpClient by constructing DomainClaims with the single-arg constructor, so custom/mock clients can be silently bypassed and calls may hit the wrong transport at runtime — pass the injected client through when creating DomainClaims before merging.
  • src/main/java/com/resend/services/contacts/Contacts.java does not propagate the injected IHttpClient to lazy sub-services (segments, topics, imports), which can cause inconsistent behavior where parent and child services use different clients — wire the same injected client into all sub-service constructors.
  • Test coverage is a bit weak in src/test/java/com/resend/services/batch/BatchTest.java, src/test/java/com/resend/services/logs/LogsTest.java, and src/test/java/com/resend/services/automations/AutomationsTest.java (unclosed openMocks, missing pagination size assertion, and missing error-message assertion), so regressions in client wiring and response validation may slip through — tighten these tests and close mock resources (or use MockitoExtension) to de-risk the merge.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/test/java/com/resend/services/logs/LogsTest.java">

<violation number="1" location="src/test/java/com/resend/services/logs/LogsTest.java:87">
P3: Missing assertion on data size in pagination test. testListLogsWithPagination_Success doesn't assert `res.getData().size()`, unlike the cursor tests which verify deserialization produced the expected 3 entries.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/main/java/com/resend/services/domains/Domains.java Outdated
Comment thread src/main/java/com/resend/services/contacts/Contacts.java
Comment thread src/test/java/com/resend/services/batch/BatchTest.java Outdated
Comment thread src/test/java/com/resend/services/logs/LogsTest.java
Comment thread src/test/java/com/resend/services/automations/AutomationsTest.java

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 4 files (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Jun 30, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Re-trigger cubic

joaopcm
joaopcm previously approved these changes Jun 30, 2026
Comment thread src/test/java/com/resend/services/batch/BatchTest.java Outdated
Comment thread src/test/java/com/resend/services/domains/DomainsTest.java
@kewynakshlley kewynakshlley dismissed stale reviews from joaopcm and cubic-dev-ai[bot] via ec09f72 June 30, 2026 20:20

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Re-trigger cubic

@kewynakshlley kewynakshlley merged commit a482295 into main Jun 30, 2026
6 checks passed
@kewynakshlley kewynakshlley deleted the feat/tests branch June 30, 2026 20:23
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.

2 participants