1

I am trying to do some instrumented tests of a boilerplate code after migrating it to AndroidX. Note that before migration, all of them worked, but after, only unit tests work, the instrumented test crashes on Null Pointer exception, where it shouldnt.

Here is the errror:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'io.reactivex.Flowable io.reactivex.Flowable.subscribeOn(io.reactivex.Scheduler)' on a null object reference
02:55:31 V/InstrumentationResultParser: at org.buffer.android.boilerplate.data.interactor.FlowableUseCase.execute(FlowableUseCase.kt:26)
02:55:31 V/InstrumentationResultParser: at org.buffer.android.boilerplate.ui.browse.BrowseBufferoosViewModel.fetchBufferoos(BrowseBufferoosViewModel.kt:25)
02:55:31 V/InstrumentationResultParser: at org.buffer.android.boilerplate.ui.browse.BrowseActivity.onCreate(BrowseActivity.kt:40)

as you see, it's in the declaration of my "UseCase" in this case, get bufferoos. For reference, here is the class that fails:

GetBufferoos

Flowable Use case

Here is the test that fails

ActivityTest

Here is modules.kt for koin

Modules

Lukas Anda
  • 716
  • 1
  • 9
  • 30

0 Answers0