Skip to content

Commit

Permalink
Fikser tester
Browse files Browse the repository at this point in the history
  • Loading branch information
geiralund committed Oct 9, 2023
1 parent 6ccf3fd commit a18facc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import io.ktor.http.encodedPath
import io.ktor.serialization.jackson.JacksonConverter
import mu.KotlinLogging
import no.nav.dagpenger.mottak.Config
import no.nav.dagpenger.mottak.Config.addHttprotocoll
import no.nav.dagpenger.mottak.behov.JsonMapper
import kotlin.time.Duration.Companion.minutes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import io.ktor.client.engine.mock.MockEngine
import io.ktor.client.engine.mock.respond
import io.ktor.http.HttpHeaders
import io.ktor.http.HttpStatusCode
import io.ktor.http.URLProtocol
import io.ktor.http.headersOf
import io.ktor.utils.io.ByteReadChannel
import kotlinx.coroutines.runBlocking
Expand All @@ -26,10 +27,11 @@ class JournalpostApiClientTest {
val requestData = mockHttpEngine.requestHistory.first()
assertEquals("PUT", requestData.method.value)
assertEquals(
"//dokarkiv.dev-fss-pub.nais.io/rest/journalpostapi/v1/journalpost/123",
"/rest/journalpostapi/v1/journalpost/123",
requestData.url.encodedPathAndQuery,
)
assertEquals("https://dokarkiv.dev-fss-pub.nais.io", requestData.url.host)
assertEquals(URLProtocol.HTTPS, requestData.url.protocol)
assertEquals("dokarkiv.dev-fss-pub.nais.io", requestData.url.host)
assertEquals("Bearer token", requestData.headers["Authorization"])
assertEquals("eksternReferanseId", requestData.headers["X-Request-ID"])
}
Expand All @@ -47,10 +49,10 @@ class JournalpostApiClientTest {
val requestData = mockHttpEngine.requestHistory.first()
assertEquals("PATCH", requestData.method.value)
assertEquals(
"//dokarkiv.dev-fss-pub.nais.io/rest/journalpostapi/v1/journalpost/123/ferdigstill",
"/rest/journalpostapi/v1/journalpost/123/ferdigstill",
requestData.url.encodedPathAndQuery,
)
assertEquals("https://dokarkiv.dev-fss-pub.nais.io", requestData.url.host)
assertEquals("dokarkiv.dev-fss-pub.nais.io", requestData.url.host)

assertEquals("Bearer token", requestData.headers["Authorization"])
assertEquals("eksternReferanseId", requestData.headers["X-Request-ID"])
Expand Down

0 comments on commit a18facc

Please sign in to comment.