Skip to content

Commit

Permalink
Setter i verksatt dato fra dagen det kjøres g-justering: 21.05.2022
Browse files Browse the repository at this point in the history
  • Loading branch information
geiralund committed May 20, 2022
1 parent 25a3b0f commit 0eb4b91
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/no/nav/dagpenger/grunnbelop/Grunnbelop.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import java.time.YearMonth

enum class Grunnbeløp(val verdi: BigDecimal, val iverksattFom: LocalDate) {
GjusteringsTest(verdi = 111477.toBigDecimal(), iverksattFom = LocalDate.now().plusYears(10)),
FastsattI2022(verdi = 111477.toBigDecimal(), iverksattFom = LocalDate.of(2022, Month.MAY, 1)),
FastsattI2022(verdi = 111477.toBigDecimal(), iverksattFom = LocalDate.of(2022, Month.MAY, 21)),
FastsattI2021(verdi = 106399.toBigDecimal(), iverksattFom = LocalDate.of(2021, Month.MAY, 23)),
FastsattI2020(verdi = 101351.toBigDecimal(), iverksattFom = LocalDate.of(2020, Month.SEPTEMBER, 19)),
FastsattI2019(verdi = 99858.toBigDecimal(), iverksattFom = LocalDate.of(2019, Month.MAY, 26)),
Expand Down
15 changes: 13 additions & 2 deletions src/test/kotlin/no/nav/dagpenger/grunnbelop/GrunnbelopTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,26 @@ import java.time.YearMonth
class GrunnbelopTest {

@Test
fun ` Skal returnere grunnbeløp 2022 etter iverkssatt FOM dato `() {
fun ` Skal returnere grunnbeløp for 2022 etter iverkssatt FOM dato `() {
getGrunnbeløpForRegel(Regel.Grunnlag).forMåned(
dato = YearMonth.of(
2022,
Month.MAY
),
gjeldendeDato = LocalDate.of(2022, 5, 24)
gjeldendeDato = LocalDate.of(2022, 5, 21)
).verdi shouldBe 111477.toBigDecimal()
}

@Test
fun ` Skal returnere grunnbeløp for 2021 dersom gjeldendedato er før iverksatt dato for 2022 G`() {
getGrunnbeløpForRegel(Regel.Grunnlag).forMåned(
dato = YearMonth.of(
2022,
Month.MAY
),
gjeldendeDato = LocalDate.of(2022, 5, 20)
).verdi shouldBe 106399.toBigDecimal()
}
@Test
fun ` Skal returnere grunnbeløp 2021 etter iverkssatt FOM dato `() {
getGrunnbeløpForRegel(Regel.Grunnlag).forMåned(
Expand Down

0 comments on commit 0eb4b91

Please sign in to comment.