diff --git a/CHANGELOG.md b/CHANGELOG.md index d2eba07..7d89652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 per-operation mock selections are untouched. (`devview-networkmock-core`, `devview-networkmock`, #90) +### Changed +- **Breaking:** `MockHttpClientCall` is now `internal` instead of `public` — it was only public + because Ktor's `HttpClientCall(client)` base constructor required it to be instantiable from + the plugin's install code, not because integrators have a legitimate reason to construct it + themselves. Its `rawContent` override already depends on the `@InternalAPI`-annotated Ktor + API, so staying public compounded that instability onto this library's own tracked surface. + (`devview-networkmock-ktor`, #89) + ### Fixed - NetworkMock: replaced ~35 unconditional `println` calls in `MockConfigRepository` and `NetworkMockPlugin` with gated [Kermit](https://github.com/touchlab/Kermit) logging diff --git a/devview-networkmock-ktor/CLAUDE.md b/devview-networkmock-ktor/CLAUDE.md index 89baa5e..512d830 100644 --- a/devview-networkmock-ktor/CLAUDE.md +++ b/devview-networkmock-ktor/CLAUDE.md @@ -25,7 +25,6 @@ val client = HttpClient(OkHttp) { - `NetworkMockPlugin` — the `HttpClientPlugin` singleton (`NetworkMockPlugin.kt`) - `NetworkMockConfig` — DSL receiver; exposes `mockRepository` and `stateRepository` as nullable vars, plus `random: Random` (defaults to `Random.Default`) used for the `x-devview.failureRate` roll — override in tests to pin the outcome (`NetworkMockConfig.kt`) -- `MockHttpClientCall` — public subclass of `HttpClientCall` that wraps synthetic request/response data without touching the network (`NetworkMockPlugin.kt`) ## Interception Flow diff --git a/devview-networkmock-ktor/api/api.txt b/devview-networkmock-ktor/api/api.txt index 749649d..91a1a31 100644 --- a/devview-networkmock-ktor/api/api.txt +++ b/devview-networkmock-ktor/api/api.txt @@ -1,11 +1,6 @@ // Signature format: 4.0 package com.worldline.devview.networkmock.ktor.plugin { - public final class MockHttpClientCall extends io.ktor.client.call.HttpClientCall { - ctor public MockHttpClientCall(io.ktor.client.HttpClient client); - ctor public MockHttpClientCall(io.ktor.client.HttpClient client, io.ktor.client.request.HttpRequestData mockRequestData, io.ktor.client.request.HttpResponseData mockResponseData); - } - public final class NetworkMockConfig { ctor public NetworkMockConfig(); method @InaccessibleFromKotlin public com.worldline.devview.networkmock.core.repository.MockConfigRepository? getMockRepository(); diff --git a/devview-networkmock-ktor/src/commonMain/kotlin/com/worldline/devview/networkmock/ktor/plugin/NetworkMockPlugin.kt b/devview-networkmock-ktor/src/commonMain/kotlin/com/worldline/devview/networkmock/ktor/plugin/NetworkMockPlugin.kt index 408839d..3827c6f 100644 --- a/devview-networkmock-ktor/src/commonMain/kotlin/com/worldline/devview/networkmock/ktor/plugin/NetworkMockPlugin.kt +++ b/devview-networkmock-ktor/src/commonMain/kotlin/com/worldline/devview/networkmock/ktor/plugin/NetworkMockPlugin.kt @@ -428,8 +428,8 @@ private fun createMockHttpClientCall( * a synthetic response. Both [request] and [response] are set immediately in * the secondary constructor so the call is fully usable upon creation. */ -public class MockHttpClientCall(client: HttpClient) : HttpClientCall(client) { - public constructor( +internal class MockHttpClientCall(client: HttpClient) : HttpClientCall(client) { + constructor( client: HttpClient, mockRequestData: HttpRequestData, mockResponseData: HttpResponseData