diff --git a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/command/GetTenorTestdata.java b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/command/GetTenorTestdata.java index 6afa47e8e1..4fb11101b5 100644 --- a/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/command/GetTenorTestdata.java +++ b/apps/tenor-search-service/src/main/java/no/nav/testnav/apps/tenorsearchservice/consumers/command/GetTenorTestdata.java @@ -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; @@ -12,6 +13,7 @@ import reactor.core.publisher.Mono; import reactor.util.retry.Retry; +import java.net.URI; import java.time.Duration; import java.util.concurrent.Callable; @@ -19,22 +21,20 @@ @RequiredArgsConstructor public class GetTenorTestdata implements Callable> { - 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 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()