wst
12/04/2016, 2:46 PMTaskProcessor.start(job: Job)
and verify argument with which it has been invoked.
val argumentCaptor: ArgumentCaptor<Job> = ArgumentCaptor.forClass(Job::class.java)
Mockito.verify(mockTaskProcessor).start(argumentCaptor.capture())
That gives me an IllegalStateException when run, because Mockito is using null
as an mock arguments, and that obviously is against Kotlin's safety policy. I could relax function definition TaskProcessor.start(job: Job?)
but I'm loosing all Kotlin's advantage in terms of null safety. What would be the best method to capture and verify mocked arguments?