mockito / mockito-kotlin

Using Mockito with Kotlin
MIT License
3.09k stars 198 forks source link

Provide AdditionalMatchers for Kotlin #507

Closed paulferaud closed 5 months ago

paulferaud commented 5 months ago

I need this because most AdditionalMatcher actually return null, creating NPE issues.

I can work on implementing and testing this. I'm not sure if these functions should be in global scope, alongside everything else, or scoped to an AdditionalMatchers object though?

paulferaud commented 5 months ago

To clarify, I had:

verify(myCLass).processString(not(contains("{{")))

After porting my class to Kotlin, and marking the string in processString as non-nullable, I got:

not(...) must not be null

Which... actually took a fair amount of time to figure out.