use of no.nav.pto.veilarbportefolje.cv.dto.CVMelding in project veilarbportefolje by navikt.
the class CvServiceTest method skal_hente_fnr_fra_aktoertjenesten_om_fnr_mangler_i_melding.
@Test
void skal_hente_fnr_fra_aktoertjenesten_om_fnr_mangler_i_melding() {
String document = new JSONObject().put("aktoer_id", aktoerId.toString()).put("har_delt_cv", false).toString();
IndexResponse indexResponse = opensearchTestClient.createDocument(aktoerId, document);
assertThat(indexResponse.status().getStatus()).isEqualTo(201);
CVMelding cvMelding = new CVMelding();
cvMelding.setAktoerId(aktoerId);
cvMelding.setRessurs(Ressurs.CV_HJEMMEL);
cvService.behandleCVHjemmelMelding(cvMelding);
GetResponse getResponse = opensearchTestClient.fetchDocument(aktoerId);
assertThat(getResponse.isExists()).isTrue();
boolean harDeltCv = (boolean) getResponse.getSourceAsMap().get("har_delt_cv");
assertThat(harDeltCv).isTrue();
}
use of no.nav.pto.veilarbportefolje.cv.dto.CVMelding in project veilarbportefolje by navikt.
the class CvServiceTest method skal_ignorere_tilfeller_hvor_dokumentet_ikke_finnes_i_opensearch.
@Test
void skal_ignorere_tilfeller_hvor_dokumentet_ikke_finnes_i_opensearch() {
CVMelding cvMelding = new CVMelding();
cvMelding.setAktoerId(aktoerId);
cvMelding.setRessurs(Ressurs.CV_HJEMMEL);
cvService.behandleCVHjemmelMelding(cvMelding);
GetResponse getResponse = opensearchTestClient.fetchDocument(aktoerId);
assertThat(getResponse.isExists()).isFalse();
}
use of no.nav.pto.veilarbportefolje.cv.dto.CVMelding in project veilarbportefolje by navikt.
the class CvServiceKafkaConsumerTest method populateCVHjemmelKafkaTopic.
private void populateCVHjemmelKafkaTopic(AktorId... aktoerIds) throws ExecutionException, InterruptedException {
for (AktorId aktoerId : aktoerIds) {
CVMelding cvMelding = new CVMelding();
cvMelding.setAktoerId(aktoerId);
cvMelding.setRessurs(Ressurs.CV_HJEMMEL);
cvService.behandleCVHjemmelMelding(cvMelding);
}
}
Aggregations