File tree Expand file tree Collapse file tree
apps/dolly-backend/src/main/java/no/nav/dolly/consumer/teamkatalog Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import org .springframework .stereotype .Service ;
1010import org .springframework .web .reactive .function .client .WebClient ;
1111import reactor .core .publisher .Flux ;
12- import reactor .core .publisher .Mono ;
1312
1413import java .util .List ;
1514
@@ -36,10 +35,8 @@ public TeamkatalogConsumer(
3635 @ Timed (name = "providers" , tags = { "operation" , "saf_getDokument" })
3736 public Flux <TeamkatalogDTO > getTeamForEpost (List <String > epost ) {
3837
39- return new TeamkatalogGetCommand (webClient , epost ).call ();
40-
41- // return tokenService.exchange(serverProperties)
42- // .flatMap(token -> new TeamkatalogGetCommand(webClient,
43- // epost, token.getTokenValue()).call());
38+ return tokenService .exchange (serverProperties )
39+ .flatMapMany (token -> new TeamkatalogGetCommand (webClient ,
40+ epost , token .getTokenValue ()).call ());
4441 }
4542}
Original file line number Diff line number Diff line change 44import lombok .extern .slf4j .Slf4j ;
55import no .nav .dolly .consumer .teamkatalog .dto .TeamkatalogDTO ;
66import no .nav .testnav .libs .reactivecore .web .WebClientError ;
7+ import no .nav .testnav .libs .reactivecore .web .WebClientHeader ;
78import org .springframework .web .reactive .function .client .WebClient ;
89import reactor .core .publisher .Flux ;
910import reactor .core .publisher .Mono ;
@@ -19,7 +20,7 @@ public class TeamkatalogGetCommand implements Callable<Flux<TeamkatalogDTO>> {
1920
2021 private final WebClient webClient ;
2122 private final List <String > epost ;
22- // private final String token;
23+ private final String token ;
2324
2425 @ Override
2526 public Flux <TeamkatalogDTO > call () {
@@ -29,7 +30,7 @@ public Flux<TeamkatalogDTO> call() {
2930 .uri (uriBuilder -> uriBuilder
3031 .path (TEAM_URL )
3132 .build ())
32- // .headers(WebClientHeader.bearer(token))
33+ .headers (WebClientHeader .bearer (token ))
3334 .body (Mono .just (epost ), List .class )
3435 .retrieve ()
3536 .bodyToFlux (TeamkatalogDTO .class )
You can’t perform that action at this time.
0 commit comments