Closed thevoiceless closed 2 years ago
For anyone wanting to use this in the meantime: You simply replace whenever
with Mockito.lenient().`when`
, orMockito.mock(Foo::class.java, withSettings().lenient())
to make the entire mock lenient.
Actually, it looks like this may have been fixed 10 days ago with https://github.com/nhaarman/mockito-kotlin/pull/353
It allows passing the lenient
parameter to mock(...)
but does not add a lenient version of whenever
See https://github.com/mockito/mockito/pull/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()
.