Skip to content
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

IS-2797: Add dialogmelding kilde #557

Merged
merged 5 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class BehandlerVarselService(
dialogmeldingKode = varseltype.getDialogMeldingKode().value,
dialogmeldingTekst = document.serialize(),
dialogmeldingVedlegg = pdf,
kilde = "SYFO",
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ data class KafkaBehandlerDialogmeldingDTO(
val dialogmeldingKode: Int,
val dialogmeldingTekst: String?,
val dialogmeldingVedlegg: ByteArray? = null,
val kilde: String?,
)
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ class PostDialogmoteApiV2Spek : Spek({
kafkaBehandlerDialogmeldingDTO.dialogmeldingKode shouldBeEqualTo DialogmeldingKode.INNKALLING.value
kafkaBehandlerDialogmeldingDTO.dialogmeldingRefParent shouldBeEqualTo null
kafkaBehandlerDialogmeldingDTO.dialogmeldingVedlegg shouldNotBeEqualTo null
kafkaBehandlerDialogmeldingDTO.kilde shouldBeEqualTo "SYFO"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class ExternalMockEnvironment private constructor() {
pdlUrl = pdlMock.url,
)
lateinit var redisCache: RedisStore
val redisServer = testRedis(environment)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kom i skade for å slette denne i forrige PR - burde ikke gjort det, så legger den tilbake nå (blir en million connection refused mot Redis-cachen uten denne).


val wellKnownSelvbetjening = wellKnownSelvbetjeningMock()
val wellKnownVeilederV2 = wellKnownVeilederV2Mock()
Expand All @@ -68,11 +69,13 @@ class ExternalMockEnvironment private constructor() {

fun ExternalMockEnvironment.startExternalMocks() {
this.externalApplicationMockMap.start()
this.redisServer.start()
}

fun ExternalMockEnvironment.stopExternalMocks() {
this.externalApplicationMockMap.stop()
this.database.stop()
this.redisServer.stop()
}

fun HashMap<String, NettyApplicationEngine>.start() {
Expand Down
9 changes: 9 additions & 0 deletions src/test/kotlin/no/nav/syfo/testhelper/TestRedis.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package no.nav.syfo.testhelper

import no.nav.syfo.application.Environment
import redis.embedded.RedisServer

fun testRedis(environment: Environment): RedisServer = RedisServer.builder()
.port(environment.redisConfig.port)
.setting("requirepass " + environment.redisConfig.redisPassword)
.build()
Loading