Skip to content

Commit

Permalink
EY-4906 la til test som sjekker lengde på brevkoder
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasbalevik committed Jan 8, 2025
1 parent 2d35428 commit 62435d4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions libs/etterlatte-brev-model/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ dependencies {
implementation(project(":libs:saksbehandling-common"))
implementation("no.nav.pensjon.brevbaker:brevbaker-api-model-common:1.4.0")

testImplementation(libs.test.jupiter.api)
testRuntimeOnly(libs.test.jupiter.engine)
testImplementation(libs.test.kotest.assertionscore)

compileOnly(libs.logging.slf4japi)
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ enum class Brevkoder(
Brevtype.INFORMASJON,
),
OMSTILLINGSSTOENAD_INFORMASJON_INNHENTING_AV_OPPLYSNINGER(
EtterlatteBrevKode.OMSTILLINGSSTOENAD_INFORMASJON_INNHENTING_AV_OPPLYSNINGER,
EtterlatteBrevKode.OMSTILLINGSSTOENAD_INNHENTING_AV_OPPLYSNINGER,
EtterlatteBrevKode.TOM_MAL_INFORMASJONSBREV,
"Du må sende oss flere opplysninger",
Brevtype.INFORMASJON,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum class EtterlatteBrevKode : Brevbakerkode {

OMSTILLINGSSTOENAD_INFORMASJON_DOEDSFALL,
OMSTILLINGSSTOENAD_INFORMASJON_MOTTATT_SOEKNAD,
OMSTILLINGSSTOENAD_INFORMASJON_INNHENTING_AV_OPPLYSNINGER,
OMSTILLINGSSTOENAD_INNHENTING_AV_OPPLYSNINGER,
OMSTILLINGSSTOENAD_AVSLAG,
OMSTILLINGSSTOENAD_AVSLAG_UTFALL,
OMSTILLINGSSTOENAD_INNVILGELSE,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import no.nav.etterlatte.brev.EtterlatteBrevKode
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test

class EtterlatteBrevKodeTest {
@Test
fun `ingen brevkoder har lengde over 50`() {
EtterlatteBrevKode.entries.filter { it.name.length > 50 }.let {
assertTrue(it.isEmpty(), "Alle brevkoder må være under 50 lange for å kunne arkiveres. Disse feila: $it")
}
}
}

0 comments on commit 62435d4

Please sign in to comment.