diff --git a/AGENTS.md b/AGENTS.md index 4e850a0..50a7333 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,7 +16,7 @@ The project is structured into distinct, decoupled framework modules. **Do not v - **`ktor`**: Ktor (server and client) integrations, route annotation binding (`@RestController`, `@GetMapping`, `@PostMapping`, `@PatchMapping`), request parameter resolvers (`@QueryParam`, `@PathParam`, `@RequestBody`), automatic `@Valid` validation integration, `ResponseEntity` wrapper, `MessageDto` error response standardization, OpenAPI metadata (`@Operation`, `@ApiResponses`, `@ApiResponse`), a preconfigured HTTP client (`createHttpClient`), and the built-in `/health` UP endpoint auto-registered by `configureDefaultModules`. - **`koin`**: Dependency carrier publishing the Koin runtime APIs (`koin-bom`, `koin-core`, `koin-annotations`) via `api(...)`; contains no source code. - **`koin-exposed`**: Koin bridge for transactions — `applyTransactionalProxies()` post-processor replacing eligible singleton definitions with `TransactionalProxy`-wrapping factories; depends on `exposed` and the `koin` carrier. -- **`ktor-test`**: Dependency carrier publishing the Ktor server test host (`ktor-server-test-host`) via `api(...)`; contains no source code. +- **`ktor-test`**: Dependency carrier publishing the Ktor server test host (`ktor-server-test-host`) and the Ktor client mock engine (`ktor-client-mock`) via `api(...)`; contains no source code. - **`plugin`**: Gradle convention plugins for downstream projects (e.g. `fr.shikkanime.framework.ktor`, `fr.shikkanime.framework.koin`). For detailed architectural principles, read the [Architecture Guide](guidelines/ARCHITECTURE.md). diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bec18a5..fffc3c6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -42,6 +42,7 @@ ktorServerTestHost = { module = "io.ktor:ktor-server-test-host", version.ref = " ktorClientCore = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktorClientOkHttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" } ktorClientContentNegociation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } +ktorClientMock = { module = "io.ktor:ktor-client-mock", version.ref = "ktor" } kotlinxSerializationCore = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinxSerialization" } kotlinxSerializationJson = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerialization" } kotlinxSerializationProtobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "kotlinxSerialization" } diff --git a/ktor-test/AGENTS.md b/ktor-test/AGENTS.md index d6f2e59..deeca13 100644 --- a/ktor-test/AGENTS.md +++ b/ktor-test/AGENTS.md @@ -16,12 +16,14 @@ The `ktor-test` module is a **dependency carrier**: it publishes Ktor's server t - Never add application code, helpers, or wrappers here. 2. **Dependency exposure**: - - The Ktor version is centralized in `gradle/libs.versions.toml` (`ktorServerTestHost`). + - Ktor versions are centralized in `gradle/libs.versions.toml` (`ktorServerTestHost`, + `ktorClientMock`). - Dependencies are exposed with `api(...)` (Dependency Sharing rule), never `implementation`. 3. **Consumption**: - Unlike the Koin compiler plugin, there is **no Gradle plugin** for this module. Consumers declare it explicitly in their test scope: `testImplementation("fr.shikkanime.framework:ktor-test:")`. - - `testImplementation`-only consumption keeps the test host **off the consumer's production - classpath** while centralizing the version in the framework catalog. + - `testImplementation`-only consumption keeps the test host and the mock client engine + **off the consumer's production classpath** while centralizing the versions in the + framework catalog. diff --git a/ktor-test/build.gradle.kts b/ktor-test/build.gradle.kts index 74f8242..14a31ea 100644 --- a/ktor-test/build.gradle.kts +++ b/ktor-test/build.gradle.kts @@ -4,4 +4,5 @@ plugins { dependencies { api(libs.ktorServerTestHost) -} \ No newline at end of file + api(libs.ktorClientMock) +}