-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fjern mellomledd for ferdigstilling av sak og oppgave #762
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smyger med denne for å gjøre forenklinger i
bro-spinn
senere.