A rather serious question regarding android instru...
# android
d
A rather serious question regarding android instrumentation testing and kotlin: Is there a way in sight to mock kotlin classes in android ui tests? Using Dexopener and the AllOpen plugin feels.. kind of hacky and not very 'native'.
d
I am using Mockito to mock my both kotlin and java classes and it is working flawlessly.
d
In Instrumented tests? In Unit Test it works indeed fine with mock-maker-inline
d
Yes, it just works in instrumentation tests as below.
testCompile group: 'org.mockito', name: 'mockito-inline', version: '2.13.0'
Copy code
@Mock private lateinit var onMarkerClickListener: OnMarkerClickListener`

    @Before
    @UiThreadTest
    fun init() {
        MockitoAnnotations.initMocks(this)
    ...
    }