-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filtrer bort valutakurser med fremtidig fom eller tom (#4888)
### 💰 Hva skal gjøres, og hvorfor? Favro: NAV-22931 Som en følge av en tidligere bug, der saksbehandler kunne legge inn kompetanse frem i tid, er det flere behandlinger som har fått valutakurser frem i tid som saksbehandler ikke har tilgang til å endre. Fikser problemet ved å: - Filtrere bort valutakurser som har fom senere enn inneværende måned - Sette `tom = null` i valutakurser som har tom lik eller senere inneværende måned ### ✅ Checklist _Har du husket alle punktene i listen?_ - [ ] Jeg har testet mine endringer i henhold til akseptansekriteriene 🕵️ - [ ] Jeg har config- eller sql-endringer. I så fall, husk manuell deploy til miljø for å verifisere endringene. - [x] Jeg har skrevet tester. Hvis du ikke har skrevet tester, beskriv hvorfor under 👇 ### 💬 Ønsker du en muntlig gjennomgang? - [ ] Ja - [x] Nei
- Loading branch information
1 parent
74881e6
commit 37cbe2d
Showing
6 changed files
with
84 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 18 additions & 1 deletion
19
src/test/enhetstester/kotlin/no/nav/familie/ba/sak/common/TestClockProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
package no.nav.familie.ba.sak | ||
|
||
import no.nav.familie.ba.sak.common.ClockProvider | ||
import no.nav.familie.ba.sak.common.toLocalDate | ||
import java.time.Clock | ||
import java.time.LocalDate | ||
import java.time.LocalDateTime | ||
import java.time.YearMonth | ||
import java.time.ZoneId | ||
import java.time.ZoneOffset | ||
|
||
class TestClockProvider( | ||
private val clock: Clock, | ||
private val clock: Clock = Clock.systemDefaultZone(), | ||
) : ClockProvider { | ||
override fun get(): Clock = clock | ||
|
||
companion object { | ||
fun lagClockProviderMedFastTidspunkt(localDateTime: LocalDateTime): TestClockProvider = | ||
TestClockProvider(Clock.fixed(localDateTime.toInstant(ZoneOffset.UTC), ZoneId.systemDefault())) | ||
|
||
fun lagClockProviderMedFastTidspunkt(localDate: LocalDate): TestClockProvider = | ||
lagClockProviderMedFastTidspunkt(localDate.atStartOfDay()) | ||
|
||
fun lagClockProviderMedFastTidspunkt(yearMonth: YearMonth): TestClockProvider = | ||
lagClockProviderMedFastTidspunkt(yearMonth.toLocalDate()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters