Search in sources :

Example 16 with Fnr

use of no.nav.common.types.identer.Fnr in project veilarbportefolje by navikt.

the class BrukerRepositoryTest method skalHenteFnrForPersonIdFraDatabase.

@Test
public void skalHenteFnrForPersonIdFraDatabase() throws Exception {
    PersonId personId = PersonId.of("123456");
    Fnr expectedFnr = Fnr.ofValidFnr("12345678900");
    insertOppfolgingsbrukerForPersonIdToFnrMapping(expectedFnr, personId);
    Try<Fnr> result = brukerRepository.retrieveFnrFromPersonid(personId);
    assertTrue(result.isSuccess());
    assertEquals(expectedFnr, result.get());
}
Also used : PersonId(no.nav.pto.veilarbportefolje.domene.value.PersonId) TestDataUtils.randomPersonId(no.nav.pto.veilarbportefolje.util.TestDataUtils.randomPersonId) Fnr(no.nav.common.types.identer.Fnr) TestDataUtils.randomFnr(no.nav.pto.veilarbportefolje.util.TestDataUtils.randomFnr) Test(org.junit.Test)

Example 17 with Fnr

use of no.nav.common.types.identer.Fnr in project veilarbportefolje by navikt.

the class AktivitetDAOTest method skalHenteBrukertiltakForListeAvFnr.

@Test
public void skalHenteBrukertiltakForListeAvFnr() {
    Fnr fnr1 = Fnr.ofValidFnr("11111111111");
    Fnr fnr2 = Fnr.ofValidFnr("22222222222");
    List<Brukertiltak> brukertiltak = aktivitetDAO.hentBrukertiltak(asList(fnr1, fnr2));
    assertThat(brukertiltak.get(0).getTiltak().equals("T1")).isTrue();
    assertThat(brukertiltak.get(1).getTiltak().equals("T2")).isTrue();
    assertThat(brukertiltak.get(2).getTiltak().equals("T1")).isTrue();
}
Also used : Brukertiltak(no.nav.pto.veilarbportefolje.arenapakafka.aktiviteter.Brukertiltak) Fnr(no.nav.common.types.identer.Fnr) Test(org.junit.Test) BrukerRepositoryTest(no.nav.pto.veilarbportefolje.database.BrukerRepositoryTest)

Example 18 with Fnr

use of no.nav.common.types.identer.Fnr in project veilarbportefolje by navikt.

the class PersonRepositoryTest method skalHentePersonifoForFnr.

@Test
void skalHentePersonifoForFnr() {
    Fnr fnr = TestDataUtils.randomFnr();
    SqlUtils.insert(jdbcTemplate, "OPPFOLGINGSBRUKER").value("PERSON_ID", 11111).value("FODSELSNR", fnr.toString()).value("SIKKERHETSTILTAK_TYPE_KODE", "FYUS").value("SPERRET_ANSATT", "J").execute();
    Personinfo personinfo = personRepository.hentPersoninfoForFnr(fnr).get();
    assertThat(personinfo.getSikkerhetstiltak()).isEqualTo(Personinfo.kodeTilBeskrivelse.get("FYUS"));
    assertThat(personinfo.isEgenAnsatt()).isTrue();
}
Also used : Fnr(no.nav.common.types.identer.Fnr) Personinfo(no.nav.pto.veilarbportefolje.domene.Personinfo) Test(org.junit.jupiter.api.Test) ApplicationConfigTest(no.nav.pto.veilarbportefolje.config.ApplicationConfigTest) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 19 with Fnr

use of no.nav.common.types.identer.Fnr in project veilarbportefolje by navikt.

the class FnrTest method skalReturnereStreng.

@Test
public void skalReturnereStreng() throws Exception {
    String expected = "12345678900";
    Fnr fnr = Fnr.ofValidFnr(expected);
    String result = fnr.toString();
    assertEquals(expected, result);
}
Also used : Fnr(no.nav.common.types.identer.Fnr) Test(org.junit.Test)

Example 20 with Fnr

use of no.nav.common.types.identer.Fnr in project veilarbportefolje by navikt.

the class FnrTest method skalSammenligneBasertPaaVerdi.

@Test
public void skalSammenligneBasertPaaVerdi() throws Exception {
    String fnr = "12345678900";
    Fnr fnr1 = Fnr.ofValidFnr(fnr);
    Fnr fnr2 = Fnr.ofValidFnr(fnr);
    assertEquals(fnr1, fnr2);
}
Also used : Fnr(no.nav.common.types.identer.Fnr) Test(org.junit.Test)

Aggregations

Fnr (no.nav.common.types.identer.Fnr)22 AktorId (no.nav.common.types.identer.AktorId)10 PersonId (no.nav.pto.veilarbportefolje.domene.value.PersonId)8 TestDataUtils.randomFnr (no.nav.pto.veilarbportefolje.util.TestDataUtils.randomFnr)7 Test (org.junit.Test)7 AktorClient (no.nav.pto.veilarbportefolje.domene.AktorClient)6 TestDataUtils.randomPersonId (no.nav.pto.veilarbportefolje.util.TestDataUtils.randomPersonId)6 List (java.util.List)5 Slf4j (lombok.extern.slf4j.Slf4j)5 VeilederId (no.nav.pto.veilarbportefolje.domene.value.VeilederId)5 Try (io.vavr.control.Try)4 Validation (io.vavr.control.Validation)4 String.format (java.lang.String.format)4 Timestamp (java.sql.Timestamp)4 ArrayList (java.util.ArrayList)4 AuthUtils (no.nav.pto.veilarbportefolje.auth.AuthUtils)4 BrukerService (no.nav.pto.veilarbportefolje.service.BrukerService)4 ValideringsRegler (no.nav.pto.veilarbportefolje.util.ValideringsRegler)4 Autowired (org.springframework.beans.factory.annotation.Autowired)4 Instant (java.time.Instant)3