Skip to content

Commit

Permalink
Innsending: Skriv forespoersel-ID til Redis som svar til API (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjerga authored Oct 18, 2024
1 parent c1a8588 commit d9712cc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ import io.ktor.http.HttpStatusCode
import io.mockk.clearAllMocks
import io.mockk.coEvery
import kotlinx.serialization.builtins.serializer
import no.nav.helsearbeidsgiver.domene.inntektsmelding.deprecated.Inntektsmelding
import no.nav.helsearbeidsgiver.domene.inntektsmelding.v1.skjema.SkjemaInntektsmelding
import no.nav.helsearbeidsgiver.felles.domene.ResultJson
import no.nav.helsearbeidsgiver.felles.test.mock.mockDelvisInntektsmeldingDokument
import no.nav.helsearbeidsgiver.felles.test.mock.mockInntektsmelding
import no.nav.helsearbeidsgiver.felles.test.mock.mockSkjemaInntektsmelding
import no.nav.helsearbeidsgiver.inntektsmelding.api.RedisPollerTimeoutException
import no.nav.helsearbeidsgiver.inntektsmelding.api.Routes
Expand Down Expand Up @@ -41,7 +38,7 @@ class InnsendingRouteKtTest : ApiTest() {
listOf(
harTilgangResultat,
ResultJson(
success = mockInntektsmelding().toJson(Inntektsmelding.serializer()),
success = skjema.forespoerselId.toJson(),
).toJson(ResultJson.serializer())
.toString(),
)
Expand All @@ -61,7 +58,7 @@ class InnsendingRouteKtTest : ApiTest() {
listOf(
harTilgangResultat,
ResultJson(
success = mockDelvisInntektsmeldingDokument().toJson(Inntektsmelding.serializer()),
success = delvisSkjema.forespoerselId.toJson(),
).toJson(ResultJson.serializer())
.toString(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class InnsendingService(
) {
val resultJson =
ResultJson(
success = steg0.skjema.toJson(SkjemaInntektsmelding.serializer()),
success = steg0.skjema.forespoerselId.toJson(),
).toJson(ResultJson.serializer())

redisStore.set(RedisKey.of(steg0.transaksjonId), resultJson)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class InnsendingServiceTest :
mockRedis.store.set(
RedisKey.of(transaksjonId),
ResultJson(
success = nyttSkjema.toJson(SkjemaInntektsmelding.serializer()),
success = nyttSkjema.forespoerselId.toJson(),
).toJson(ResultJson.serializer()),
)
}
Expand All @@ -128,7 +128,7 @@ class InnsendingServiceTest :
mockRedis.store.set(
RedisKey.of(transaksjonId),
ResultJson(
success = Mock.skjema.toJson(SkjemaInntektsmelding.serializer()),
success = Mock.skjema.forespoerselId.toJson(),
).toJson(ResultJson.serializer()),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class InnsendingServiceIT : EndToEndTest() {
.fromJson(ResultJson.serializer())
.success
.shouldNotBeNull()
.fromJson(SkjemaInntektsmelding.serializer())
.fromJson(UuidSerializer)
}
}

Expand Down

0 comments on commit d9712cc

Please sign in to comment.