androidstarters / kotlin-android-starter

[Kotlin Android] Kotlin Android starter based MVP/Dagger2/RxJava2/Robolectric/Espresso/Mockito. It provides a generator to fast create a Kotlin Android project.
601 stars 94 forks source link

connectedAndroidTest not working #29

Open adin234 opened 6 years ago

adin234 commented 6 years ago
io.mvpstarter.sample.DetailActivityTest > checkErrorViewDisplays[Nexus_5_API_18(AVD) - 4.3.1] FAILED
        org.mockito.exceptions.base.MockitoException:
        Cannot mock/spy class io.mvpstarter.sample.data.DataManager

io.mvpstarter.sample.DetailActivityTest > checkPokemonDisplays[Nexus_5_API_18(AVD) - 4.3.1] FAILED
        org.mockito.exceptions.base.MockitoException:
        Cannot mock/spy class io.mvpstarter.sample.data.DataManager

io.mvpstarter.sample.MainActivityTest > checkErrorViewDisplays[Nexus_5_API_18(AVD) - 4.3.1] FAILED
        org.mockito.exceptions.base.MockitoException:
        Cannot mock/spy class io.mvpstarter.sample.data.DataManager

io.mvpstarter.sample.MainActivityTest > clickingPokemonLaunchesDetailActivity[Nexus_5_API_18(AVD) - 4.3.1] FAILED
        org.mockito.exceptions.base.MockitoException:
        Cannot mock/spy class io.mvpstarter.sample.data.DataManager

io.mvpstarter.sample.MainActivityTest > checkPokemonsDisplay[Nexus_5_API_18(AVD) - 4.3.1] FAILED
        org.mockito.exceptions.base.MockitoException:
        Cannot mock/spy class io.mvpstarter.sample.data.DataManager

FAILURE: Build failed with an exception.

converting DataManager.kt to an open class gives

> Task :app:connectedDebugAndroidTest
Starting 5 tests on Nexus_5_API_18(AVD) - 4.3.1

io.mvpstarter.sample.DetailActivityTest > checkErrorViewDisplays[Nexus_5_API_18(AVD) - 4.3.1] FAILED
        java.lang.NullPointerException
        at io.mvpstarter.sample.data.DataManager.getPokemon(DataManager.kt:22)

io.mvpstarter.sample.DetailActivityTest > checkPokemonDisplays[Nexus_5_API_18(AVD) - 4.3.1] FAILED
        org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
        Misplaced or misused argument matcher detected here:

io.mvpstarter.sample.MainActivityTest > checkErrorViewDisplays[Nexus_5_API_18(AVD) - 4.3.1] FAILED
        java.lang.NullPointerException
        at io.mvpstarter.sample.data.DataManager.getPokemonList(DataManager.kt:14)

io.mvpstarter.sample.MainActivityTest > clickingPokemonLaunchesDetailActivity[Nexus_5_API_18(AVD) - 4.3.1] FAILED
        org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
        Misplaced or misused argument matcher detected here:

io.mvpstarter.sample.MainActivityTest > checkPokemonsDisplay[Nexus_5_API_18(AVD) - 4.3.1] FAILED
        java.lang.NullPointerException
        at io.mvpstarter.sample.data.DataManager.getPokemonList(DataManager.kt:14)

FAILURE: Build failed with an exception.