Skip to content

Instantly share code, notes, and snippets.

Created November 19, 2019 16:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ferPrieto/7004d4a7768ae0ce51765b25c60b22db to your computer and use it in GitHub Desktop.
const val BASE_URL = ""
class TestConfigurationBuilder {
private lateinit var baseUrl: String
init {
fun testBaseUrl() {
baseUrl = "$BASE_URL:${BuildConfig.PORT}"
fun inject() {
appComponent {
fun injectTestConfiguration(block: TestConfigurationBuilder.() -> Unit) {
private fun appComponent(block: DaggerAppComponent.Builder.() -> Unit = {}): AppComponent =
private fun requireTestedApplication() =
(InstrumentationRegistry.getInstrumentation().targetContext.applicationContext as JokesApp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment