NetworkMockConfig
class NetworkMockConfig
Configuration class for the NetworkMockPlugin.
Holds optional overrides for the repositories used by the plugin. When not explicitly set, both repositories are resolved automatically from NetworkMockInitializer — which is initialised by devview-networkmock when NetworkMock is registered via rememberModules { }.
Default usage — zero configuration needed
When NetworkMock is registered via rememberModules, NetworkMockInitializer is populated automatically. The plugin can then be installed with no configuration:
val client = HttpClient(OkHttp) {
install(NetworkMockPlugin)
}Content copied to clipboard
Custom usage — explicit repository injection
For testing or advanced scenarios, repositories can be provided explicitly, bypassing NetworkMockInitializer entirely:
val client = HttpClient(OkHttp) {
install(NetworkMockPlugin) {
mockRepository = myMockConfigRepository
stateRepository = myMockStateRepository
}
}Content copied to clipboard