Indicador nulo a la vista cuando se ejecuta la testing burla de Android

Creo testing:

class MenuPresenterTest { lateinit var presenter: MenuPresenter lateinit var view: MenuView @Before fun setUp() { view = mock(MenuView::class.java) presenter = MenuPresenter() } @Test fun test_validation() { presenter.openActivity() verify(view).openActivity() } } 

MenuView

 interface MenuView : MvpView { fun init() fun openActivity() } 

MenuPresenter

 @PerActivity class MenuPresenter @Inject constructor() : MvpPresenter<MenuView>() { fun initView(){ view.init() } fun openActivity(){ view.openActivity() } } 

MvpPresenter

 open class MvpPresenter<V : MvpBaseView> : MvpBasePresenter<V>() { // things specific for current project override fun bindView(view: V) { super.bindView(view) } override fun unbindView() { super.unbindView() clear() } } 

MvpBasePresenter:

 abstract class MvpBasePresenter<V : MvpBaseView> { private var viewRef: WeakReference<V>? = null private val disposables = CompositeDisposable() fun clear() = disposables.clear() fun dispose(disposable: Disposable) = disposables.add(disposable) open fun bindView(view: V) { viewRef = WeakReference(view) } open fun unbindView() { viewRef = null } fun isViewBound() = viewRef != null val view: V get() { if (viewRef == null) { throw NullPointerException("getView() called when viewRef is null. Ensure bindView(View view) is called first.") } else { return viewRef!!.get() as V } } } 

cuando realizo la testing, obtengo:

 java.lang.NullPointerException: getView() called when viewRef is null. Ensure bindView(View view) is called first. at base.MvpBasePresenter.getView(MvpBasePresenter.kt:27) 

¿Alguna idea de por qué?