-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flere begrunnelser v1 - Oppdatert IM modell og PDF støtte #837
base: main
Are you sure you want to change the base?
Changes from 3 commits
646c0ce
a977598
f13b675
7ee9e90
139fec1
5b05798
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package no.nav.helsearbeidsgiver.inntektsmelding.api.hentselvbestemtim | ||
|
||
import io.kotest.assertions.assertSoftly | ||
import io.kotest.assertions.json.shouldEqualJson | ||
import io.kotest.matchers.shouldBe | ||
import io.kotest.matchers.string.shouldBeEmpty | ||
import io.ktor.client.statement.bodyAsText | ||
|
@@ -77,6 +79,14 @@ class HentSelvbestemtImRouteKtTest : ApiTest() { | |
|
||
val actualJson = response.bodyAsText() | ||
|
||
println("expected vs actual json:") | ||
println(actualJson) | ||
Jesper-Hustad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
println(Mock.successResponseJson(expectedInntektsmelding)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kan vel droppe println og assertSoftly egentlig? |
||
|
||
assertSoftly { | ||
actualJson shouldEqualJson Mock.successResponseJson(expectedInntektsmelding) | ||
} | ||
|
||
response.status shouldBe HttpStatusCode.OK | ||
actualJson shouldBe Mock.successResponseJson(expectedInntektsmelding) | ||
} | ||
|
@@ -318,7 +328,8 @@ private fun Inntekt.hardcodedJson(): String = | |
"beloep": $beloep, | ||
"inntektsdato": "$inntektsdato", | ||
"naturalytelser": [${naturalytelser.joinToString(transform = Naturalytelse::hardcodedJson)}], | ||
"endringAarsak": ${endringAarsak?.hardcodedJson()} | ||
"endringAarsak": ${endringAarsak?.hardcodedJson()}, | ||
"endringAarsaker": [${endringAarsak?.hardcodedJson()}] | ||
} | ||
""" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package no.nav.helsearbeidsgiver.felles.utils | ||
|
||
import no.nav.helsearbeidsgiver.domene.inntektsmelding.v1.Inntektsmelding | ||
import no.nav.helsearbeidsgiver.domene.inntektsmelding.v1.skjema.SkjemaInntektsmelding | ||
|
||
// midlertidlig duplisering for å støtte flere endringsÅrsaker | ||
fun SkjemaInntektsmelding.fyllUtMangledeEndringsAarsaker(): SkjemaInntektsmelding { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kanskje ha et annet navn en fyllUtManglede - noe mer som ala "konverterEndringAarsakTilListe" |
||
val medEndringsAarsakerfyllt = this.copy(inntekt = this.inntekt?.copy(endringAarsaker = listOfNotNull(this.inntekt?.endringAarsak))) | ||
val verdiMangler = this.inntekt?.endringAarsaker.isNullOrEmpty() | ||
return if (verdiMangler) medEndringsAarsakerfyllt else this | ||
} | ||
|
||
fun Inntektsmelding.fyllUtMangledeEndringsAarsaker(): Inntektsmelding { | ||
val medEndringsAarsakerfyllt = this.copy(inntekt = this.inntekt?.copy(endringAarsaker = listOfNotNull(this.inntekt?.endringAarsak))) | ||
val verdiMangler = this.inntekt?.endringAarsaker.isNullOrEmpty() | ||
return if (verdiMangler) medEndringsAarsakerfyllt else this | ||
} | ||
|
||
// fun LagretInntektsmelding.fyllUtMangledeEndringsAarsaker(): LagretInntektsmelding { | ||
// | ||
// | ||
// val medEndringsAarsakerfyllt = this.copy(inntekt = this.inntekt?.copy(endringAarsaker = listOfNotNull(this.inntekt?.endringAarsak))) | ||
// val verdiMangler = this.inntekt?.endringAarsaker.isNullOrEmpty() | ||
// return if (verdiMangler) medEndringsAarsakerfyllt else this | ||
// } |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ kotlinVersion=2.0.21 | |
kotlinterVersion=4.4.0 | ||
|
||
# Dependency versions | ||
hagDomeneInntektsmeldingVersion=0.1.7 | ||
hagDomeneInntektsmeldingVersion=0.1.8-SNAPSHOT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bør bygge en final release (uten snapshot) som brukes her, før vi merger |
||
junitJupiterVersion=5.11.3 | ||
kotestVersion=5.9.1 | ||
kotlinCoroutinesVersion=1.9.0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kan gjerne fjerne utkommentert kode, heller ta det inn når det faktisk skal tas i bruk