Skip to content

Commit

Permalink
Remove explicit MediaType and add logging in skattekort service #depl…
Browse files Browse the repository at this point in the history
…oy-skattekort-service

The explicit setting of MediaType.TEXT_PLAIN_VALUE in SkattekortController has been removed, making the @GetMapping annotation default to all media types. Additionally, a logging statement was added in SkattekortService to log the response after consuming a skatteKort. A default "content-type" header was removed from SokosSkattekortConsumer.
  • Loading branch information
krharum committed Jun 13, 2024
1 parent 8ebef6b commit 2c0860d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public SokosSkattekortConsumer(TokenExchange tokenExchange, Consumers consumers)
this.serverProperties = consumers.getSokosSkattekort();
this.webClient = WebClient.builder()
.baseUrl(serverProperties.getUrl())
.defaultHeader("content-type", "application/json")
.build();
this.tokenExchange = tokenExchange;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Mono<String> sendSkattekort(@RequestBody SkattekortTilArbeidsgiverDTO ska
return skattekortService.sendSkattekort(skattekort);
}

@GetMapping(produces = MediaType.TEXT_PLAIN_VALUE)
@GetMapping
public Mono<String> hentSkattekort(@RequestBody SokosGetRequest request) {

return skattekortService.hentSkattekort(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private String encodeRequest(String request) {

public Mono<String> hentSkattekort(SokosGetRequest request) {

return skattekortConsumer.hentSkattekort(request);
return skattekortConsumer.hentSkattekort(request)
.doOnNext(response -> log.info("Hentet resultat fra Sokos {}", response));
}
}

0 comments on commit 2c0860d

Please sign in to comment.