Kulwinder Singh
03/10/2020, 12:11 PMMockKException: no answer found for: MyClass(#1).sendMessage(okhttp3.RequestBody$2@4ed4bd33)
,
actually RequestBody's properties are same just instance is different. that's why it did not matches parameters but if i add any()
instead of requestbody it works. is there anything else i can use instead of any()
here ?
every { myClass.sendMessage(MockRequest.createTestBody(value="text")) } answers { something }
....
class SomeObject(myClass:MyClass){
fun doSomething(text: String): Flowable<Result<Boolean>> {
val request = MockRequest.createTestBody(text)
myClass.sendMessage(request)
}
}
....
i have checked documentation of mockk but didn't found anything, that's why asked here:Matt Thompson
03/10/2020, 12:53 PMcreateTestBody
doesn’t implement equals
correctly. maybe return a data class if possible?Kulwinder Singh
03/10/2020, 1:29 PMcreateTestBody
returns RequestBody
from okhttp @Matt ThompsonMatt Thompson
03/10/2020, 10:27 PM