Skip to content

Commit fe224fe

Browse files
Fjerner feature toggle stopp_opensearch_indeksering
1 parent d488979 commit fe224fe

File tree

6 files changed

+7
-31
lines changed

6 files changed

+7
-31
lines changed

src/main/java/no/nav/pto/veilarbportefolje/config/FeatureToggle.java

-6
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,13 @@ private FeatureToggle() {
1313
public static final String KAFKA_AIVEN_CONSUMERS_STOP = "veilarbportefolje.kafka_aiven_consumers_stop";
1414
public static final String KAFKA_SISTE_14A_STOP = "veilarbportefolje.kafka_siste_14a_stop";
1515
public static final String BRUK_FILTER_FOR_BRUKERINNSYN_TILGANGER = "veilarbportefolje.bruk_filter_for_brukerinnsyn_tilganger";
16-
public static final String STOPP_OPENSEARCH_INDEKSERING = "veilarbportefolje.stopp_opensearch_indeksering";
1716
public static final String STOPP_KONSUMERING_FRA_PORTEFOLJE_HENDELSESFILTER_TOPIC = "veilarbportefolje.stopp_konsumering_fra_portefolje_hendelsesfilter_topic";
1817

1918
public static boolean brukAvAliasIndeksering(DefaultUnleash defaultUnleash) {
2019
return defaultUnleash.isEnabled(FeatureToggle.ALIAS_INDEKSERING);
2120
}
2221

23-
2422
public static boolean brukFilterForBrukerinnsynTilganger(DefaultUnleash defaultUnleash) {
2523
return defaultUnleash.isEnabled(FeatureToggle.BRUK_FILTER_FOR_BRUKERINNSYN_TILGANGER);
2624
}
27-
28-
public static boolean stoppOpensearchIndeksering(DefaultUnleash defaultUnleash) {
29-
return defaultUnleash.isEnabled(FeatureToggle.STOPP_OPENSEARCH_INDEKSERING);
30-
}
3125
}

src/main/java/no/nav/pto/veilarbportefolje/persononinfo/PdlBrukerdataKafkaService.java

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package no.nav.pto.veilarbportefolje.persononinfo;
22

3-
import io.getunleash.DefaultUnleash;
43
import lombok.RequiredArgsConstructor;
54
import lombok.SneakyThrows;
65
import lombok.extern.slf4j.Slf4j;
76
import no.nav.common.types.identer.AktorId;
87
import no.nav.common.types.identer.Fnr;
9-
import no.nav.pto.veilarbportefolje.config.FeatureToggle;
108
import no.nav.pto.veilarbportefolje.kafka.KafkaCommonNonKeyedConsumerService;
119
import no.nav.pto.veilarbportefolje.opensearch.OpensearchIndexer;
1210
import no.nav.pto.veilarbportefolje.opensearch.OpensearchIndexerV2;
@@ -39,7 +37,6 @@ public class PdlBrukerdataKafkaService extends KafkaCommonNonKeyedConsumerServic
3937
private final BarnUnder18AarService barnUnder18AarService;
4038
private final OpensearchIndexer opensearchIndexer;
4139
private final OpensearchIndexerV2 opensearchIndexerV2;
42-
private final DefaultUnleash defaultUnleash;
4340

