@@ -27,7 +27,7 @@ internal class BehandlingServiceIntegrationTest : IntegrationTest() {
27
27
@Test
28
28
internal fun `opprettBehandling skal ikke være mulig å opprette en revurdering om forrige behandling ikke er ferdigstilt` () {
29
29
val fagsak = testoppsettService.lagreFagsak(fagsak())
30
- behandlingRepository.insert (
30
+ testoppsettService.lagre (
31
31
behandling(
32
32
fagsak = fagsak,
33
33
status = BehandlingStatus .UTREDES ,
@@ -64,16 +64,16 @@ internal class BehandlingServiceIntegrationTest : IntegrationTest() {
64
64
@Test
65
65
internal fun `hentBehandlinger - skal returnere behandlinger` () {
66
66
val fagsak = testoppsettService.lagreFagsak(fagsak())
67
- val behandling = behandlingRepository.insert (behandling(fagsak, status = BehandlingStatus .FERDIGSTILT ))
68
- val behandling2 = behandlingRepository.insert (behandling(fagsak))
67
+ val behandling = testoppsettService.lagre (behandling(fagsak, status = BehandlingStatus .FERDIGSTILT ))
68
+ val behandling2 = testoppsettService.lagre (behandling(fagsak))
69
69
70
70
assertThat(behandlingService.hentBehandlinger(setOf (behandling.id, behandling2.id))).hasSize(2 )
71
71
}
72
72
73
73
@Test
74
74
internal fun `skal finne siste behandling med avslåtte hvis kun avslått` () {
75
75
val fagsak = testoppsettService.lagreFagsak(fagsak())
76
- val behandling = behandlingRepository.insert (
76
+ val behandling = testoppsettService.lagre (
77
77
behandling(fagsak, resultat = BehandlingResultat .AVSL ÅTT , status = BehandlingStatus .FERDIGSTILT ),
78
78
)
79
79
val sisteBehandling = behandlingService.finnSisteIverksatteBehandlingMedEventuellAvslått(fagsak.id)
@@ -83,10 +83,10 @@ internal class BehandlingServiceIntegrationTest : IntegrationTest() {
83
83
@Test
84
84
internal fun `skal finne siste behandling med avslåtte hvis avslått og henlagt` () {
85
85
val fagsak = testoppsettService.lagreFagsak(fagsak())
86
- val avslag = behandlingRepository.insert (
86
+ val avslag = testoppsettService.lagre (
87
87
behandling(fagsak, resultat = BehandlingResultat .AVSL ÅTT , status = BehandlingStatus .FERDIGSTILT ),
88
88
)
89
- behandlingRepository.insert (
89
+ testoppsettService.lagre (
90
90
behandling(fagsak, resultat = BehandlingResultat .HENLAGT , status = BehandlingStatus .FERDIGSTILT ),
91
91
)
92
92
val sisteBehandling = behandlingService.finnSisteIverksatteBehandlingMedEventuellAvslått(fagsak.id)
@@ -96,13 +96,13 @@ internal class BehandlingServiceIntegrationTest : IntegrationTest() {
96
96
@Test
97
97
internal fun `skal plukke ut førstegangsbehandling hvis det finnes førstegangsbehandling, avslått og henlagt` () {
98
98
val fagsak = testoppsettService.lagreFagsak(fagsak())
99
- val førstegang = behandlingRepository.insert (
99
+ val førstegang = testoppsettService.lagre (
100
100
behandling(fagsak, resultat = BehandlingResultat .INNVILGET , status = BehandlingStatus .FERDIGSTILT ),
101
101
)
102
- behandlingRepository.insert (
102
+ testoppsettService.lagre (
103
103
behandling(fagsak, resultat = BehandlingResultat .AVSL ÅTT , status = BehandlingStatus .FERDIGSTILT ),
104
104
)
105
- behandlingRepository.insert (
105
+ testoppsettService.lagre (
106
106
behandling(fagsak, resultat = BehandlingResultat .HENLAGT , status = BehandlingStatus .FERDIGSTILT ),
107
107
)
108
108
val sisteBehandling = behandlingService.finnSisteIverksatteBehandlingMedEventuellAvslått(fagsak.id)
@@ -132,16 +132,16 @@ internal class BehandlingServiceIntegrationTest : IntegrationTest() {
132
132
),
133
133
)
134
134
135
- behandlingRepository.insert (
135
+ testoppsettService.lagre (
136
136
behandling(fagsakOs, resultat = BehandlingResultat.HENLAGT, status = BehandlingStatus.FERDIGSTILT),
137
137
)
138
- val førstegangBt = behandlingRepository.insert (
138
+ val førstegangBt = testoppsettService.lagre (
139
139
behandling(fagsakBt, resultat = BehandlingResultat.INNVILGET, status = BehandlingStatus.FERDIGSTILT),
140
140
)
141
- val førstegangSp = behandlingRepository.insert (
141
+ val førstegangSp = testoppsettService.lagre (
142
142
behandling(fagsakSp, resultat = BehandlingResultat.INNVILGET, status = BehandlingStatus.FERDIGSTILT),
143
143
)
144
- val revurderingUnderArbeidSP = behandlingRepository.insert (
144
+ val revurderingUnderArbeidSP = testoppsettService.lagre (
145
145
behandling(fagsakSp, resultat = BehandlingResultat.IKKE_SATT, status = BehandlingStatus.UTREDES),
146
146
)
147
147
@@ -156,7 +156,7 @@ internal class BehandlingServiceIntegrationTest : IntegrationTest() {
156
156
@Test
157
157
internal fun `opprettBehandling av førstegangsbehandling er ikke mulig hvis det finnes en førstegangsbehandling på vent` () {
158
158
val fagsak = testoppsettService.lagreFagsak(fagsak())
159
- behandlingRepository.insert (behandling(fagsak, BehandlingStatus .SATT_P Å_VENT ))
159
+ testoppsettService.lagre (behandling(fagsak, BehandlingStatus .SATT_P Å_VENT ))
160
160
assertThatThrownBy {
161
161
behandlingService.opprettBehandling(
162
162
BehandlingType .F ØRSTEGANGSBEHANDLING ,
@@ -169,7 +169,7 @@ internal class BehandlingServiceIntegrationTest : IntegrationTest() {
169
169
@Test
170
170
internal fun `opprettBehandling av revurdering er ikke mulig hvis det finnes en førstegangsbehandling på vent` () {
171
171
val fagsak = testoppsettService.lagreFagsak(fagsak())
172
- behandlingRepository.insert (behandling(fagsak, BehandlingStatus .SATT_P Å_VENT ))
172
+ testoppsettService.lagre (behandling(fagsak, BehandlingStatus .SATT_P Å_VENT ))
173
173
assertThatThrownBy {
174
174
behandlingService.opprettBehandling(
175
175
BehandlingType .REVURDERING ,
@@ -182,8 +182,8 @@ internal class BehandlingServiceIntegrationTest : IntegrationTest() {
182
182
@Test
183
183
internal fun `opprettBehandling er mulig hvis det finnes en revurdering på vent` () {
184
184
val fagsak = testoppsettService.lagreFagsak(fagsak())
185
- behandlingRepository.insert (behandling(fagsak, BehandlingStatus .FERDIGSTILT ))
186
- behandlingRepository.insert (
185
+ testoppsettService.lagre (behandling(fagsak, BehandlingStatus .FERDIGSTILT ))
186
+ testoppsettService.lagre (
187
187
behandling(fagsak, BehandlingStatus .SATT_P Å_VENT , type = BehandlingType .REVURDERING ),
188
188
)
189
189
behandlingService.opprettBehandling(
0 commit comments