diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java b/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java
index f0ef428e58d..6af8668f777 100644
--- a/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java
+++ b/apps/dolly-backend/src/main/java/no/nav/dolly/DollyBackendApplicationStarter.java
@@ -10,4 +10,4 @@ public static void main(String[] args) {
SpringApplication.run(DollyBackendApplicationStarter.class, args);
}
-}
+}
\ No newline at end of file
diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/config/CachingConfig.java b/apps/dolly-backend/src/main/java/no/nav/dolly/config/CachingConfig.java
index 67c4e88d522..769530033ad 100644
--- a/apps/dolly-backend/src/main/java/no/nav/dolly/config/CachingConfig.java
+++ b/apps/dolly-backend/src/main/java/no/nav/dolly/config/CachingConfig.java
@@ -20,8 +20,6 @@ public class CachingConfig {
public static final String CACHE_BRUKER = "bruker";
public static final String CACHE_GRUPPE = "gruppe";
public static final String CACHE_HELSEPERSONELL = "helsepersonell";
- public static final String CACHE_KODEVERK = "kodeverk";
- public static final String CACHE_KODEVERK_2 = "kodeverk2";
@Bean
@Profile({ "dev", "prod" })
@@ -29,9 +27,7 @@ public CacheManager cacheManager(Caffeine caffeine) {
var caffeineCacheManager = new CaffeineCacheManager(CACHE_BESTILLING,
CACHE_BRUKER,
CACHE_GRUPPE,
- CACHE_HELSEPERSONELL,
- CACHE_KODEVERK,
- CACHE_KODEVERK_2
+ CACHE_HELSEPERSONELL
);
caffeineCacheManager.setCaffeine(caffeine);
caffeineCacheManager.setAsyncCacheMode(true);
diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/config/Consumers.java b/apps/dolly-backend/src/main/java/no/nav/dolly/config/Consumers.java
index c9204dc8cdb..971e4b2caec 100644
--- a/apps/dolly-backend/src/main/java/no/nav/dolly/config/Consumers.java
+++ b/apps/dolly-backend/src/main/java/no/nav/dolly/config/Consumers.java
@@ -9,14 +9,6 @@
import static lombok.AccessLevel.PACKAGE;
-/**
- * Samler alle placeholders for ulike {@code consumers.*}-konfigurasjon her, dvs. subklasser av {@code ServerProperties}.
- *
- * Husk at Spring Boot bruker relaxed binding
- * mellom configuration properties og field names.
- *
- * @see ServerProperties
- */
@Configuration
@ConfigurationProperties(prefix = "consumers")
@NoArgsConstructor(access = PACKAGE)
@@ -34,10 +26,11 @@ public class Consumers {
private ServerProperties testnavInntektsmeldingService;
private ServerProperties testnavInntektstubProxy;
private ServerProperties testnavInstProxy;
- private ServerProperties kodeverkApi;
+ private ServerProperties testnavKodeverkService;
private ServerProperties testnavKontoregisterPersonProxy;
private ServerProperties testnavKrrstubProxy;
private ServerProperties testnavMedlProxy;
+ private ServerProperties testnavMiljoerService;
private ServerProperties testnavNorg2Proxy;
private ServerProperties testnavOrganisasjonForvalter;
private ServerProperties testnavOrganisasjonService;
@@ -50,7 +43,5 @@ public class Consumers {
private ServerProperties testnavSykemeldingApi;
private ServerProperties testnavSyntSykemeldingApi;
private ServerProperties testnavTpsMessagingService;
- private ServerProperties testnavMiljoerService;
private ServerProperties testnavUdistubProxy;
-
}
diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/KodeverkConsumer.java b/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/KodeverkConsumer.java
index 81bd759e76f..2a1d2ecd007 100644
--- a/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/KodeverkConsumer.java
+++ b/apps/dolly-backend/src/main/java/no/nav/dolly/consumer/kodeverk/KodeverkConsumer.java
@@ -2,42 +2,20 @@
import lombok.extern.slf4j.Slf4j;
import no.nav.dolly.config.Consumers;
-import no.nav.dolly.consumer.kodeverk.domain.KodeverkBetydningerResponse;
-import no.nav.dolly.metrics.Timed;
-import no.nav.testnav.libs.reactivecore.utils.WebClientFilter;
-import no.nav.testnav.libs.securitycore.config.UserConstant;
+import no.nav.dolly.consumer.kodeverk.command.KodeverkGetCommand;
+import no.nav.testnav.libs.dto.kodeverkservice.v1.KodeverkDTO;
import no.nav.testnav.libs.securitycore.domain.ServerProperties;
import no.nav.testnav.libs.standalone.servletsecurity.exchange.TokenExchange;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.http.HttpHeaders;
-import org.springframework.stereotype.Component;
-import org.springframework.web.reactive.function.client.ExchangeStrategies;
+import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClient;
-import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
-import reactor.util.retry.Retry;
-import java.time.Duration;
-import java.time.LocalDate;
import java.util.Map;
-import java.util.Map.Entry;
-import java.util.stream.Collectors;
-import static no.nav.dolly.config.CachingConfig.CACHE_KODEVERK_2;
-import static no.nav.dolly.domain.CommonKeysAndUtils.CONSUMER;
-import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CALL_ID;
-import static no.nav.dolly.domain.CommonKeysAndUtils.HEADER_NAV_CONSUMER_ID;
-import static no.nav.dolly.util.CallIdUtil.generateCallId;
-import static no.nav.dolly.util.TokenXUtil.getUserJwt;
-
-@Component
+@Service
@Slf4j
public class KodeverkConsumer {
- private static final String KODEVERK_URL_BEGINNING = "/api/v1/kodeverk";
- private static final String KODEVERK_URL_KODER = "koder";
- private static final String KODEVERK_URL_BETYDNINGER = "betydninger";
-
private final TokenExchange tokenService;
private final WebClient webClient;
private final ServerProperties serverProperties;
@@ -45,68 +23,21 @@ public class KodeverkConsumer {
public KodeverkConsumer(
TokenExchange tokenService,
Consumers consumers,
- WebClient.Builder webClientBuilder
- ) {
+ WebClient.Builder webClientBuilder) {
+
this.tokenService = tokenService;
- serverProperties = consumers.getKodeverkApi();
+ serverProperties = consumers.getTestnavKodeverkService();
this.webClient = webClientBuilder
- .exchangeStrategies(
- ExchangeStrategies
- .builder()
- .codecs(configurer -> configurer
- .defaultCodecs()
- .maxInMemorySize(32 * 1024 * 1024))
- .build())
.baseUrl(serverProperties.getUrl())
.build();
}
- private static String getNorskBokmaal(Entry> entry) {
-
- return entry.getValue().get(0).getBeskrivelser().get("nb").getTekst();
- }
-
- @Timed(name = "providers", tags = {"operation", "hentKodeverk"})
- public Flux fetchKodeverkByName(String kodeverk) {
-
- return getKodeverk(kodeverk);
- }
-
- @Cacheable(CACHE_KODEVERK_2)
- @Timed(name = "providers", tags = {"operation", "hentKodeverk"})
public Mono