Can someone help me with the problem I keep facing with value classes? I have a simple class that holds multiple fields, but one of the is the "Duration" value class of kotlin. when I try to mockk it, (v1.12.2) I keep getting classcastexceptions from Long to Duration
yeah I saw this as well. It is what it is, but now I literally have no idea how to properly test this 🤔
e
ephemient
05/13/2022, 1:29 PM
does
Copy code
every { someClass.duration as Any? }.returns(30.minutes as Any?)
work? (just a thought, there's a good chance that doesn't help) otherwise you'll just have to avoid mocking by using the real object or a writing a fake