You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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")
}
Use of Matchers Is Invalid Exception "This exception may occur if matchers are combined with raw values"
It should have been fixed theoretically by adding @jvmoverloads to doStuff, but it wasn't. If mockito-kotlin could figure out how to construct a matcher that matches the default value, that would be helpful, too. Alternatively, have an any() matcher generated automatically.
The text was updated successfully, but these errors were encountered:
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")
}
Use of Matchers Is Invalid Exception "This exception may occur if matchers are combined with raw values"
It should have been fixed theoretically by adding @jvmoverloads to doStuff, but it wasn't. If mockito-kotlin could figure out how to construct a matcher that matches the default value, that would be helpful, too. Alternatively, have an any() matcher generated automatically.
The text was updated successfully, but these errors were encountered: