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

Øk timeout med 24 timer dvs til 72 timer for gosys oppgaver #601

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -21,6 +21,6 @@ class UtsattOppgaveDAO(private val utsattOppgaveRepository: UtsattOppgaveReposit
}

fun finnAlleUtgåtteOppgaver(): List<UtsattOppgaveEntitet> =
utsattOppgaveRepository.findUtsattOppgaveEntitetByTimeoutBeforeAndTilstandEquals(LocalDateTime.now(), Tilstand.Utsatt)
utsattOppgaveRepository.findUtsattOppgaveEntitetByTimeoutBeforeAndTilstandEquals(LocalDateTime.now().minusHours(24), Tilstand.Utsatt)
.also { logger.info("Fant ${it.size} utsatte oppgaver som har timet ut hvor vi skal opprette en oppgave i gosys") }
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,31 @@ open class UtsattOppgaveRepositoryImpSpec : SystemTestBase() {
Assertions.assertEquals(1, oppgaver.size)
}

@Test
fun `finner ikke utsatt oppgave hvis timout er 24 timer senere`() {
repository.opprett(
UtsattOppgaveEntitet(
id = 0,
inntektsmeldingId = "id",
arkivreferanse = "arkivref",
fnr = "fnr",
aktørId = "aktørId",
journalpostId = "journalpostId",
timeout = now().minusHours(1),
tilstand = Tilstand.Utsatt,
gosysOppgaveId = null,
oppdatert = null,
speil = false,
utbetalingBruker = false
)
)

val oppgaver =
repository.findUtsattOppgaveEntitetByTimeoutBeforeAndTilstandEquals(now().minusHours(24), Tilstand.Utsatt)

Assertions.assertEquals(0, oppgaver.size)
}

@Test
fun `Databasen angir ID ved opprettelse`() {
val firstId = repository.opprett(
Expand Down
Loading