Skip to content

Commit

Permalink
Merge pull request #381 from navikt/feature/endre-request-skattegrunnlag
Browse files Browse the repository at this point in the history
Endret endepunkt skattegrunnlag
  • Loading branch information
rinnan17 authored Oct 22, 2024
2 parents 668236b + c4427ee commit daece93
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ open class GrunnlagsConsumer {
return HttpEntity(body, httpHeaders)
}

fun <T> initHttpEntitySkattegrunnlag(body: T): HttpEntity<T> {
fun <T> initHttpEntitySkattegrunnlag(body: T, ident: String): HttpEntity<T> {
val httpHeaders = HttpHeaders()
httpHeaders.contentType = MediaType.APPLICATION_JSON
httpHeaders.add(NAV_CALL_ID, UUID.randomUUID().toString())
httpHeaders.add(NAV_CONSUMER_ID, NAV_CONSUMER_ID_VERDI)
httpHeaders.add(NAV_PERSONIDENT, ident)
return HttpEntity(body, httpHeaders)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ open class InntektskomponentenConsumer(private val restTemplate: HttpHeaderRestT
is RestResponse.Failure -> {
if (abonnerteInntekterRequest) {
// Utelater feillogging ved 400 - Bad Request (inntektsabonnement finnes ikke for personen)
// og 500 (inntektsabonnementet er ikke aktivt ennå)
// og 423 og 500 (inntektsabonnementet er ikke aktivt ennå)
if (restResponse.statusCode == HttpStatus.NOT_FOUND ||
restResponse.statusCode == HttpStatus.INTERNAL_SERVER_ERROR ||
restResponse.statusCode == HttpStatus.BAD_REQUEST
restResponse.statusCode == HttpStatus.BAD_REQUEST ||
restResponse.statusCode == HttpStatus.LOCKED
) {
InntektskomponentenService.LOGGER.warn(
"Mangler abonnement for henting av inntekter fra Inntektskomponenten. " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ open class SigrunConsumer(private val restTemplate: HttpHeaderRestTemplate) : Gr
val uri = UriComponentsBuilder.fromPath(SUMMERT_SKATTEGRUNNLAG_URL)
.queryParam(RETTIGHETSPAKKE, "navBidrag")
.queryParam(INNTEKTSAAR, request.inntektsAar)
.queryParam(PERSONIDENTIFIKATOR, request.personId)
.queryParam(STADIE, "oppgjoer")
.build()
.toUriString()
Expand All @@ -41,7 +40,7 @@ open class SigrunConsumer(private val restTemplate: HttpHeaderRestTemplate) : Gr
val restResponse = restTemplate.tryExchange(
uri,
HttpMethod.GET,
initHttpEntitySkattegrunnlag(request),
initHttpEntitySkattegrunnlag(request, request.personId),
HentSummertSkattegrunnlagResponse::class.java,
HentSummertSkattegrunnlagResponse(emptyList(), emptyList(), null),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ internal class SigrunConsumerTest {
private fun uriBuilder(request: HentSummertSkattegrunnlagRequest) = UriComponentsBuilder.fromPath(SIGRUN_CONTEXT)
.queryParam("rettighetspakke", "navBidrag")
.queryParam("inntektsaar", request.inntektsAar)
.queryParam("personidentifikator", request.personId)
.queryParam("stadie", "oppgjoer")
.build()
.toUriString()
Expand Down

0 comments on commit daece93

Please sign in to comment.