Skip to content

Commit

Permalink
sender omsorgsmottaker i stedet for perioder i feilifnroamsjon for ov…
Browse files Browse the repository at this point in the history
…erlappende perioder
  • Loading branch information
jankroken-nav committed Nov 21, 2024
1 parent c75f7a7 commit 8cf4927
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val domeneVersion = "2.1.0"
val domeneVersion = "2.1.2"
val navTokenSupportVersion = "5.0.8"
val hibernateValidatorVersion = "8.0.1.Final"
val logbackEncoderVersion = "8.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ sealed class BarnetrygdException(msg: String, cause: Throwable) : RuntimeExcepti
cause: Throwable,
valdata: Rådata? = null,
val perioder: List<Periode>,
val omsorgsmottaker: String,
) : BarnetrygdException(msg, cause)

class FeilIGrunnlagsdata(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class KompletteringsService(
message = "Feil i datagrunnlag: ${e.message}",
exceptionType = e::class.java.canonicalName,
exceptionMessage = e.message ?: "",
perioder = e.perioder,
omsorgsmottaker = e.omsorgsmottaker,
)
)
} catch (e: BarnetrygdException.FeilIGrunnlagsdata) {
Expand Down Expand Up @@ -104,7 +104,7 @@ class KompletteringsService(
message = e.message ?: "",
exceptionType = e.cause?.let { it::class.java.canonicalName } ?: "",
exceptionMessage = e.cause?.message ?: "",
perioder = e.perioder,
omsorgsmottaker = e.omsorgsmottaker,
)
)
}
Expand All @@ -123,7 +123,7 @@ class KompletteringsService(
message = e.message ?: "",
exceptionType = e.cause?.let { it::class.java.canonicalName } ?: "",
exceptionMessage = e.cause?.message ?: "",
perioder = e.perioder,
omsorgsmottaker = e.omsorgsmottaker,
)
)
}
Expand All @@ -139,7 +139,7 @@ class KompletteringsService(
message = "Overlappende perioder ved henting av hjelpestønadsgrunnlag",
exceptionType = e::class.java.canonicalName,
exceptionMessage = e.message ?: "",
perioder = e.perioder,
omsorgsmottaker = e.omsorgsmottaker,
)
)
} catch (e: UgyldigPersongrunnlag) {
Expand Down Expand Up @@ -180,7 +180,7 @@ class KompletteringsService(
message = "Overlappende hjelpestønadperioder",
exceptionType = e::class.java.canonicalName,
exceptionMessage = e.message ?: "",
perioder = e.perioder,
omsorgsmottaker = e.omsorgsmottaker,
)
)
}
Expand All @@ -199,7 +199,7 @@ class KompletteringsService(
message = e.message ?: "",
exceptionType = e.cause?.let { it::class.java.canonicalName } ?: "",
exceptionMessage = e.cause?.message ?: "",
e.perioder,
omsorgsmottaker = e.omsorgsmottaker,
)
)
}
Expand Down Expand Up @@ -301,7 +301,8 @@ class KompletteringsService(
throw BarnetrygdException.OverlappendePerioder(
msg = "Overlappende perioder for samme omsorgsmottaker",
cause = e,
perioder = e.perioder
perioder = e.perioder,
omsorgsmottaker = e.omsorgsmottaker,
)
} catch (e: UgyldigPersongrunnlag) {
throw BarnetrygdException.FeilIGrunnlagsdata(
Expand Down Expand Up @@ -351,6 +352,7 @@ class KompletteringsService(
msg = "Overlappende perioder",
cause = e,
perioder = e.perioder,
omsorgsmottaker = e.omsorgsmottaker,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ object HentBarnetrygdResponseHandler {
msg = "Feil ved deserialisering av barnetrygdsaker",
cause = e,
perioder = e.perioder,
rådata = Rådata(listOf(rådata))
rådata = Rådata(listOf(rådata)),
omsorgsmottaker = e.omsorgsmottaker,
)
} catch (e: UgyldigPersongrunnlag) {
throw BarnetrygdException.FeilIGrunnlagsdata(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,13 @@ class KompletteringsServiceTest : SpringContextTest.NoKafka() {
}

assertThat(komplettert.feilinformasjon)
.hasSize(1) .first()
.hasSize(1)
.first()
.isInstanceOf(Feilinformasjon.OverlappendeBarnetrygdperioder::class.java)
println(komplettert)
assertThat(komplettert.rådata).hasSize(1)
assertThat((komplettert.feilinformasjon.first() as Feilinformasjon.OverlappendeBarnetrygdperioder).perioder)
.hasSize(2)
assertThat((komplettert.feilinformasjon.first() as Feilinformasjon.OverlappendeBarnetrygdperioder).omsorgsmottaker)
.isEqualTo(fnr(2).value)
}


Expand Down

0 comments on commit 8cf4927

Please sign in to comment.