Skip to content

Commit

Permalink
Fiks random verdi i integrasjonstest
Browse files Browse the repository at this point in the history
  • Loading branch information
bjerga committed Jul 28, 2023
1 parent 19b4fd4 commit 39bc60c
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ package no.nav.helsearbeidsgiver.inntektsmelding.integrasjonstest

import io.kotest.matchers.maps.shouldNotContainKey
import io.kotest.matchers.shouldBe
import io.mockk.every
import no.nav.helsearbeidsgiver.felles.BehovType
import no.nav.helsearbeidsgiver.felles.DataFelt
import no.nav.helsearbeidsgiver.felles.EventName
import no.nav.helsearbeidsgiver.felles.Key
import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.rapidsrivers.pritopic.Pri
import no.nav.helsearbeidsgiver.felles.utils.randomUuid
import no.nav.helsearbeidsgiver.inntektsmelding.integrasjonstest.utils.EndToEndTest
import no.nav.helsearbeidsgiver.inntektsmelding.integrasjonstest.utils.fromJsonToString
import no.nav.helsearbeidsgiver.utils.json.fromJson
import no.nav.helsearbeidsgiver.utils.json.serializer.UuidSerializer
import no.nav.helsearbeidsgiver.utils.json.toJson
import no.nav.helsearbeidsgiver.utils.test.mock.mockStatic
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import java.util.UUID
Expand All @@ -22,14 +25,18 @@ class ForespoerselMottattIT : EndToEndTest() {

@Test
fun `skal ta imot forespørsel ny inntektsmelding, deretter opprette sak og oppgave`() {
publish(
Pri.Key.NOTIS to Pri.NotisType.FORESPØRSEL_MOTTATT.toJson(Pri.NotisType.serializer()),
Pri.Key.ORGNR to Mock.ORGNR.toJson(),
Pri.Key.FNR to Mock.FNR.toJson(),
Pri.Key.FORESPOERSEL_ID to Mock.forespoerselId.toJson()
)
mockStatic(::randomUuid) {
every { randomUuid() } returns Mock.transaksjonId

waitForMessages(8000)
publish(
Pri.Key.NOTIS to Pri.NotisType.FORESPØRSEL_MOTTATT.toJson(Pri.NotisType.serializer()),
Pri.Key.ORGNR to Mock.ORGNR.toJson(),
Pri.Key.FNR to Mock.FNR.toJson(),
Pri.Key.FORESPOERSEL_ID to Mock.forespoerselId.toJson()
)

waitForMessages(8000)
}

messages.filter(EventName.FORESPØRSEL_MOTTATT)
.filter(BehovType.LAGRE_FORESPOERSEL, loesningPaakrevd = false)
Expand Down

0 comments on commit 39bc60c

Please sign in to comment.