Skip to content

Commit

Permalink
PEK-849 Prepare for 'Fail on unknown JSON properties' (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
espengjostol authored Mar 10, 2025
1 parent 36f775e commit 4fb865c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ data class BeholdningerMedGrunnlagResult(
val inntektGrunnlagListe: List<Inntektsgrunnlag>,
val dagpengerGrunnlagListe: List<Dagpengegrunnlag>,
val omsorgGrunnlagListe: List<Omsorgsgrunnlag>,
val foerstegangstjeneste: Forstegangstjeneste?
val forstegangstjeneste: Forstegangstjeneste?
)
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class PenBeholdningClient(
inntektGrunnlagListe = emptyList(),
dagpengerGrunnlagListe = emptyList(),
omsorgGrunnlagListe = emptyList(),
foerstegangstjeneste = null
forstegangstjeneste = null
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PersongrunnlagService(
persongrunnlag.omsorgsgrunnlagListe = omsorgGrunnlagListe.toMutableList()
persongrunnlag.inntektsgrunnlagListe = inntektGrunnlagListe.toMutableList()
persongrunnlag.dagpengegrunnlagListe = dagpengerGrunnlagListe.toMutableList()
persongrunnlag.forstegangstjenestegrunnlag = foerstegangstjeneste
persongrunnlag.forstegangstjenestegrunnlag = forstegangstjeneste

if (hentBeholdninger) {
beholdningListe.filterIsInstance<Pensjonsbeholdning>().forEach(persongrunnlag.beholdninger::add)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class OAuth2TokenDto {
@JsonProperty("expires_in")
private var expiresIn: Int? = null

// ext_expires_in must be declared to avoid "unknown property" deserialization error
@JsonProperty("ext_expires_in")
private var extExpiresIn: Int? = null

@JsonProperty("access_token")
private var accessToken: String? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class PenBeholdningClientTest : FunSpec({
inntektGrunnlagListe.size shouldBe 0
dagpengerGrunnlagListe.size shouldBe 0
omsorgGrunnlagListe.size shouldBe 0
foerstegangstjeneste shouldBe null
forstegangstjeneste shouldBe null
}
}
}
Expand Down

0 comments on commit 4fb865c

Please sign in to comment.