Skip to content

Commit

Permalink
Use Kotest instead of assertJ.
Browse files Browse the repository at this point in the history
  • Loading branch information
MalazAlkoj committed Sep 25, 2024
1 parent 52eba8f commit 6c07975
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/test/kotlin/no/nav/syfo/aareg/AaregClientTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import io.kotest.assertions.throwables.shouldThrowExactly
import io.kotest.core.spec.style.FunSpec
import io.kotest.extensions.wiremock.ListenerMode
import io.kotest.extensions.wiremock.WireMockListener
import io.kotest.matchers.shouldBe
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
Expand All @@ -18,7 +19,6 @@ import no.nav.syfo.aareg.utils.AaregClientTestUtils.simpleArbeidsforhold
import no.nav.syfo.auth.azure.AzureAdTokenClient
import no.nav.syfo.metric.Metrikk
import no.nav.syfo.narmesteleder.objectMapper
import org.assertj.core.api.Assertions.assertThat
import org.springframework.test.util.ReflectionTestUtils

const val AAREG_URL = "http://localhost:9000"
Expand All @@ -45,14 +45,13 @@ class AaregClientTest : FunSpec({
val expectedArbeidsforholdList = listOf(simpleArbeidsforhold())
isAaregServer.stubAaregRelasjoner(expectedArbeidsforholdList)
val actualArbeidsforholdList = aaregClient.arbeidsforholdArbeidstaker(AT_FNR)

assertThat(actualArbeidsforholdList.size).isEqualTo(1)
actualArbeidsforholdList.size shouldBe 1

val arbeidsforhold = actualArbeidsforholdList[0]

assertThat(arbeidsforhold.arbeidsgiver?.organisasjonsnummer).isEqualTo(ORGNUMMER)
assertThat(arbeidsforhold.arbeidstaker?.aktoerId).isEqualTo(AT_AKTORID)
assertThat(arbeidsforhold.arbeidstaker?.offentligIdent).isEqualTo(AT_FNR)
arbeidsforhold.arbeidsgiver.organisasjonsnummer shouldBe ORGNUMMER
arbeidsforhold.arbeidstaker?.aktoerId shouldBe AT_AKTORID
arbeidsforhold.arbeidstaker?.offentligIdent shouldBe AT_FNR

verify { metrikk.tellHendelse("call_aareg") }
verify { metrikk.tellHendelse("call_aareg_success") }
Expand Down

0 comments on commit 6c07975

Please sign in to comment.