Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5930: Fjern toggle melosys.eessi.identrekvisisjon #588

Merged
merged 5 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import io.getunleash.Unleash;
import no.nav.melosys.eessi.identifisering.BucIdentifisertService;
import no.nav.melosys.eessi.identifisering.FnrUtils;
import no.nav.melosys.eessi.identifisering.PersonIdentifisering;
Expand Down Expand Up @@ -46,16 +45,11 @@ public class SedMottakService {
private final PersonIdentifisering personIdentifisering;
private final BucIdentifisertService bucIdentifisertService;

private final Unleash unleash;


@Value("${rina.institusjon-id}")
private String rinaInstitusjonsId;

@Transactional
public void behandleSedMottakHendelse(SedMottattHendelse sedMottattHendelse) {
//TODO: Fjern loglinje for testing av unleash next
log.info("melosys.eessi.identrekvisisjon togglestatus:" + unleash.isEnabled("melosys.eessi.identrekvisisjon"));
if (sedMottattHendelse.getSedHendelse().erX100()) {
log.info("Ignorerer mottatt SED {} av typen X100", sedMottattHendelse.getSedHendelse().getSedId());
return;
Expand Down Expand Up @@ -139,11 +133,9 @@ private void opprettOgLagreIdentifiseringsoppgave(SedMottattHendelse sedMottattH
}

private String opprettOgLagreIndentifiseringsoppgave(SedMottattHendelse sedMottattHendelse, SED sed, String journalpostID) {
boolean identRekvisisjonEnabled = unleash.isEnabled("melosys.eessi.identrekvisisjon");
IsaSalemHame marked this conversation as resolved.
Show resolved Hide resolved

var personFraSed = sed.finnPerson().orElse(null);

if (personFraSed != null && !harNorskPersonnummer(personFraSed) && identRekvisisjonEnabled) {
if (personFraSed != null && !harNorskPersonnummer(personFraSed)) {
var identRekvisjonTilMellomlagring = IdentRekvisisjonTilMellomlagringMapper.byggIdentRekvisisjonTilMellomlagring(sedMottattHendelse, sed);

String lenkeForRekvirering = personFasade.opprettLenkeForRekvirering(identRekvisjonTilMellomlagring);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.Optional;
import java.util.Set;

import io.getunleash.FakeUnleash;
import no.nav.melosys.eessi.identifisering.BucIdentifisertService;
import no.nav.melosys.eessi.identifisering.PersonIdentifisering;
import no.nav.melosys.eessi.integration.oppgave.HentOppgaveDto;
Expand Down Expand Up @@ -61,9 +60,6 @@ class SedMottakServiceTest {

private SedMottakService sedMottakService;

private final FakeUnleash fakeUnleash = new FakeUnleash();


private static final String IDENT = "1122334455";
private static final String SED_ID = "555554444";
private static final String RINA_SAKSNUMMER = "12313213";
Expand All @@ -80,14 +76,12 @@ public void setup() throws Exception {
journalpostSedKoblingService,
sedMetrikker,
personIdentifisering,
bucIdentifisertService,
fakeUnleash
bucIdentifisertService
);
}

@Test
void behandleSed_finnerIkkePerson_OppgaveOpprettes() {
fakeUnleash.disableAll();
when(euxService.hentSedMedRetry(anyString(), anyString()))
.thenReturn(opprettSED());
when(sedMottattHendelseRepository.save(any(SedMottattHendelse.class))).then(returnsFirstArg());
Expand All @@ -106,15 +100,14 @@ void behandleSed_finnerIkkePerson_OppgaveOpprettes() {
verify(euxService).hentSedMedRetry(anyString(), anyString());
verify(personIdentifisering).identifiserPerson(any(), any());
verify(opprettInngaaendeJournalpostService).arkiverInngaaendeSedUtenBruker(any(), any(), any());
verify(oppgaveService).opprettOppgaveTilIdOgFordeling(anyString(), anyString(), anyString());
verify(oppgaveService).opprettOppgaveTilIdOgFordeling(anyString(), anyString(), anyString(), any());
verify(sedMottattHendelseRepository, times(2)).save(any());
verify(bucIdentifisertService, never()).lagreIdentifisertPerson(anyString(), anyString());
}


@Test
void behandleSed_finnerIkkePerson_oppgaveOpprettesNårIkkeASed() {
fakeUnleash.disableAll();
when(euxService.hentSedMedRetry(anyString(), anyString()))
.thenReturn(opprettSED());
when(sedMottattHendelseRepository.save(any(SedMottattHendelse.class))).then(returnsFirstArg());
Expand Down Expand Up @@ -256,6 +249,7 @@ private SedHendelse sedHendelseMedBruker() {
private SedHendelse sedHendelseUtenBruker() {
SedHendelse sedHendelse = new SedHendelse();
sedHendelse.setNavBruker("ukjent");
sedHendelse.setAvsenderId("SE:12345");
sedHendelse.setRinaSakId(RINA_SAKSNUMMER);
sedHendelse.setRinaDokumentId("456");
sedHendelse.setSedId(SED_ID);
Expand Down
Loading