Skip to content

Commit

Permalink
Legg til erstatningskey i melding for forespoersel-ID
Browse files Browse the repository at this point in the history
  • Loading branch information
bjerga committed Nov 14, 2024
1 parent 5226081 commit 966e257
Show file tree
Hide file tree
Showing 49 changed files with 211 additions and 207 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.datatest.withData
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import io.mockk.clearAllMocks
import io.mockk.coEvery
import io.mockk.coVerify
Expand All @@ -22,6 +21,7 @@ import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.rapidsrivers.model.Fail
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.sendJson
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.inntektsmelding.aareg.HentArbeidsforholdMelding
import no.nav.helsearbeidsgiver.inntektsmelding.aareg.HentArbeidsforholdRiver
import no.nav.helsearbeidsgiver.inntektsmelding.aareg.tilArbeidsforhold
Expand Down Expand Up @@ -57,7 +57,7 @@ class HentArbeidsforholdRiverTest :

testRapid.inspektør.size shouldBeExactly 1

testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to innkommendeMelding.eventName.toJson(),
Key.UUID to innkommendeMelding.transaksjonId.toJson(),
Expand Down Expand Up @@ -90,7 +90,7 @@ class HentArbeidsforholdRiverTest :

testRapid.inspektør.size shouldBeExactly 1

testRapid.firstMessage().toMap() shouldContainExactly forventetFail.tilMelding()
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey forventetFail.tilMelding()

coVerifySequence {
mockAaregClient.hentArbeidsforhold(innkommendeMelding.fnr.verdi, innkommendeMelding.transaksjonId.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.datatest.withData
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import io.mockk.clearAllMocks
import io.mockk.coEvery
import io.mockk.coVerify
Expand All @@ -19,6 +18,7 @@ import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.rapidsrivers.model.Fail
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.sendJson
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.inntektsmelding.altinn.Mock.toMap
import no.nav.helsearbeidsgiver.utils.json.serializer.set
import no.nav.helsearbeidsgiver.utils.json.toJson
Expand Down Expand Up @@ -50,7 +50,7 @@ class AltinnRiverTest :
.mapNotNull { it.orgnr }
.toSet()

testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to innkommendeMelding.eventName.toJson(),
Key.UUID to innkommendeMelding.transaksjonId.toJson(),
Expand Down Expand Up @@ -86,7 +86,7 @@ class AltinnRiverTest :

testRapid.inspektør.size shouldBeExactly 1

testRapid.firstMessage().toMap() shouldContainExactly forventetFail.tilMelding()
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey forventetFail.tilMelding()

coVerifySequence {
mockAltinnClient.hentRettighetOrganisasjoner(innkommendeMelding.fnr.verdi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import io.kotest.core.spec.style.FunSpec
import io.kotest.data.row
import io.kotest.datatest.withData
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import io.mockk.clearAllMocks
import io.mockk.coEvery
import io.mockk.coVerify
Expand All @@ -23,6 +22,7 @@ import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.rapidsrivers.model.Fail
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.sendJson
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.inntektsmelding.altinn.MockTilgang.toMap
import no.nav.helsearbeidsgiver.utils.json.toJson
import no.nav.helsearbeidsgiver.utils.test.wrapper.genererGyldig
Expand Down Expand Up @@ -57,7 +57,7 @@ class TilgangRiverTest :

testRapid.inspektør.size shouldBeExactly 1

testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to innkommendeMelding.eventName.toJson(),
Key.UUID to innkommendeMelding.transaksjonId.toJson(),
Expand Down Expand Up @@ -91,7 +91,7 @@ class TilgangRiverTest :

testRapid.inspektør.size shouldBeExactly 1

testRapid.firstMessage().toMap() shouldContainExactly forventetFail.tilMelding()
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey forventetFail.tilMelding()

coVerifySequence {
mockAltinnClient.harRettighetForOrganisasjon(innkommendeMelding.fnr.verdi, innkommendeMelding.orgnr.verdi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package no.nav.helsearbeidsgiver.inntektsmelding.api
import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import no.nav.helsearbeidsgiver.domene.inntektsmelding.v1.skjema.SkjemaInntektsmelding
import no.nav.helsearbeidsgiver.felles.EventName
import no.nav.helsearbeidsgiver.felles.Key
import no.nav.helsearbeidsgiver.felles.json.toJson
import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.test.mock.mockSkjemaInntektsmelding
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.inntektsmelding.api.innsending.InnsendingProducer
import no.nav.helsearbeidsgiver.utils.json.toJson
import no.nav.helsearbeidsgiver.utils.test.wrapper.genererGyldig
Expand All @@ -30,7 +30,7 @@ class InnsendingProducerTest :
producer.publish(transaksjonId, skjema, avsenderFnr)

testRapid.inspektør.size shouldBeExactly 1
testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to EventName.INSENDING_STARTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package no.nav.helsearbeidsgiver.inntektsmelding.api.aktiveorgnr
import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import no.nav.helsearbeidsgiver.felles.EventName
import no.nav.helsearbeidsgiver.felles.Key
import no.nav.helsearbeidsgiver.felles.json.toJson
import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.utils.json.toJson
import no.nav.helsearbeidsgiver.utils.test.wrapper.genererGyldig
import no.nav.helsearbeidsgiver.utils.wrapper.Fnr
Expand All @@ -27,7 +27,7 @@ class AktiveOrgnrProducerTest :
producer.publish(transaksjonId, arbeidsgiverFnr, arbeidstagerFnr)

testRapid.inspektør.size shouldBeExactly 1
testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to EventName.AKTIVE_ORGNR_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package no.nav.helsearbeidsgiver.inntektsmelding.api.hentforespoersel
import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import no.nav.helsearbeidsgiver.felles.EventName
import no.nav.helsearbeidsgiver.felles.Key
import no.nav.helsearbeidsgiver.felles.json.toJson
import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.utils.json.toJson
import no.nav.helsearbeidsgiver.utils.test.wrapper.genererGyldig
import no.nav.helsearbeidsgiver.utils.wrapper.Fnr
Expand All @@ -27,7 +27,7 @@ class HentForespoerselProducerTest :
producer.publish(transaksjonId, HentForespoerselRequest(forespoerselId), avsenderFnr)

testRapid.inspektør.size shouldBeExactly 1
testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to EventName.TRENGER_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package no.nav.helsearbeidsgiver.inntektsmelding.api.hentforespoerselIdListe
import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import no.nav.helsearbeidsgiver.felles.EventName
import no.nav.helsearbeidsgiver.felles.Key
import no.nav.helsearbeidsgiver.felles.json.toJson
import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.utils.json.serializer.UuidSerializer
import no.nav.helsearbeidsgiver.utils.json.toJson
import java.util.UUID
Expand All @@ -25,7 +25,7 @@ class HentForespoerselIdListeProducerTest :
producer.publish(transaksjonId, HentForespoerslerRequest(vedtaksperiodeIdListe))

testRapid.inspektør.size shouldBeExactly 1
testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to EventName.FORESPOERSLER_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package no.nav.helsearbeidsgiver.inntektsmelding.api.hentselvbestemtim
import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import no.nav.helsearbeidsgiver.felles.EventName
import no.nav.helsearbeidsgiver.felles.Key
import no.nav.helsearbeidsgiver.felles.json.toJson
import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.utils.json.toJson
import java.util.UUID

Expand All @@ -25,7 +25,7 @@ class HentSelvbestemtImProducerTest :
producer.publish(transaksjonId, selvbestemtId)

testRapid.inspektør.size shouldBeExactly 1
testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to EventName.SELVBESTEMT_IM_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package no.nav.helsearbeidsgiver.inntektsmelding.api.inntekt

import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.maps.shouldContainExactly
import no.nav.helsearbeidsgiver.felles.EventName
import no.nav.helsearbeidsgiver.felles.Key
import no.nav.helsearbeidsgiver.felles.json.toJson
import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.utils.json.toJson
import no.nav.helsearbeidsgiver.utils.test.date.januar
import java.util.UUID
Expand All @@ -25,7 +25,7 @@ class InntektProducerTest :

val publisert = testRapid.firstMessage().toMap()

publisert shouldContainExactly
publisert shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to EventName.INNTEKT_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package no.nav.helsearbeidsgiver.inntektsmelding.api.inntektselvbestemt
import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import no.nav.helsearbeidsgiver.felles.EventName
import no.nav.helsearbeidsgiver.felles.Key
import no.nav.helsearbeidsgiver.felles.json.toJson
import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.utils.json.toJson
import no.nav.helsearbeidsgiver.utils.test.date.april
import no.nav.helsearbeidsgiver.utils.test.wrapper.genererGyldig
Expand All @@ -30,7 +30,7 @@ class InntektSelvbestemtProducerTest :
producer.publish(transaksjonId, InntektSelvbestemtRequest(sykmeldtFnr, orgnr, inntektsdato))

testRapid.inspektør.size shouldBeExactly 1
testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to EventName.INNTEKT_SELVBESTEMT_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package no.nav.helsearbeidsgiver.inntektsmelding.api.kvittering
import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import no.nav.helsearbeidsgiver.felles.EventName
import no.nav.helsearbeidsgiver.felles.Key
import no.nav.helsearbeidsgiver.felles.json.toJson
import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.utils.json.toJson
import java.util.UUID

Expand All @@ -24,7 +24,7 @@ class KvitteringProducerTest :
producer.publish(transaksjonId, forespoerselId)

testRapid.inspektør.size shouldBeExactly 1
testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to EventName.KVITTERING_REQUESTED.toJson(),
Key.UUID to transaksjonId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package no.nav.helsearbeidsgiver.inntektsmelding.api.lagreselvbestemtim
import com.github.navikt.tbd_libs.rapids_and_rivers.test_support.TestRapid
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import no.nav.helsearbeidsgiver.domene.inntektsmelding.v1.skjema.SkjemaInntektsmeldingSelvbestemt
import no.nav.helsearbeidsgiver.felles.EventName
import no.nav.helsearbeidsgiver.felles.Key
import no.nav.helsearbeidsgiver.felles.json.toJson
import no.nav.helsearbeidsgiver.felles.json.toMap
import no.nav.helsearbeidsgiver.felles.test.mock.mockSkjemaInntektsmeldingSelvbestemt
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.utils.json.toJson
import no.nav.helsearbeidsgiver.utils.test.wrapper.genererGyldig
import no.nav.helsearbeidsgiver.utils.wrapper.Fnr
Expand All @@ -30,7 +30,7 @@ class LagreSelvbestemtImProducerTest :
producer.publish(transaksjonId, skjema, avsenderFnr)

testRapid.inspektør.size shouldBeExactly 1
testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to EventName.SELVBESTEMT_IM_MOTTATT.toJson(),
Key.UUID to transaksjonId.toJson(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import io.kotest.core.spec.style.FunSpec
import io.kotest.data.row
import io.kotest.datatest.withData
import io.kotest.matchers.ints.shouldBeExactly
import io.kotest.matchers.maps.shouldContainExactly
import io.mockk.clearAllMocks
import io.mockk.every
import io.mockk.mockk
Expand All @@ -23,6 +22,7 @@ import no.nav.helsearbeidsgiver.felles.rapidsrivers.model.Fail
import no.nav.helsearbeidsgiver.felles.test.mock.mockEksternInntektsmelding
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.sendJson
import no.nav.helsearbeidsgiver.felles.test.shouldContainAllExcludingTempKey
import no.nav.helsearbeidsgiver.inntektsmelding.brospinn.Mock.toMap
import no.nav.helsearbeidsgiver.utils.json.toJson
import java.util.UUID
Expand All @@ -49,7 +49,7 @@ class HentEksternImRiverTest :

testRapid.inspektør.size shouldBeExactly 1

testRapid.firstMessage().toMap() shouldContainExactly
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey
mapOf(
Key.EVENT_NAME to EventName.EKSTERN_INNTEKTSMELDING_MOTTATT.toJson(),
Key.UUID to innkommendeMelding.transaksjonId.toJson(),
Expand Down Expand Up @@ -124,7 +124,7 @@ class HentEksternImRiverTest :

testRapid.inspektør.size shouldBeExactly 1

testRapid.firstMessage().toMap() shouldContainExactly forventetFail.tilMelding()
testRapid.firstMessage().toMap() shouldContainAllExcludingTempKey forventetFail.tilMelding()

verifySequence {
mockSpinnKlient.hentEksternInntektsmelding(innkommendeMelding.spinnImId)
Expand Down
Loading

0 comments on commit 966e257

Please sign in to comment.