Skip to content

INTER-2195: Ship built-in ClientInterface mock using testify/mock#63

Merged
kevinmia merged 14 commits into
mainfrom
feat/INTER-2195-ship-ClientInterface-mock
Jun 25, 2026
Merged

INTER-2195: Ship built-in ClientInterface mock using testify/mock#63
kevinmia merged 14 commits into
mainfrom
feat/INTER-2195-ship-ClientInterface-mock

Conversation

@kevinmia

@kevinmia kevinmia commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Adds a fingerprinttest package that gives SDK users a ready-made mock for testing their own code. The mock is built on testify/mock, a widely-used Go testing library, making it familiar and easy to read for most Go developers. The mock is backed by ClientInterface, a new interface extracted from the existing Client, which makes it injectable via the new WithClientInterface option.

Changes

  • fingerprinttest package: new companion module providing a pre-built MockClient for testing code that depends on the Fingerprint SDK
  • Added README.md for fingerprinttest and added a usage guide
  • Added a CHANGELOG.md for fingerprinttest
  • Updated README.mustache by adding Testing section that references fingerprinttest
  • Updated go.work: added fingerprinttest to the workspace

Validation

  • Created personal unit tests and confirmed it runs successfully. Refer to the `Testing` section in fingerprinttest README for an example of a test

Comment thread go.work
Comment thread fingerprinttest/mock_client.go Outdated

@necipallef necipallef left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

README template needs to be updated

@kevinmia kevinmia requested a review from necipallef June 24, 2026 23:11
Comment thread template/README.mustache Outdated
@kevinmia kevinmia requested a review from necipallef June 25, 2026 15:15
mcnulty-fp
mcnulty-fp previously approved these changes Jun 25, 2026

@mcnulty-fp mcnulty-fp 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.

Looks good! Just one nit about the wording in the changelog.

Comment thread fingerprinttest/CHANGELOG.md Outdated
Co-authored-by: Dan McNulty <212590662+mcnulty-fp@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Following releases will be created using changesets from this PR:

go-sdk@8.4.0

Minor Changes

  • client-interface: Add ClientInterface and WithClientInterface option, allowing custom implementations of the Fingerprint client without needing to implement the low-level API internals required by WithFingerprintAPI. WithFingerprintAPI is now deprecated in favor of WithClientInterface. (5321de3)

@mcnulty-fp mcnulty-fp dismissed necipallef’s stale review June 25, 2026 16:12

Confirmed with @necipallef that this can be dismissed.

@kevinmia kevinmia merged commit 7708f77 into main Jun 25, 2026
21 checks passed
@kevinmia kevinmia deleted the feat/INTER-2195-ship-ClientInterface-mock branch June 25, 2026 16:13
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.

3 participants