kotlin and ArgumentCaptor - IllegalStateException

后端 未结 8 1285
长发绾君心
长发绾君心 2020-12-30 18:44

I have a problem with capturing the Class argument via ArgumentCaptor. My test class looks like this:

@RunWith(RobolectricGradleTestRunner::class)
@Config(sd         


        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 19:13

    According this solution my solution here:

    fun  uninitialized(): T = null as T
    
    //open verificator
    val verificator = verify(activityHandlerMock)
    
    //capture (would be same with all matchers)
    classCaptor.capture()
    booleanCaptor.capture()
    
    //hack
    verificator.navigateTo(uninitialized(), uninitialized())
    

提交回复
热议问题