// Path: app/src/androidTest/java/com/tobi/movies/TestMovieApplication.java
// public class TestMovieApplication extends MovieApplication {
// 
//     @Override
//     protected ApplicationComponent applicationComponent() {
//         return DaggerTestApplicationComponent.create();
//     }
// 
//     @Override
//     protected PopularMoviesComponent popularMoviesComponent(ApplicationComponent applicationComponent) {
//         return DaggerTestPopularMoviesComponent.builder()
//                 .testApplicationComponent((TestApplicationComponent) applicationComponent)
//                 .build();
//     }
// 
//     @Override
//     protected MovieDetailsComponent movieDetailsComponent(ApplicationComponent applicationComponent) {
//         return DaggerTestMovieDetailsComponent.builder()
//                 .testApplicationComponent((TestApplicationComponent) applicationComponent)
//                 .build();
//     }
// }


import android.app.Application;
import android.content.Context;
import android.support.test.runner.AndroidJUnitRunner;
import com.tobi.movies.TestMovieApplication;
package com.tobi.movies.runner;



public class DaggerOverridesTestRunner extends AndroidJUnitRunner {

    @Override
    public Application newApplication(ClassLoader cl, String className, Context context) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
// Path: app/src/androidTest/java/com/tobi/movies/TestMovieApplication.java
// public class TestMovieApplication extends MovieApplication {
// 
//     @Override
//     protected ApplicationComponent applicationComponent() {
//         return DaggerTestApplicationComponent.create();
//     }
// 
//     @Override
//     protected PopularMoviesComponent popularMoviesComponent(ApplicationComponent applicationComponent) {
//         return DaggerTestPopularMoviesComponent.builder()
//                 .testApplicationComponent((TestApplicationComponent) applicationComponent)
//                 .build();
//     }
// 
//     @Override
//     protected MovieDetailsComponent movieDetailsComponent(ApplicationComponent applicationComponent) {
//         return DaggerTestMovieDetailsComponent.builder()
//                 .testApplicationComponent((TestApplicationComponent) applicationComponent)
//                 .build();
//     }
// }


// Path: app/src/androidTest/java/com/tobi/movies/runner/DaggerOverridesTestRunner.java
import android.app.Application;
import android.content.Context;
import android.support.test.runner.AndroidJUnitRunner;
import com.tobi.movies.TestMovieApplication;

package com.tobi.movies.runner;



public class DaggerOverridesTestRunner extends AndroidJUnitRunner {

    @Override
    public Application newApplication(ClassLoader cl, String className, Context context) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
        String testAppClassName = TestMovieApplication.class.getCanonicalName();