use Spy On Equals If
abstract fun useSpyOnEqualsIf(spyTarget: Any?, other: Any?, spyOn: (Any?) -> Boolean, mockKlass: KClass<out Any>)
Binds the given function, which should be equals, to the Proxy. The spy equals method will be used if the other object is not of the same type as the given Class of the hosting mock. The equals method will be used if the other object is of the same type as the given Class of the hosting mock.
Parameters
spy Target
the referenced object which is spied upon.
other
the object to compare to if the hosting mock is used instead of the spy target.
spy On
function which should reference the spy target equals method.
mock Klass
the KClass of the hosting mock.