Skip to content

Commit

Permalink
Oppdatert URI #deploy-tenor-search-service
Browse files Browse the repository at this point in the history
  • Loading branch information
krharum committed Jan 12, 2024
1 parent 9087f84 commit fa9dbd6
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.databind.JsonNode;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import no.nav.testnav.apps.tenorsearchservice.domain.TenorResponse;
import no.nav.testnav.libs.reactivecore.utils.WebClientFilter;
Expand All @@ -12,29 +13,28 @@
import reactor.core.publisher.Mono;
import reactor.util.retry.Retry;

import java.net.URI;
import java.time.Duration;
import java.util.concurrent.Callable;

@Slf4j
@RequiredArgsConstructor
public class GetTenorTestdata implements Callable<Mono<TenorResponse>> {

private static final String TENOR_QUERY_URL = "/api/testnorge/v2/soek/freg";
private static final String TENOR_QUERY_URL = "/api/testnorge/v2/soek/freg?kql=";

private final WebClient webClient;
private final String query;
private final String token;

@Override
@SneakyThrows
public Mono<TenorResponse> call() {

log.info("Query-parameter: {}", query);

return webClient.get()
.uri(uriBuilder -> uriBuilder.path(TENOR_QUERY_URL)
.queryParam("kql", query)
.queryParam("nokkelinformasjon", true)
.build())
.uri(new URI(TENOR_QUERY_URL+query+"nokkelinformasjon:true"))
.header(HttpHeaders.AUTHORIZATION, "Bearer " + token)
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.retrieve()
Expand Down

0 comments on commit fa9dbd6

Please sign in to comment.