Skip to content

Commit

Permalink
integration-tests: Fix tapir applications
Browse files Browse the repository at this point in the history
After moving to the jdkhttp-server the arch for starting the server has
been restructured.
  • Loading branch information
jnatten committed Sep 5, 2023
1 parent 8ebdce3 commit 1b05714
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 1b05714

Please sign in to comment.