I could use some help understanding why this module for a ktor client fails -
Copy code
fun provideKtorClient() = HttpClient(OkHttp) {
install(ContentNegotiation) {
json()
}
}
val ktorModule = module {
single { provideKtorClient() }
}
A simple test fails with the error -
Copy code
@Test
fun checkKtorModule() {
ktorModule.verify()
}
org.koin.test.verify.MissingKoinDefinitionException: Missing type 'io.ktor.client.engine.HttpClientEngine' for class 'io.ktor.client.HttpClient' in definition '[Singleton:'io.ktor.client.HttpClient']'
a
arnaud.giuliani
06/16/2023, 1:52 PM
here it depends what you have in
provideKtorClient()
c
Christopher Mederos
06/19/2023, 5:14 AM
Ultimately there were two separate issues -
Starting the app in Android Studio required restarting the IDE - must have been a caching issue
Running the sample test was resolved by using