Search in sources :

Example 6 with ArendeAmne

use of se.inera.intyg.webcert.persistence.arende.model.ArendeAmne in project webcert by sklintyg.

the class ArendeListItemConverterTest method testConvertArende.

@Test
public void testConvertArende() {
    final ArendeAmne amne = ArendeAmne.KONTKT;
    final String intygsId = "intygsId";
    final String intygTyp = "luse";
    final String meddelandeId = "meddelandeId";
    final String patientPersonId = "patientPersonId";
    final String signeratAvName = "signeratAvName";
    final String skickatAv = "skickatAv";
    final LocalDateTime skickatTidpunkt = LocalDateTime.now();
    final Status status = Status.ANSWERED;
    final Boolean vidarebefordrad = Boolean.TRUE;
    final String enhetsnamn = "enhetsnamn";
    final String vardgivarnamn = "vardgivarnamn";
    Arende arende = createArende(amne, intygsId, intygTyp, meddelandeId, patientPersonId, signeratAvName, skickatAv, skickatTidpunkt, status, vidarebefordrad, enhetsnamn, vardgivarnamn);
    ArendeListItem result = ArendeListItemConverter.convert(arende);
    assertEquals(amne.name(), result.getAmne());
    assertEquals(intygsId, result.getIntygId());
    assertEquals(intygTyp, result.getIntygTyp());
    assertEquals(meddelandeId, result.getMeddelandeId());
    assertEquals(patientPersonId, result.getPatientId());
    assertEquals(signeratAvName, result.getSigneratAvNamn());
    assertEquals(skickatAv, result.getFragestallare());
    assertEquals(skickatTidpunkt, result.getReceivedDate());
    assertEquals(status, result.getStatus());
    assertEquals(true, result.isVidarebefordrad());
    assertEquals(enhetsnamn, result.getEnhetsnamn());
    assertEquals(vardgivarnamn, result.getVardgivarnamn());
}
Also used : LocalDateTime(java.time.LocalDateTime) Status(se.inera.intyg.webcert.persistence.model.Status) ArendeListItem(se.inera.intyg.webcert.web.web.controller.api.dto.ArendeListItem) ArendeAmne(se.inera.intyg.webcert.persistence.arende.model.ArendeAmne) Arende(se.inera.intyg.webcert.persistence.arende.model.Arende) Test(org.junit.Test)

Aggregations

ArendeAmne (se.inera.intyg.webcert.persistence.arende.model.ArendeAmne)6 LocalDateTime (java.time.LocalDateTime)4 Test (org.junit.Test)4 Arende (se.inera.intyg.webcert.persistence.arende.model.Arende)4 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)3 ArendeListItem (se.inera.intyg.webcert.web.web.controller.api.dto.ArendeListItem)2 LocalDate (java.time.LocalDate)1 Status (se.inera.intyg.webcert.persistence.model.Status)1 Signatur (se.inera.intyg.webcert.persistence.utkast.model.Signatur)1 Utkast (se.inera.intyg.webcert.persistence.utkast.model.Utkast)1 SendMessageToCareType (se.riv.clinicalprocess.healthcond.certificate.sendMessageToCare.v2.SendMessageToCareType)1