@@ -4,13 +4,15 @@ import com.fasterxml.jackson.module.kotlin.readValue
4
4
import de.huxhorn.sulky.ulid.ULID
5
5
import io.kotest.matchers.collections.shouldBeEmpty
6
6
import io.kotest.matchers.collections.shouldContain
7
+ import io.kotest.matchers.collections.shouldContainExactly
7
8
import io.kotest.matchers.collections.shouldHaveSize
8
9
import io.kotest.matchers.nulls.shouldNotBeNull
9
10
import io.kotest.matchers.shouldBe
10
11
import no.nav.dagpenger.inntekt.inntektskomponenten.v1.Aktoer
11
12
import no.nav.dagpenger.inntekt.inntektskomponenten.v1.AktoerType.AKTOER_ID
12
13
import no.nav.dagpenger.inntekt.inntektskomponenten.v1.AktoerType.NATURLIG_IDENT
13
14
import no.nav.dagpenger.inntekt.inntektskomponenten.v1.AktoerType.ORGANISASJON
15
+ import no.nav.dagpenger.inntekt.inntektskomponenten.v1.Avvik
14
16
import no.nav.dagpenger.inntekt.inntektskomponenten.v1.Inntekt
15
17
import no.nav.dagpenger.inntekt.inntektskomponenten.v1.InntektBeskrivelse.BIL
16
18
import no.nav.dagpenger.inntekt.inntektskomponenten.v1.InntektType.LOENNSINNTEKT
@@ -40,10 +42,18 @@ class InntekterDtoTest {
40
42
storedInntekt.inntektId.id shouldBe inntektId
41
43
storedInntekt.inntekt.ident.aktoerType shouldBe NATURLIG_IDENT
42
44
storedInntekt.inntekt.ident.identifikator shouldBe inntekterDto.mottaker.pnr
43
- storedInntekt.inntekt.arbeidsInntektMaaned?.shouldHaveSize(4 )
45
+ storedInntekt.inntekt.arbeidsInntektMaaned?.shouldHaveSize(5 )
44
46
storedInntekt.inntekt.arbeidsInntektMaaned?.first().let {
45
47
it?.aarMaaned shouldBe YearMonth .of(2023 , 1 )
46
- it?.avvikListe.shouldBeEmpty()
48
+ it?.avvikListe.shouldContainExactly(
49
+ Avvik (
50
+ ident = Aktoer (AKTOER_ID , " 287631" ),
51
+ opplysningspliktig = Aktoer (NATURLIG_IDENT , " 06221841830" ),
52
+ virksomhet = Aktoer (ORGANISASJON , " 123456789" ),
53
+ avvikPeriode = YearMonth .of(2023 , 1 ),
54
+ tekst = " Dette er et avvik for 2023-01" ,
55
+ ),
56
+ )
47
57
it?.arbeidsInntektInformasjon?.inntektListe?.shouldHaveSize(1 )
48
58
it?.arbeidsInntektInformasjon?.inntektListe?.shouldContain(
49
59
Inntekt (
@@ -80,21 +90,41 @@ class InntekterDtoTest {
80
90
}
81
91
storedInntekt.inntekt.arbeidsInntektMaaned?.get(1 ).let {
82
92
it?.aarMaaned shouldBe YearMonth .of(2024 , 1 )
83
- it?.avvikListe.shouldBeEmpty()
93
+ it?.avvikListe.shouldContainExactly(
94
+ Avvik (
95
+ ident = Aktoer (AKTOER_ID , " 287631" ),
96
+ opplysningspliktig = Aktoer (NATURLIG_IDENT , " 06221841830" ),
97
+ virksomhet = Aktoer (ORGANISASJON , " 123456789" ),
98
+ avvikPeriode = YearMonth .of(2024 , 1 ),
99
+ tekst = " Dette er et avvik" ,
100
+ ),
101
+ Avvik (
102
+ ident = Aktoer (AKTOER_ID , " 287631" ),
103
+ opplysningspliktig = Aktoer (NATURLIG_IDENT , " 06221841830" ),
104
+ virksomhet = Aktoer (ORGANISASJON , " 987654321" ),
105
+ avvikPeriode = YearMonth .of(2024 , 1 ),
106
+ tekst = " Dette er et annet avvik" ,
107
+ ),
108
+ )
84
109
it?.arbeidsInntektInformasjon?.inntektListe?.shouldHaveSize(2 )
85
110
}
86
111
storedInntekt.inntekt.arbeidsInntektMaaned?.get(2 ).let {
87
112
it?.aarMaaned shouldBe YearMonth .of(2025 , 2 )
88
- it?.avvikListe.shouldBeEmpty()
113
+ it?.avvikListe shouldBe null
89
114
it?.arbeidsInntektInformasjon?.inntektListe?.shouldHaveSize(1 )
90
115
it?.arbeidsInntektInformasjon?.inntektListe?.first().let { inntekt ->
91
116
inntekt?.tilleggsinformasjon shouldBe null
92
117
}
93
118
}
94
119
storedInntekt.inntekt.arbeidsInntektMaaned?.get(3 ).let {
95
120
it?.aarMaaned shouldBe YearMonth .of(2025 , 3 )
96
- it?.avvikListe.shouldBeEmpty()
121
+ it?.avvikListe shouldBe null
97
122
it?.arbeidsInntektInformasjon?.inntektListe?.shouldHaveSize(1 )
98
123
}
124
+ storedInntekt.inntekt.arbeidsInntektMaaned?.get(4 ).let {
125
+ it?.aarMaaned shouldBe YearMonth .of(2000 , 12 )
126
+ it?.avvikListe?.shouldHaveSize(1 )
127
+ it?.arbeidsInntektInformasjon?.inntektListe?.shouldBeEmpty()
128
+ }
99
129
}
100
130
}
0 commit comments