Skip to content

fix: enable confirmVerified to work with static mocks#1396

Merged
Raibaz merged 2 commits intomockk:masterfrom
happysubin:master
May 18, 2025
Merged

fix: enable confirmVerified to work with static mocks#1396
Raibaz merged 2 commits intomockk:masterfrom
happysubin:master

Conversation

@happysubin
Copy link
Copy Markdown
Contributor

fixes #242

When a static class is mocked using the mockStatic method, its javaClass is used as the key in the stubRepo.
To make use of this, add logic to convert a given KClass to its javaClass and use it in the when clause.

@Raibaz
Copy link
Copy Markdown
Collaborator

Raibaz commented May 18, 2025

This looks good, thanks for looking into it!

@Raibaz Raibaz merged commit 4bf4ec7 into mockk:master May 18, 2025
22 checks passed
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.

Bug: enable confirmVerified to work with static mocks

2 participants