5
5
import java .math .BigDecimal ;
6
6
import java .time .Duration ;
7
7
import java .time .LocalDate ;
8
- import java .util .ArrayList ;
9
8
import java .util .List ;
10
9
import java .util .Map ;
11
10
11
+ import org .junit .jupiter .api .Disabled ;
12
12
import org .junit .jupiter .api .Test ;
13
13
14
14
import no .nav .k9 .søknad .JsonUtils ;
28
28
import no .nav .k9 .søknad .ytelse .psb .v1 .arbeidstid .ArbeidstidInfo ;
29
29
import no .nav .k9 .søknad .ytelse .psb .v1 .arbeidstid .ArbeidstidPeriodeInfo ;
30
30
import no .nav .k9 .søknad .ytelse .psb .v1 .tilsyn .Tilsynsordning ;
31
- import no .nav .k9 .søknad .ytelse .psb .v1 .tilsyn .PeriodeInfo ;
32
- import no .nav .k9 .søknad .ytelse .psb .v1 .tilsyn .TilsynsordningOpphold ;
33
- import no .nav .k9 .søknad .ytelse .psb .v1 .tilsyn .TilsynsordningSvar ;
31
+ import no .nav .k9 .søknad .ytelse .psb .v1 .tilsyn .TilsynPeriodeInfo ;
34
32
35
33
public class PleiepengerBarnSøknadValidatorTest {
36
34
private static final PleiepengerSyktBarnValidator validator = new PleiepengerSyktBarnValidator ();
@@ -60,7 +58,7 @@ public class PleiepengerBarnSøknadValidatorTest {
60
58
var søknad = TestUtils .komplettBuilder ();
61
59
Tilsynsordning tilsynsordning = new Tilsynsordning (Map .of (
62
60
new Periode (LocalDate .now (), LocalDate .now ()),
63
- new PeriodeInfo ( BigDecimal . valueOf ( 7 ))));
61
+ new TilsynPeriodeInfo ( Duration . ofHours ( 7 ). plusMinutes ( 30 ))));
64
62
søknad .setTilsynsordning (tilsynsordning );
65
63
66
64
verifyHarFeil (søknad );
@@ -70,11 +68,11 @@ public class PleiepengerBarnSøknadValidatorTest {
70
68
public void søknadMedArbeidsSomOverlapper () {
71
69
var søknad = TestUtils .komplettBuilder ();
72
70
var søknadsperiode = søknad .getSøknadsperiode ();
73
- var arbeidstidInfo = new ArbeidstidInfo (Map .of (
71
+ var arbeidstidInfo = new ArbeidstidInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 ), Map .of (
74
72
søknadsperiode ,
75
- new ArbeidstidPeriodeInfo (BigDecimal . valueOf ( 8 ), BigDecimal . valueOf ( 8 )),
73
+ new ArbeidstidPeriodeInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 )),
76
74
new Periode (søknadsperiode .getFraOgMed ().plusDays (7 ), søknadsperiode .getTilOgMed ().minusDays (7 )),
77
- new ArbeidstidPeriodeInfo (BigDecimal . valueOf ( 8 ), BigDecimal . valueOf ( 8 ))));
75
+ new ArbeidstidPeriodeInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 ))));
78
76
var arbeidstaker = new Arbeidstaker (null , Organisasjonsnummer .of ("88888888" ), arbeidstidInfo );
79
77
søknad .getArbeidstid ().leggeTilArbeidstaker (arbeidstaker , arbeidstidInfo );
80
78
assertThat (verifyHarFeil (søknad )).hasSize (2 );
@@ -85,9 +83,9 @@ public class PleiepengerBarnSøknadValidatorTest {
85
83
public void søknadMedNullJobberNormaltTimerPerDag () {
86
84
var søknad = TestUtils .komplettBuilder ();
87
85
var søknadsperiode = søknad .getSøknadsperiode ();
88
- var arbeidstidInfo = new ArbeidstidInfo (Map .of (
86
+ var arbeidstidInfo = new ArbeidstidInfo (null , Map .of (
89
87
søknadsperiode ,
90
- new ArbeidstidPeriodeInfo (null , BigDecimal . valueOf ( 8 ))));
88
+ new ArbeidstidPeriodeInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 ))));
91
89
var arbeidstaker = new Arbeidstaker (null , Organisasjonsnummer .of ("88888888" ), arbeidstidInfo );
92
90
søknad .getArbeidstid ().leggeTilArbeidstaker (arbeidstaker , arbeidstidInfo );
93
91
verifyHarFeil (søknad );
@@ -97,9 +95,9 @@ public class PleiepengerBarnSøknadValidatorTest {
97
95
public void søknadMedNullFaktiskArbeidTimerPerDag () {
98
96
var søknad = TestUtils .komplettBuilder ();
99
97
var søknadsperiode = søknad .getSøknadsperiode ();
100
- var arbeidstidInfo = new ArbeidstidInfo (Map .of (
98
+ var arbeidstidInfo = new ArbeidstidInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 ), Map .of (
101
99
søknadsperiode ,
102
- new ArbeidstidPeriodeInfo (BigDecimal . valueOf ( 8 ), null )));
100
+ new ArbeidstidPeriodeInfo (null )));
103
101
var arbeidstaker = new Arbeidstaker (null , Organisasjonsnummer .of ("88888888" ), arbeidstidInfo );
104
102
søknad .getArbeidstid ().leggeTilArbeidstaker (arbeidstaker , arbeidstidInfo );
105
103
verifyHarFeil (søknad );
@@ -109,9 +107,9 @@ public class PleiepengerBarnSøknadValidatorTest {
109
107
public void søknadMedNegativNormaltArbeidTimerPerDag () {
110
108
var søknad = TestUtils .komplettBuilder ();
111
109
var søknadsperiode = søknad .getSøknadsperiode ();
112
- var arbeidstidInfo = new ArbeidstidInfo (Map .of (
110
+ var arbeidstidInfo = new ArbeidstidInfo (Duration . ofHours (- 8 ), Map .of (
113
111
søknadsperiode ,
114
- new ArbeidstidPeriodeInfo (BigDecimal . valueOf (- 20 ), BigDecimal . valueOf ( 8 ))));
112
+ new ArbeidstidPeriodeInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 ))));
115
113
var arbeidstaker = new Arbeidstaker (null , Organisasjonsnummer .of ("88888888" ), arbeidstidInfo );
116
114
søknad .getArbeidstid ().leggeTilArbeidstaker (arbeidstaker , arbeidstidInfo );
117
115
verifyHarFeil (søknad );
@@ -121,9 +119,9 @@ public class PleiepengerBarnSøknadValidatorTest {
121
119
public void søknadMedNegativFaktiskArbeidTimerPerDag () {
122
120
var søknad = TestUtils .komplettBuilder ();
123
121
var søknadsperiode = søknad .getSøknadsperiode ();
124
- var arbeidstidInfo = new ArbeidstidInfo (Map .of (
122
+ var arbeidstidInfo = new ArbeidstidInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 ), Map .of (
125
123
søknadsperiode ,
126
- new ArbeidstidPeriodeInfo (BigDecimal . valueOf ( 8 ), BigDecimal . valueOf (- 8 ))));
124
+ new ArbeidstidPeriodeInfo (Duration . ofHours (- 7 ). plusMinutes ( 30 ))));
127
125
var arbeidstaker = new Arbeidstaker (null , Organisasjonsnummer .of ("88888888" ), arbeidstidInfo );
128
126
søknad .getArbeidstid ().leggeTilArbeidstaker (arbeidstaker , arbeidstidInfo );
129
127
verifyHarFeil (søknad );
@@ -133,9 +131,9 @@ public class PleiepengerBarnSøknadValidatorTest {
133
131
public void søknadMedNullFeilArbeidstaker () {
134
132
var søknad = TestUtils .komplettBuilder ();
135
133
var søknadsperiode = søknad .getSøknadsperiode ();
136
- var arbeidstidInfo = new ArbeidstidInfo (Map .of (
134
+ var arbeidstidInfo = new ArbeidstidInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 ), Map .of (
137
135
søknadsperiode ,
138
- new ArbeidstidPeriodeInfo (BigDecimal . valueOf ( 8 ), BigDecimal . valueOf ( 8 ))));
136
+ new ArbeidstidPeriodeInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 ))));
139
137
var arbeidstaker = new Arbeidstaker (null , null , arbeidstidInfo );
140
138
søknad .getArbeidstid ().leggeTilArbeidstaker (arbeidstaker , arbeidstidInfo );
141
139
verifyHarFeil (søknad );
@@ -145,9 +143,9 @@ public class PleiepengerBarnSøknadValidatorTest {
145
143
public void søknadMedIkkeEntydigInfoForArbeidstaker () {
146
144
var søknad = TestUtils .komplettBuilder ();
147
145
var søknadsperiode = søknad .getSøknadsperiode ();
148
- var arbeidstidInfo = new ArbeidstidInfo (Map .of (
146
+ var arbeidstidInfo = new ArbeidstidInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 ), Map .of (
149
147
søknadsperiode ,
150
- new ArbeidstidPeriodeInfo (BigDecimal . valueOf ( 8 ), BigDecimal . valueOf ( 8 ))));
148
+ new ArbeidstidPeriodeInfo (Duration . ofHours ( 7 ). plusMinutes ( 30 ))));
151
149
var arbeidstaker = new Arbeidstaker (NorskIdentitetsnummer .of ("29099012345" ), Organisasjonsnummer .of ("88888888" ), arbeidstidInfo );
152
150
søknad .getArbeidstid ().leggeTilArbeidstaker (arbeidstaker , arbeidstidInfo );
153
151
verifyHarFeil (søknad );
0 commit comments