Can someone please explain this error message? ```...
# rx
Can someone please explain this error message?
Copy code
Exception in thread "UI thread @coroutine#1" java.lang.ClassCastException: io.reactivex.Observer$Subclass1 cannot be cast to com.nikolam.basketpro.ui.drills.selection.DrillsSelectionViewModel$fetchDrillTypes$1$disposable$1
	at com.nikolam.basketpro.ui.drills.selection.DrillsSelectionViewModel$fetchDrillTypes$1.invokeSuspend(DrillsSelectionViewModel.kt:37)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at java.util.concurrent.Executors$
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(
	at java.util.concurrent.ScheduledThreadPoolExecutor$
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$
I get a passing test with correct data but I also get this error (code in thread so I dont spam)
This is the test
Copy code
    fun `will populate livedata with correct value, when repository returns correct data`() {
        val expectedDrillTypeOne = DrillsType("title1", "url1")
        val expectedDrillTypeTwo = DrillsType("title2", "url2")

        every { mockDrillRepository.loadFullDrillType() } returns Observable.just(expectedDrillTypeOne, expectedDrillTypeTwo)


        val data = drillsSelectionViewModel.drillsTypeList.getOrAwaitValue()

        assertEquals(arrayListOf(expectedDrillTypeOne, expectedDrillTypeTwo), data )
This is the fun
Copy code
fun fetchDrillTypes() {

        val list = ArrayList<DrillsType>()

        viewModelScope.launch(io) {

            val disposable = repository.loadFullDrillType()
                .subscribeWith(object : DisposableObserver<DrillsType>() {

                    override fun onError(e: Throwable) {
                        Log.d("TAG", "error " + e.message)

                    override fun onNext(data: DrillsType) {
                        Log.d("TAG", "data is $data")

                    override fun onComplete() {
                        Log.d("TAG", "COMPLETE")

The app itself works, but the tests pass but error is thrown. Idk what is happening, I had this problem for somewhile and moving the disposable and everything around fixed it I believe, I don't remember what I did exactly. I'd like to understand what is going on