From 887efed6938168df481e2a459245167e06d4403d Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Tue, 22 Oct 2024 12:03:55 -0500 Subject: [PATCH] chore: Update ktor to 3.0.0. --- pom.xml | 2 +- .../org/jitsi/jibri/api/http/internal/InternalHttpApi.kt | 6 ++---- src/test/kotlin/org/jitsi/jibri/api/http/HttpApiTest.kt | 2 +- .../kotlin/org/jitsi/jibri/webhooks/v1/WebhookClientTest.kt | 1 + 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 3a79c928..09a91f4f 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 5.10.0 5.7.2 1.13.8 - 2.3.4 + 3.0.0 0.11.5 1.1-143-g175c44b 1.0-127-g6c65524 diff --git a/src/main/kotlin/org/jitsi/jibri/api/http/internal/InternalHttpApi.kt b/src/main/kotlin/org/jitsi/jibri/api/http/internal/InternalHttpApi.kt index 7906f902..48ccf26c 100644 --- a/src/main/kotlin/org/jitsi/jibri/api/http/internal/InternalHttpApi.kt +++ b/src/main/kotlin/org/jitsi/jibri/api/http/internal/InternalHttpApi.kt @@ -19,15 +19,13 @@ package org.jitsi.jibri.api.http.internal import io.ktor.http.HttpStatusCode import io.ktor.serialization.jackson.jackson import io.ktor.server.application.Application -import io.ktor.server.application.ApplicationCall -import io.ktor.server.application.call import io.ktor.server.application.install import io.ktor.server.plugins.contentnegotiation.ContentNegotiation import io.ktor.server.response.respond +import io.ktor.server.routing.RoutingContext import io.ktor.server.routing.post import io.ktor.server.routing.route import io.ktor.server.routing.routing -import io.ktor.util.pipeline.PipelineContext import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.launch @@ -89,7 +87,7 @@ class InternalHttpApi( /** * Responds with [HttpStatusCode.OK] and then runs the given block */ -private suspend fun PipelineContext<*, ApplicationCall>.respondOkAndRun(block: () -> Unit) { +private suspend fun RoutingContext.respondOkAndRun(block: () -> Unit) { val latch = CompletableDeferred() coroutineScope { launch { diff --git a/src/test/kotlin/org/jitsi/jibri/api/http/HttpApiTest.kt b/src/test/kotlin/org/jitsi/jibri/api/http/HttpApiTest.kt index 958b91f4..5cae3675 100644 --- a/src/test/kotlin/org/jitsi/jibri/api/http/HttpApiTest.kt +++ b/src/test/kotlin/org/jitsi/jibri/api/http/HttpApiTest.kt @@ -170,6 +170,6 @@ class HttpApiTest : ShouldSpec() { private suspend fun testApplication(block: suspend ApplicationTestBuilder.() -> Unit) { val builder = ApplicationTestBuilder().apply { block() } val testApplication = TestApplication(builder) - testApplication.engine.start() + testApplication.start() testApplication.stop() } diff --git a/src/test/kotlin/org/jitsi/jibri/webhooks/v1/WebhookClientTest.kt b/src/test/kotlin/org/jitsi/jibri/webhooks/v1/WebhookClientTest.kt index 865e6a25..beb9c8cb 100644 --- a/src/test/kotlin/org/jitsi/jibri/webhooks/v1/WebhookClientTest.kt +++ b/src/test/kotlin/org/jitsi/jibri/webhooks/v1/WebhookClientTest.kt @@ -32,6 +32,7 @@ import io.ktor.client.request.HttpRequestData import io.ktor.http.ContentType import io.ktor.http.HttpMethod import io.ktor.http.HttpStatusCode +import io.ktor.utils.io.readText import kotlinx.coroutines.delay import org.jitsi.jibri.helpers.inPlaceExecutor import org.jitsi.jibri.helpers.resetIoPool