// Path: app/src/main/java/com/starter/data/di/DataModule.java
// @Module
// public class DataModule {
//     private static final int HTTP_DISK_CACHE_SIZE = 100 * 1024 * 1024; // 100MB
//     private static final String HTTP_CACHE_DIR = "cache_http";
//     private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm";
// 
//     private final String apiBaseUrl;
// 
//     public DataModule(final String apiBaseUrl) {
//         this.apiBaseUrl = apiBaseUrl;
//     }
// 
//     @Provides
//     @Singleton
//     public Gson provideGson() {
//         GsonBuilder gsonBuilder = new GsonBuilder();
//         gsonBuilder.setDateFormat(DATE_FORMAT);
// 
//         return gsonBuilder.create();
//     }
// 
//     @Provides
//     @Singleton
//     public OkHttpClient provideOkHttpClient(Application application) {
//         final OkHttpClient.Builder httpBuilder = new OkHttpClient.Builder();
// 
//         // Install an HTTP cache in the application cache directory.
//         File cacheDir = new File(application.getCacheDir(), HTTP_CACHE_DIR);
//         Cache cache = new Cache(cacheDir, HTTP_DISK_CACHE_SIZE);
// 
//         final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
//         interceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);
// 
//         httpBuilder.addInterceptor(interceptor);
//         httpBuilder.cache(cache);
// 
//         if (BuildConfig.DEBUG) {
//             httpBuilder.addNetworkInterceptor(new StethoInterceptor());
//         }
// 
//         return httpBuilder.build();
//     }
// 
//     @Provides
//     @Singleton
//     public Retrofit provideRetrofit(OkHttpClient client, Gson gson) {
//         return new Retrofit.Builder().baseUrl(apiBaseUrl)
//             .client(client)
//             .addConverterFactory(new ToStringConverterFactory())
//             .addConverterFactory(GsonConverterFactory.create(gson))
//             .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
//             .build();
//     }
// 
//     @Provides
//     @Singleton
//     public BoxStore providesObjectBox(Application application) {
//         return MyObjectBox.builder().androidContext(application).build();
//     }
// 
//     @Provides
//     @Singleton
//     public Box<ContributorEntity> providesContributorsObjectBox(BoxStore boxStore) {
//         return boxStore.boxFor(ContributorEntity.class);
//     }
// 
//     @Provides
//     @Singleton
//     public GithubApi providesGithubApi(Retrofit retrofit) {
//         return retrofit.create(GithubApi.class);
//     }
// 
//     @Provides
//     @NonNull
//     @Singleton
//     public LocalRepository providesLocalRepository(Box<ContributorEntity> localContributorBox,
//         ThreadConfiguration threadConfiguration) {
//         return new LocalRepository(localContributorBox, threadConfiguration);
//     }
// 
//     @Provides
//     @Singleton
//     public RemoteRepository providesRemoteRepository(LocalRepository localRepository,
//         GithubApi githubApi, ThreadConfiguration threadConfiguration) {
//         return new RemoteRepository(localRepository, githubApi, threadConfiguration);
//     }
// 
//     @Provides
//     @Singleton
//     public AppRepository provideAppRepository(RemoteRepository remoteRepository,
//         LocalRepository localRepository) {
//         return new AppRepository(localRepository, remoteRepository);
//     }
// }
// 
// Path: app/src/main/java/com/starter/di/AppModule.java
// @Module
// public class AppModule {
//     private static final String IMAGE_CACHE_DIR = "cache_images";
//     private static final int IMAGE_DISK_CACHE_SIZE = 100 * 1024 * 1024; // 100MB
//     private final Application application;
// 
//     public AppModule(Application application) {
//         this.application = application;
//     }
// 
//     @Provides
//     @Singleton
//     Application provideApplication() {
//         return application;
//     }
// 
//     @Provides
//     @Singleton
//     Picasso providePicasso(final Application app) {
//         final OkHttpClient.Builder httpBuilder = new OkHttpClient.Builder();
// 
//         File cacheDir = new File(app.getCacheDir(), IMAGE_CACHE_DIR);
//         httpBuilder.cache(new Cache(cacheDir, IMAGE_DISK_CACHE_SIZE));
//         final OkHttp3Downloader okHttpDownloader = new OkHttp3Downloader(httpBuilder.build());
// 
//         return new Picasso.Builder(app).downloader(okHttpDownloader).indicatorsEnabled(true).build();
//     }
// 
//     @Provides
//     @Singleton
//     SharedPreferences provideSharedPreferences(Application app) {
//         return PreferenceManager.getDefaultSharedPreferences(app);
//     }
// 
//     @Provides
//     @Singleton
//     ThreadConfiguration provideThreadConfiguration() {
//         return new ThreadConfiguration(Schedulers.io(), AndroidSchedulers.mainThread());
//     }
// 
//     @Provides
//     @Singleton
//     ApplicationPreferences provideApplicationPreferences(SharedPreferences sharedPreferences) {
//         return new ApplicationPreferences(sharedPreferences);
//     }
// }


import com.starter.data.di.DataModule;
import com.starter.di.AppModule;
import com.starter.di.DaggerAppComponent;
import io.appflate.restmock.RESTMockServer;
package com.starter;


