Open
Description
class UnderTest {
fun doStuff(string1: String, string2: String = "hello world") = "do stuff"
}
@Test
fun testIt() {
val underTest = mock(UnderTest::class.java)
whenever(underTest.doStuff(anyString())).thenReturn("stuff done")
}
InvalidUseOfMatchersException "This exception may occur if matchers are combined with raw values"
Theoretically adding @jvmoverloads to doStuff should fix it but it didn't. Even if it did, it would be nice if mockito-kotlin could figure out how to generate a matcher that matches the default value. Alternatively, automatically generate an any() matcher.