Skip to content

Commit 3d2fdc5

Browse files
Merge pull request #989 from navikt/midlertidig-bug-fix
Skal ha unntak for redistribusjon for journalposter pga feil i dokdis…
2 parents f6bd89f + d6b0c81 commit 3d2fdc5

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

src/main/kotlin/no/nav/familie/ef/iverksett/brev/DistribuerVedtaksbrevTask.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class DistribuerVedtaksbrevTask(
3636
) : AsyncTaskStep {
3737
private val logger: Logger = LoggerFactory.getLogger(this::class.java)
3838

39+
private val rekjørListe: List<String> = listOf("692172785", "692173443", "692173114", "692172868", "692177366", "692172731", "692173282", "692172887", "692172740", "692173010", "691145476", "692173481")
40+
3941
private sealed class Resultat
4042

4143
private object OK : Resultat()
@@ -62,7 +64,7 @@ class DistribuerVedtaksbrevTask(
6264
var resultat: Dødsbo? = null
6365
journalpostResultat
6466
.filter { (_, journalpostResultat) ->
65-
journalpostResultat.journalpostId !in distribuerteJournalposter
67+
(journalpostResultat.journalpostId !in distribuerteJournalposter || journalpostResultat.journalpostId in rekjørListe)
6668
}.forEach { (personIdent, journalpostResultat) ->
6769
try {
6870
distribuerBrevOgOppdaterVedtaksbrevResultat(journalpostResultat, behandlingId)

src/test/kotlin/no/nav/familie/ef/iverksett/brev/DistribuerVedtaksbrevTaskTest.kt

+48
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,54 @@ internal class DistribuerVedtaksbrevTaskTest {
212212
assertThat(distribuerVedtaksbrevResultatSlot.captured.bestillingId).isEqualTo(ikkeDistrbuertJournalpostBestillingId)
213213
}
214214

215+
216+
@Test
217+
fun `skal distribuere brev til mottakere som allerede er distribuert til dersom de ligger i spesiallista`() {
218+
val identMottakerA = "123"
219+
220+
val distribuertBestillingId = "abc"
221+
val distribuertJournalpost = "692172785"
222+
223+
val journalpostResultater =
224+
mapOf(
225+
identMottakerA to JournalpostResultat(distribuertJournalpost),
226+
)
227+
val distribuerteJournalposter =
228+
mapOf(
229+
journalpostResultater[identMottakerA]!!.journalpostId to
230+
DistribuerBrevResultat(
231+
distribuertBestillingId,
232+
),
233+
)
234+
val nyBestillingId = "ny bestillingId"
235+
236+
val journalpostSlot = slot<String>()
237+
val distribuerVedtaksbrevResultatSlot = slot<DistribuerBrevResultat>()
238+
239+
every { iverksettResultatService.hentJournalpostResultat(behandlingId) } returns journalpostResultater
240+
every { iverksettResultatService.hentdistribuerVedtaksbrevResultat(behandlingId) } returns distribuerteJournalposter
241+
every { journalpostClient.distribuerBrev(capture(journalpostSlot), any()) } returns nyBestillingId
242+
every {
243+
iverksettResultatService.oppdaterDistribuerVedtaksbrevResultat(
244+
behandlingId,
245+
any(),
246+
capture(distribuerVedtaksbrevResultatSlot),
247+
)
248+
} returns Unit
249+
250+
distribuerVedtaksbrevTask.doTask(Task(DistribuerVedtaksbrevTask.TYPE, behandlingId.toString(), Properties()))
251+
252+
verify(exactly = 1) { journalpostClient.distribuerBrev(distribuertJournalpost, any()) }
253+
verify(exactly = 1) {
254+
iverksettResultatService.oppdaterDistribuerVedtaksbrevResultat(
255+
behandlingId,
256+
distribuertJournalpost,
257+
any(),
258+
)
259+
}
260+
assertThat(distribuerVedtaksbrevResultatSlot.captured.bestillingId).isEqualTo(nyBestillingId)
261+
}
262+
215263
@Nested
216264
inner class `Død person` {
217265
@Test

0 commit comments

Comments
 (0)