Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for per-mock strictness #325

Closed
thevoiceless opened this issue Feb 20, 2019 · 2 comments
Closed

Add support for per-mock strictness #325

thevoiceless opened this issue Feb 20, 2019 · 2 comments
Labels
type:proposed-enhancement A proposed enhancement to the api or behavior

Comments

@thevoiceless
Copy link

See mockito/mockito#1272

Mockito 2.20.1 added support for per-mock/stubbing strictness. It looks like the most straightforward option would be passing an additional argument to withSettings().

@nhaarman nhaarman added the type:proposed-enhancement A proposed enhancement to the api or behavior label Jul 5, 2019
@thevoiceless
Copy link
Author

For anyone wanting to use this in the meantime: You simply replace whenever with Mockito.lenient().`when`, or Mockito.mock(Foo::class.java, withSettings().lenient()) to make the entire mock lenient.

@thevoiceless
Copy link
Author

thevoiceless commented Sep 18, 2019

Actually, it looks like this may have been fixed 10 days ago with #353

It allows passing the lenient parameter to mock(...) but does not add a lenient version of whenever

@taeyeon-Kim taeyeon-Kim mentioned this issue Mar 5, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:proposed-enhancement A proposed enhancement to the api or behavior
Projects
None yet
Development

No branches or pull requests

2 participants