Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example of custom Application class containing values for mocking UI-Test-components
class TestAppApplication : Application() {
// initialize mock ApiService
var mockApiService = MockApiService
* onCreate
override fun onCreate() {
// init dependency injection
val appComponent = DaggerAppComponent.builder()
.apiModule(object : ApiModule() {
override fun provideApiService(): ApiService {
return mockApiService.service
// set AppComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment