-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fjern mellomledd for ferdigstilling av sak og oppgave (#762)
- Loading branch information
Showing
12 changed files
with
185 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 0 additions & 63 deletions
63
...helsearbeidsgiver/inntektsmelding/forespoerselbesvart/ForespoerselBesvartFraSimbaRiver.kt
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
...o/nav/helsearbeidsgiver/inntektsmelding/forespoerselbesvart/ForespoerselBesvartMelding.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
...earbeidsgiver/inntektsmelding/forespoerselbesvart/ForespoerselBesvartFraSimbaRiverTest.kt
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
...arbeidsgiver/inntektsmelding/forespoerselbesvart/ForespoerselBesvartFraSpleisRiverTest.kt
This file was deleted.
Oops, something went wrong.
87 changes: 87 additions & 0 deletions
87
...nav/helsearbeidsgiver/inntektsmelding/forespoerselbesvart/ForespoerselBesvartRiverTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package no.nav.helsearbeidsgiver.inntektsmelding.forespoerselbesvart | ||
|
||
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 io.kotest.matchers.maps.shouldContainKey | ||
import io.mockk.clearAllMocks | ||
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.rapidsrivers.pritopic.Pri | ||
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.firstMessage | ||
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.message | ||
import no.nav.helsearbeidsgiver.felles.test.rapidsrivers.sendJson | ||
import no.nav.helsearbeidsgiver.utils.json.toJson | ||
import java.util.UUID | ||
|
||
class ForespoerselBesvartRiverTest : | ||
FunSpec({ | ||
val testRapid = TestRapid() | ||
|
||
ForespoerselBesvartRiver(testRapid).connect(testRapid) | ||
|
||
beforeEach { | ||
testRapid.reset() | ||
clearAllMocks() | ||
} | ||
|
||
test("Ved notis om besvart forespørsel publiseres behov om å hente notifikasjon-ID-er uten IM-ID fra Spinn") { | ||
val forespoerselId = UUID.randomUUID() | ||
val forventetPublisert = | ||
mapOf( | ||
Key.EVENT_NAME to EventName.FORESPOERSEL_BESVART.toJson(), | ||
Key.UUID to UUID.randomUUID().toJson(), | ||
Key.FORESPOERSEL_ID to forespoerselId.toJson(), | ||
Key.DATA to | ||
mapOf( | ||
Key.FORESPOERSEL_ID to forespoerselId.toJson(), | ||
).toJson(), | ||
) | ||
|
||
testRapid.sendJson( | ||
Pri.Key.NOTIS to Pri.NotisType.FORESPOERSEL_BESVART.toJson(Pri.NotisType.serializer()), | ||
Pri.Key.FORESPOERSEL_ID to forespoerselId.toJson(), | ||
) | ||
|
||
testRapid.inspektør.size shouldBeExactly 1 | ||
|
||
val publisert = testRapid.firstMessage().toMap() | ||
|
||
publisert shouldContainKey Key.UUID | ||
|
||
publisert.minus(Key.UUID) shouldContainExactly forventetPublisert.minus(Key.UUID) | ||
} | ||
|
||
test("Ved notis om besvart forespørsel publiseres behov om å hente notifikasjon-ID-er med IM-ID fra Spinn") { | ||
val forespoerselId = UUID.randomUUID() | ||
val spinnInntektsmeldingId = UUID.randomUUID() | ||
val forventetPublisert = | ||
mapOf( | ||
Key.EVENT_NAME to EventName.FORESPOERSEL_BESVART.toJson(), | ||
Key.UUID to UUID.randomUUID().toJson(), | ||
Key.FORESPOERSEL_ID to forespoerselId.toJson(), | ||
Key.DATA to | ||
mapOf( | ||
Key.FORESPOERSEL_ID to forespoerselId.toJson(), | ||
Key.SPINN_INNTEKTSMELDING_ID to spinnInntektsmeldingId.toJson(), | ||
).toJson(), | ||
) | ||
|
||
testRapid.sendJson( | ||
Pri.Key.NOTIS to Pri.NotisType.FORESPOERSEL_BESVART.toJson(Pri.NotisType.serializer()), | ||
Pri.Key.FORESPOERSEL_ID to forespoerselId.toJson(), | ||
Pri.Key.SPINN_INNTEKTSMELDING_ID to spinnInntektsmeldingId.toJson(), | ||
) | ||
|
||
testRapid.inspektør.size shouldBeExactly 2 | ||
|
||
val publisert = testRapid.message(1).toMap() | ||
|
||
publisert shouldContainKey Key.UUID | ||
|
||
publisert.minus(Key.UUID) shouldContainExactly forventetPublisert.minus(Key.UUID) | ||
} | ||
}) |
Oops, something went wrong.