public class TestApplication extends StarterApplication {
    /**
     * Replaces API url with local mock server url.
     */
    @Override
    public void initGraph() {
// Path: app/src/main/java/com/starter/data/di/DataModule.java
// @Module
// public class DataModule {
//     private static final int HTTP_DISK_CACHE_SIZE = 100 * 1024 * 1024; // 100MB
//     private static final String HTTP_CACHE_DIR = "cache_http";
//     private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm";
// 
//     private final String apiBaseUrl;
// 
//     public DataModule(final String apiBaseUrl) {
//         this.apiBaseUrl = apiBaseUrl;
//     }
// 
//     @Provides
//     @Singleton
//     public Gson provideGson() {
//         GsonBuilder gsonBuilder = new GsonBuilder();
//         gsonBuilder.setDateFormat(DATE_FORMAT);
// 
//         return gsonBuilder.create();
//     }
// 
//     @Provides
//     @Singleton
//     public OkHttpClient provideOkHttpClient(Application application) {
//         final OkHttpClient.Builder httpBuilder = new OkHttpClient.Builder();
// 
//         // Install an HTTP cache in the application cache directory.
//         File cacheDir = new File(application.getCacheDir(), HTTP_CACHE_DIR);
//         Cache cache = new Cache(cacheDir, HTTP_DISK_CACHE_SIZE);
// 
//         final HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
//         interceptor.setLevel(HttpLoggingInterceptor.Level.HEADERS);
// 
//         httpBuilder.addInterceptor(interceptor);
//         httpBuilder.cache(cache);
// 
//         if (BuildConfig.DEBUG) {
//             httpBuilder.addNetworkInterceptor(new StethoInterceptor());
//         }
// 
//         return httpBuilder.build();
//     }
// 
//     @Provides
//     @Singleton
//     public Retrofit provideRetrofit(OkHttpClient client, Gson gson) {
//         return new Retrofit.Builder().baseUrl(apiBaseUrl)
//             .client(client)
//             .addConverterFactory(new ToStringConverterFactory())
//             .addConverterFactory(GsonConverterFactory.create(gson))
//             .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
//             .build();
//     }
// 
//     @Provides
//     @Singleton
//     public BoxStore providesObjectBox(Application application) {
//         return MyObjectBox.builder().androidContext(application).build();
//     }
// 
//     @Provides
//     @Singleton
//     public Box<ContributorEntity> providesContributorsObjectBox(BoxStore boxStore) {
//         return boxStore.boxFor(ContributorEntity.class);
//     }
// 
//     @Provides
//     @Singleton
//     public GithubApi providesGithubApi(Retrofit retrofit) {
//         return retrofit.create(GithubApi.class);
//     }
// 
//     @Provides
//     @NonNull
//     @Singleton
//     public LocalRepository providesLocalRepository(Box<ContributorEntity> localContributorBox,
//         ThreadConfiguration threadConfiguration) {
//         return new LocalRepository(localContributorBox, threadConfiguration);
//     }
// 
//     @Provides
//     @Singleton
//     public RemoteRepository providesRemoteRepository(LocalRepository localRepository,
//         GithubApi githubApi, ThreadConfiguration threadConfiguration) {
//         return new RemoteRepository(localRepository, githubApi, threadConfiguration);
//     }
// 
//     @Provides
//     @Singleton
//     public AppRepository provideAppRepository(RemoteRepository remoteRepository,
//         LocalRepository localRepository) {
//         return new AppRepository(localRepository, remoteRepository);
//     }
// }
// 
// Path: app/src/main/java/com/starter/di/AppModule.java
// @Module
// public class AppModule {
//     private static final String IMAGE_CACHE_DIR = "cache_images";
//     private static final int IMAGE_DISK_CACHE_SIZE = 100 * 1024 * 1024; // 100MB
//     private final Application application;
// 
//     public AppModule(Application application) {
//         this.application = application;
//     }
// 
//     @Provides
//     @Singleton
//     Application provideApplication() {
//         return application;
//     }
// 
//     @Provides
//     @Singleton
//     Picasso providePicasso(final Application app) {
//         final OkHttpClient.Builder httpBuilder = new OkHttpClient.Builder();
// 
//         File cacheDir = new File(app.getCacheDir(), IMAGE_CACHE_DIR);
//         httpBuilder.cache(new Cache(cacheDir, IMAGE_DISK_CACHE_SIZE));
//         final OkHttp3Downloader okHttpDownloader = new OkHttp3Downloader(httpBuilder.build());
// 
//         return new Picasso.Builder(app).downloader(okHttpDownloader).indicatorsEnabled(true).build();
//     }
// 
//     @Provides
//     @Singleton
//     SharedPreferences provideSharedPreferences(Application app) {
//         return PreferenceManager.getDefaultSharedPreferences(app);
//     }
// 
//     @Provides
//     @Singleton
//     ThreadConfiguration provideThreadConfiguration() {
//         return new ThreadConfiguration(Schedulers.io(), AndroidSchedulers.mainThread());
//     }
// 
//     @Provides
//     @Singleton
//     ApplicationPreferences provideApplicationPreferences(SharedPreferences sharedPreferences) {
//         return new ApplicationPreferences(sharedPreferences);
//     }
// }


// Path: app/src/androidTest/java/com/starter/TestApplication.java
import com.starter.data.di.DataModule;
import com.starter.di.AppModule;
import com.starter.di.DaggerAppComponent;
import io.appflate.restmock.RESTMockServer;

package com.starter;


public class TestApplication extends StarterApplication {
    /**
     * Replaces API url with local mock server url.
     */
    @Override
    public void initGraph() {
        appModule = new AppModule(this);