Where getDepartmentDataSource retrieves the injected mock using Dagger 2.
When the test runs, I always get the following exception:
java.lang.ClassCastException: rx.subjects.SubjectSubscriptionManager$State cannot be cast to rx.Notification
at rx.internal.operators.OperatorDematerialize$1.onNext(OperatorDematerialize.java:48)
at rx.internal.operators.NotificationLite.accept(NotificationLite.java:150)
at rx.subjects.SubjectSubscriptionManager$SubjectObserver.accept(SubjectSubscriptionManager.java:318)
at rx.subjects.SubjectSubscriptionManager$SubjectObserver.emitLoop(SubjectSubscriptionManager.java:291)
at rx.subjects.SubjectSubscriptionManager$SubjectObserver.emitFirst(SubjectSubscriptionManager.java:270)
at rx.subjects.ClearableBehaviorSubject$1.call(ClearableBehaviorSubject.java:103)
at rx.subjects.ClearableBehaviorSubject$1.call(ClearableBehaviorSubject.java:99)
at rx.subjects.SubjectSubscriptionManager.add(SubjectSubscriptionManager.java:100)
at rx.subjects.SubjectSubscriptionManager.call(SubjectSubscriptionManager.java:60)
at rx.subjects.SubjectSubscriptionManager.call(SubjectSubscriptionManager.java:35)
at rx.Observable$2.call(Observable.java:162)
at rx.Observable$2.call(Observable.java:154)
at rx.Observable$2.call(Observable.java:162)
at rx.Observable$2.call(Observable.java:154)
at rx.Observable$2.call(Observable.java:162)
at rx.Observable$2.call(Observable.java:154)
at rx.Observable.unsafeSubscribe(Observable.java:8098)
at rx.internal.operators.OperatorSubscribeOn$1$1.call(OperatorSubscribeOn.java:62)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Is there something missing here, a configuration perhaps?
I'm currently trying to use RxPresso in a test case, but it always gives a ClassCastException when the mock item is emitted.
Test class
Activity
Where
getDepartmentDataSource
retrieves the injected mock using Dagger 2.When the test runs, I always get the following exception:
Is there something missing here, a configuration perhaps?
Thanks!