title: How to inject mocks with Dagger 2.11
body: <p>I am trying to inject mocks using the Android Injector of Dagger 2.11. </p>
  
  <p>Before using the Android Inject I used to change the injector in the Application class so I can inject mocks. Like this:</p>
  
  <pre><code>class EGOApplication : Application() {
  
      lateinit var injectorComponent: InjectorComponent
  
  
      override fun onCreate() {
          super.onCreate()
  
          injectorComponent = DaggerInjectorComponent.builder()
                  .appModule(AppModule(this))               
                  .build()
  }
  </code></pre>
  
  <p>And in my tests I used to change the injectorComponent like this:</p>
  
  <pre><code>app.injectorComponent = DaggerMockComponent.builder()
                  .mockModule(MockModule(app))
                  .build()
  </code></pre>
  
  <p>And then I can inject my mocks from MockModule.</p>
  
  <p>But now I am using Android Injector form this tutorial: <a href="https://medium.com/@iammert/new-android-injector-with-dagger-2-part-1-8baa60152abe" rel="nofollow noreferrer">https://medium.com/@iammert/new-android-injector-with-dagger-2-part-1-8baa60152abe</a></p>
  
  <p>Well... now I inject my dependencies like this:</p>
  
  <pre><code>override fun onCreate(savedInstanceState: Bundle?) {
          AndroidInjection.inject(this)
  }
  </code></pre>
  
  <p>So my approach doesn't work anymore... <strong>How can I make Dagger injector dependencies from my MockModule?</strong></p>
  
  <p>Any help is appreciated!</p>