diff --git a/src/main/kotlin/no/nav/syfo/brev/behandler/BehandlerVarselService.kt b/src/main/kotlin/no/nav/syfo/brev/behandler/BehandlerVarselService.kt index 1c72d1d6..f021075e 100644 --- a/src/main/kotlin/no/nav/syfo/brev/behandler/BehandlerVarselService.kt +++ b/src/main/kotlin/no/nav/syfo/brev/behandler/BehandlerVarselService.kt @@ -45,6 +45,7 @@ class BehandlerVarselService( dialogmeldingKode = varseltype.getDialogMeldingKode().value, dialogmeldingTekst = document.serialize(), dialogmeldingVedlegg = pdf, + kilde = "SYFO", ) ) } diff --git a/src/main/kotlin/no/nav/syfo/brev/behandler/kafka/KafkaBehandlerDialogmeldingDTO.kt b/src/main/kotlin/no/nav/syfo/brev/behandler/kafka/KafkaBehandlerDialogmeldingDTO.kt index 6899592e..2b1604e7 100644 --- a/src/main/kotlin/no/nav/syfo/brev/behandler/kafka/KafkaBehandlerDialogmeldingDTO.kt +++ b/src/main/kotlin/no/nav/syfo/brev/behandler/kafka/KafkaBehandlerDialogmeldingDTO.kt @@ -11,4 +11,5 @@ data class KafkaBehandlerDialogmeldingDTO( val dialogmeldingKode: Int, val dialogmeldingTekst: String?, val dialogmeldingVedlegg: ByteArray? = null, + val kilde: String?, ) diff --git a/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/PostDialogmoteApiV2Spek.kt b/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/PostDialogmoteApiV2Spek.kt index 58a11f52..7ccbd022 100644 --- a/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/PostDialogmoteApiV2Spek.kt +++ b/src/test/kotlin/no/nav/syfo/dialogmote/api/v2/PostDialogmoteApiV2Spek.kt @@ -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" } } diff --git a/src/test/kotlin/no/nav/syfo/identhendelse/IdenthendelseServiceSpek.kt b/src/test/kotlin/no/nav/syfo/identhendelse/IdenthendelseServiceSpek.kt index 5f3b523d..bfccd2c0 100644 --- a/src/test/kotlin/no/nav/syfo/identhendelse/IdenthendelseServiceSpek.kt +++ b/src/test/kotlin/no/nav/syfo/identhendelse/IdenthendelseServiceSpek.kt @@ -19,9 +19,7 @@ import org.amshove.kluent.shouldBeAfter import org.amshove.kluent.shouldBeEqualTo import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe -import redis.clients.jedis.JedisPool -import redis.clients.jedis.JedisPoolConfig -import redis.clients.jedis.Protocol +import redis.clients.jedis.* object IdenthendelseServiceSpek : Spek({ @@ -33,6 +31,7 @@ object IdenthendelseServiceSpek : Spek({ val externalMockEnvironment = ExternalMockEnvironment.getInstance() val database = externalMockEnvironment.database val cacheMock = mockk() + val redisConfig = externalMockEnvironment.environment.redisConfig val pdlClient = PdlClient( azureAdV2Client = AzureAdV2Client( aadAppClient = externalMockEnvironment.environment.aadAppClient, @@ -41,9 +40,11 @@ object IdenthendelseServiceSpek : Spek({ redisStore = RedisStore( JedisPool( JedisPoolConfig(), - externalMockEnvironment.environment.redisConfig.host, - externalMockEnvironment.environment.redisConfig.port, - Protocol.DEFAULT_TIMEOUT, + HostAndPort(redisConfig.host, redisConfig.port), + DefaultJedisClientConfig.builder() + .ssl(redisConfig.ssl) + .password(redisConfig.redisPassword) + .build() ) ), ), diff --git a/src/test/kotlin/no/nav/syfo/testhelper/ExternalMockEnvironment.kt b/src/test/kotlin/no/nav/syfo/testhelper/ExternalMockEnvironment.kt index f82e57b5..122d72a9 100644 --- a/src/test/kotlin/no/nav/syfo/testhelper/ExternalMockEnvironment.kt +++ b/src/test/kotlin/no/nav/syfo/testhelper/ExternalMockEnvironment.kt @@ -49,6 +49,7 @@ class ExternalMockEnvironment private constructor() { pdlUrl = pdlMock.url, ) lateinit var redisCache: RedisStore + val redisServer = testRedis(environment) val wellKnownSelvbetjening = wellKnownSelvbetjeningMock() val wellKnownVeilederV2 = wellKnownVeilederV2Mock() @@ -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.start() { diff --git a/src/test/kotlin/no/nav/syfo/testhelper/TestRedis.kt b/src/test/kotlin/no/nav/syfo/testhelper/TestRedis.kt new file mode 100644 index 00000000..bb66b685 --- /dev/null +++ b/src/test/kotlin/no/nav/syfo/testhelper/TestRedis.kt @@ -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()