@Runwith(AndroidJUnitRunner:class.java) class YourTest { @get: Rule val intentRule = CustomIntentRule( yourActivity, beforeLaunch = { App.kodein.addConfig { //(App.Kodein is a ConfigurableKodein) bind(overrides = true) with singleton { YourMock() } } } ) } class CustomIntentRule(activityClass: Class, val beforeLaunch: (() -> Unit)? = null ) : IntentsTestRule(activityClass) { override fun beforeActivityLaunched() { super.beforeActivityLaunched() beforeLaunch?.invoke() } override fun getActivityIntent(): Intent { val customIntent = Intent() return customIntent } override fun afterActivityLaunched() { super.afterActivityLaunched() } override fun afterActivityFinished() { super.afterActivityFinished() } }