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)
}

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
}
}

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Optional override for the mock configuration repository.

Link copied to clipboard

Optional override for the mock state repository.