artem_zin
10/11/2016, 7:30 AMopen class StatefulAction1<T : Any> : Action1<T> {
var state by Delegates.notNull<T>()
override fun call(t: T) {
state = t
}
}
And test code:
val action = Mockito.spy(StatefulAction1<String>())
action.call(“one”)
verify(action).call(“one”)
verifyNoMoreInteractions(action) // This line fails with Mockito 2, passes with Mockito 1.