From ad0539b4985c5cff95575d3e1ac2c7a94ee9315a Mon Sep 17 00:00:00 2001 From: Alexander Koval Date: Fri, 23 Jun 2023 13:30:01 +0300 Subject: [PATCH] Fix tests and samples --- .../kotlin/dev/evo/elasticmagic/ElasticsearchTestBase.kt | 4 ++-- samples/src/jvmMain/kotlin/samples/started/ClusterJvm.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integ-tests/src/commonTest/kotlin/dev/evo/elasticmagic/ElasticsearchTestBase.kt b/integ-tests/src/commonTest/kotlin/dev/evo/elasticmagic/ElasticsearchTestBase.kt index e2fbfe83ce..af89b31528 100644 --- a/integ-tests/src/commonTest/kotlin/dev/evo/elasticmagic/ElasticsearchTestBase.kt +++ b/integ-tests/src/commonTest/kotlin/dev/evo/elasticmagic/ElasticsearchTestBase.kt @@ -34,7 +34,7 @@ abstract class ElasticsearchTestBase : TestBase() { object : Tracker { override fun requiresTextContent(request: Request<*, *, *>) = true - override fun onRequest(request: PlainRequest) { + override suspend fun onRequest(request: PlainRequest) { if (!debug.value) { return } @@ -47,7 +47,7 @@ abstract class ElasticsearchTestBase : TestBase() { println() } - override fun onResponse(responseResult: Result, duration: Duration) { + override suspend fun onResponse(responseResult: Result, duration: Duration) { if (!debug.value) { return } diff --git a/samples/src/jvmMain/kotlin/samples/started/ClusterJvm.kt b/samples/src/jvmMain/kotlin/samples/started/ClusterJvm.kt index eb4f3a84c6..b6dd922f4b 100644 --- a/samples/src/jvmMain/kotlin/samples/started/ClusterJvm.kt +++ b/samples/src/jvmMain/kotlin/samples/started/ClusterJvm.kt @@ -45,13 +45,13 @@ actual val esTransport = ElasticsearchKtorTransport( object : Tracker { override fun requiresTextContent(request: Request<*, *, *>) = true - override fun onRequest(request: PlainRequest) { + override suspend fun onRequest(request: PlainRequest) { println(">>>") println("${request.method} ${request.path.ifEmpty { "/" }}") println(request.textContent) } - override fun onResponse(responseResult: Result, duration: Duration) { + override suspend fun onResponse(responseResult: Result, duration: Duration) { responseResult .onSuccess { response -> println("<<< ${response.statusCode}: ${duration}")