Kris Wong
04/22/2020, 6:37 PMmockkObject(AppLockedState)
every { AppLockedState.isLocked() } answers { locked }
it seems to be executing the isLocked
method rather than using the answer. it's complaining that Boolean can't be cast to one of the types being used in the method implementationKris Wong
04/22/2020, 7:24 PMjava.lang.ClassCastException: java.lang.Boolean cannot be cast to <redacted>.SDKContext$State
at <redacted>_1_Proxy.getCurrentState(Unknown Source:19)
at <redacted>.AppLockedState.isLocked(AppLockedState.kt:34)
Kris Wong
04/22/2020, 7:27 PMevery
works by recording calls. it's also recording the call from a separate mocked object that is invoked by isLocked
. it's then using the same answer for both callsKris Wong
04/22/2020, 8:30 PMoleksiyp
04/22/2020, 9:46 PMoleksiyp
04/22/2020, 9:47 PMKris Wong
04/22/2020, 10:03 PM