From 1b057145f2dc09164ab8839f259f2d699179cb4e Mon Sep 17 00:00:00 2001 From: Jonas Natten Date: Tue, 5 Sep 2023 14:49:22 +0200 Subject: [PATCH] integration-tests: Fix tapir applications After moving to the jdkhttp-server the arch for starting the server has been restructured. --- .../draftapi/articleapi/ArticleApiClientTest.scala | 7 ++----- .../searchapi/articleapi/ArticleApiClientTest.scala | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/integration-tests/src/test/scala/no/ndla/integrationtests/draftapi/articleapi/ArticleApiClientTest.scala b/integration-tests/src/test/scala/no/ndla/integrationtests/draftapi/articleapi/ArticleApiClientTest.scala index a09553f404..cc3a072d0a 100644 --- a/integration-tests/src/test/scala/no/ndla/integrationtests/draftapi/articleapi/ArticleApiClientTest.scala +++ b/integration-tests/src/test/scala/no/ndla/integrationtests/draftapi/articleapi/ArticleApiClientTest.scala @@ -7,6 +7,7 @@ package no.ndla.integrationtests.draftapi.articleapi +import cats.effect.unsafe import no.ndla.{articleapi, draftapi} import no.ndla.articleapi.ArticleApiProperties import no.ndla.common.model.domain.draft.Draft @@ -43,19 +44,15 @@ class ArticleApiClientTest override def SearchServer: String = esHost } - import cats.effect.unsafe.implicits.global val articleApi = new articleapi.MainClass(articleApiProperties) - val server = articleApi.startServer - val cancelFunc = server.server.unsafeRunCancelable() + articleApi.run().unsafeRunAndForget()(unsafe.IORuntime.global) override def beforeAll(): Unit = { Thread.sleep(1000) - blockUntil(() => server.isReady) } override def afterAll(): Unit = { super.afterAll() - cancelFunc() } val idResponse: ContentId = ContentId(1) diff --git a/integration-tests/src/test/scala/no/ndla/integrationtests/searchapi/articleapi/ArticleApiClientTest.scala b/integration-tests/src/test/scala/no/ndla/integrationtests/searchapi/articleapi/ArticleApiClientTest.scala index 237dea3d39..a17f9e3aaf 100644 --- a/integration-tests/src/test/scala/no/ndla/integrationtests/searchapi/articleapi/ArticleApiClientTest.scala +++ b/integration-tests/src/test/scala/no/ndla/integrationtests/searchapi/articleapi/ArticleApiClientTest.scala @@ -7,7 +7,7 @@ package no.ndla.integrationtests.searchapi.articleapi -import cats.effect.unsafe.implicits.global +import cats.effect.unsafe import enumeratum.Json4s import no.ndla.articleapi.ArticleApiProperties import no.ndla.common.model.NDLADate @@ -64,18 +64,15 @@ class ArticleApiClientTest } val articleApi = new articleapi.MainClass(articleApiProperties) - val server = articleApi.startServer - val cancelFunc = server.server.unsafeRunCancelable() + val server = articleApi.run().unsafeRunAndForget()(unsafe.IORuntime.global) val articleApiBaseUrl = s"http://localhost:$articleApiPort" override def beforeAll(): Unit = { Thread.sleep(1000) - blockUntil(() => server.isReady) } override def afterAll(): Unit = { super.afterAll() - cancelFunc() } val exampleToken =