4441
@Override
4542
@SneakyThrows
@@ -60,14 +57,11 @@ public void behandleKafkaMeldingLogikk(PdlDokument pdlDokument) {
6057
if (pdlIdentRepository.harAktorIdUnderOppfolging(aktorIder)) {
6158
AktorId aktivAktorId = hentAktivAktor(pdlIdenter);
6259
secureLog.info("Det oppsto en PDL endring aktoer: {}", aktivAktorId);
63-
6460
handterIdentEndring(pdlIdenter);
6561

6662
handterBrukerDataEndring(pdlDokument.getHentPerson(), pdlIdenter);
6763

68-
if (!FeatureToggle.stoppOpensearchIndeksering(defaultUnleash)) {
69-
oppdaterOpensearch(aktivAktorId, pdlIdenter);
70-
}
64+
oppdaterOpensearch(aktivAktorId, pdlIdenter);
7165
}
7266

7367
if (barnUnder18AarService.erFnrBarnAvForelderUnderOppfolging(fnrs)) {
@@ -77,7 +71,6 @@ public void behandleKafkaMeldingLogikk(PdlDokument pdlDokument) {
7771

7872
handterBarnEndring(pdlDokument.getHentPerson(), pdlIdenter);
7973

80-
if (!FeatureToggle.stoppOpensearchIndeksering(defaultUnleash)) {
8174
List<Fnr> foreldreTilBarn = barnUnder18AarService.finnForeldreTilBarn(aktivtFnr);
8275

8376
foreldreTilBarn.forEach(fnrForelder -> {
@@ -89,7 +82,6 @@ public void behandleKafkaMeldingLogikk(PdlDokument pdlDokument) {
8982
}
9083
}
9184
);
92-
}
9385
}
9486
}
9587

src/test/java/no/nav/pto/veilarbportefolje/persononinfo/BarnUnder18AarTest/BarnUnder18AarKafkaTest.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.fasterxml.jackson.core.JsonProcessingException;
44
import com.fasterxml.jackson.databind.ObjectMapper;
55
import com.github.tomakehurst.wiremock.WireMockServer;
6-
import io.getunleash.DefaultUnleash;
76
import no.nav.common.client.pdl.PdlClientImpl;
87
import no.nav.common.types.identer.AktorId;
98
import no.nav.common.types.identer.Fnr;
@@ -65,8 +64,6 @@ public class BarnUnder18AarKafkaTest {
6564
private final String pdlDokumentBarn1MedDiskresjonskodeAsString = readFileAsJsonString("/PDL_Files/pdl_dokument_barn1_med_diskresjonskode.json", getClass());
6665
private final JdbcTemplate db;
6766

68-
@MockBean
69-
private DefaultUnleash defaultUnleash;
7067
private final WireMockServer server = new WireMockServer();
7168

7269

@@ -107,8 +104,7 @@ public void setup() {
107104
new BrukerServiceV2(this.pdlIdentRepository, this.oppfolgingsbrukerRepositoryV3, this.oppfolgingRepositoryV2),
108105
this.barnUnder18AarService,
109106
opensearchIndexer,
110-
opensearchIndexerV2,
111-
defaultUnleash
107+
opensearchIndexerV2
112108
);
113109
}
114110

src/test/java/no/nav/pto/veilarbportefolje/persononinfo/BarnUnder18AarTest/BarnUnder18AarMisterForeldreansvarTest.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import com.fasterxml.jackson.core.JsonProcessingException;
44
import com.fasterxml.jackson.databind.ObjectMapper;
55
import com.github.tomakehurst.wiremock.WireMockServer;
6-
import io.getunleash.DefaultUnleash;
76
import no.nav.common.client.pdl.PdlClientImpl;
87
import no.nav.common.types.identer.AktorId;
98
import no.nav.common.types.identer.Fnr;
@@ -65,9 +64,6 @@ public class BarnUnder18AarMisterForeldreansvarTest {
6564
private final String pdlDokumentIngenBarn = readFileAsJsonString("/PDL_Files/pdl_dokument_ingen_barn.json", getClass());
6665
private final JdbcTemplate db;
6766

68-
@MockBean
69-
private DefaultUnleash defaultUnleash;
70-
7167
private final WireMockServer server = new WireMockServer();
7268

7369

@@ -94,7 +90,7 @@ public void setup() {
9490

9591
server.start();
9692

97-
PdlPortefoljeClient pdlPortefoljeClient = new PdlPortefoljeClient(new PdlClientImpl("http://localhost:" + server.port(), () -> "SYSTEM_TOKEN"));
93+
PdlPortefoljeClient pdlPortefoljeClient = new PdlPortefoljeClient(new PdlClientImpl("http://localhost:" + server.port(), () -> "SYSTEM_TOKEN", "B555"));
9894

9995

10096
barnUnder18AarService = new BarnUnder18AarService(barnUnder18AarRepository, pdlPortefoljeClient);
@@ -108,8 +104,7 @@ public void setup() {
108104
new BrukerServiceV2(this.pdlIdentRepository, this.oppfolgingsbrukerRepositoryV3, this.oppfolgingRepositoryV2),
109105
this.barnUnder18AarService,
110106
opensearchIndexer,
111-
opensearchIndexerV2,
112-
defaultUnleash
107+
opensearchIndexerV2
113108
);
114109
}
115110

src/test/java/no/nav/pto/veilarbportefolje/persononinfo/PDLPersonBarnTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import org.junit.jupiter.api.AfterEach;
1414
import org.junit.jupiter.api.BeforeEach;
1515
import org.junit.jupiter.api.Test;
16-
import org.springframework.beans.factory.annotation.Autowired;
16+
import org.springframework.boot.test.mock.mockito.MockBean;
1717
import org.springframework.jdbc.core.JdbcTemplate;
1818

1919
import java.time.LocalDate;
@@ -33,7 +33,7 @@ public class PDLPersonBarnTest {
3333
private final JdbcTemplate db;
3434
private final PdlPersonRepository pdlPersonRepository;
3535

36-
@Autowired
36+
@MockBean
3737
private PdlPortefoljeClient mockedPdlPortefoljeClient;
3838

3939
private PdlService pdlService;

src/test/java/no/nav/pto/veilarbportefolje/persononinfo/PdlBrukerdataKafkaServiceTest.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public PdlBrukerdataKafkaServiceTest() throws JsonProcessingException {
7575
new BrukerServiceV2(pdlIdentRepository, oppfolgingsbrukerRepositoryV3, oppfolgingRepositoryV2),
7676
barnUnder18AarService,
7777
opensearchIndexer,
78-
opensearchIndexerV2,
79-
mockUnleash
78+
opensearchIndexerV2
8079
);
8180
}
8281

0 commit comments

Comments
 (0)