Skip to content

Instantly share code, notes, and snippets.

@Audhil
Last active July 27, 2019 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Audhil/43d16e18c06f794590d285029c3d2e85 to your computer and use it in GitHub Desktop.
Save Audhil/43d16e18c06f794590d285029c3d2e85 to your computer and use it in GitHub Desktop.
@Module
class TestApplicationModule(application: GitHubDelegate) : ApplicationModule(application) {
@Singleton
@Provides
fun giveRetrofit(okHttpClient: OkHttpClient): Retrofit =
Retrofit.Builder()
.baseUrl("http://localhost:8080/")
.addConverterFactory(GsonConverterFactory.create(GsonBuilder().create()))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.client(okHttpClient)
.build()
@Singleton
@Provides
fun giveMockWebServer(): MockWebServer = MockWebServer()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment