use of se.inera.intyg.common.support.model.Status in project webcert by sklintyg.
the class CopyCompletionUtkastBuilderTest method createIntygContentHolder.
private IntygContentHolder createIntygContentHolder() throws Exception {
List<Status> status = new ArrayList<>();
status.add(new Status(CertificateState.RECEIVED, "HSVARD", LocalDateTime.now()));
status.add(new Status(CertificateState.SENT, "FKASSA", LocalDateTime.now()));
Fk7263Utlatande utlatande = new CustomObjectMapper().readValue(new ClassPathResource("IntygDraftServiceImplTest/utlatande.json").getFile(), Fk7263Utlatande.class);
return IntygContentHolder.builder().setContents("<external-json/>").setUtlatande(utlatande).setStatuses(status).setRevoked(false).setRelations(new Relations()).setDeceased(false).setSekretessmarkering(false).setPatientNameChangedInPU(false).setPatientAddressChangedInPU(false).build();
}
use of se.inera.intyg.common.support.model.Status in project webcert by sklintyg.
the class CreateRenewalCopyUtkastBuilderImplTest method createIntygContentHolder.
private IntygContentHolder createIntygContentHolder() throws Exception {
List<Status> status = new ArrayList<>();
status.add(new Status(CertificateState.RECEIVED, "HSVARD", LocalDateTime.now()));
status.add(new Status(CertificateState.SENT, "FKASSA", LocalDateTime.now()));
Fk7263Utlatande utlatande = new CustomObjectMapper().readValue(new ClassPathResource("IntygDraftServiceImplTest/utlatande.json").getFile(), Fk7263Utlatande.class);
return IntygContentHolder.builder().setContents("<external-json/>").setUtlatande(utlatande).setStatuses(status).setRevoked(false).setRelations(new Relations()).setDeceased(false).setSekretessmarkering(false).setPatientNameChangedInPU(false).setPatientAddressChangedInPU(false).build();
}
use of se.inera.intyg.common.support.model.Status in project webcert by sklintyg.
the class CreateUtkastFromTemplateBuilderTest method createIntygContentHolder.
private IntygContentHolder createIntygContentHolder() throws Exception {
List<Status> status = new ArrayList<>();
status.add(new Status(CertificateState.RECEIVED, "HSVARD", LocalDateTime.now()));
status.add(new Status(CertificateState.SENT, "SKV", LocalDateTime.now()));
DbUtlatande utlatande = new CustomObjectMapper().readValue(new ClassPathResource("IntygDraftServiceImplTest/db-utlatande.json").getFile(), DbUtlatande.class);
return IntygContentHolder.builder().setContents("<external-json/>").setUtlatande(utlatande).setStatuses(status).setRevoked(false).setRelations(new Relations()).setDeceased(false).setSekretessmarkering(false).setPatientNameChangedInPU(false).setPatientAddressChangedInPU(false).build();
}
use of se.inera.intyg.common.support.model.Status in project webcert by sklintyg.
the class IntygModuleFacadeTest method testConvertFromInternalToPdfDocumentEmployer.
@SuppressWarnings("unchecked")
@Test
public void testConvertFromInternalToPdfDocumentEmployer() throws IntygModuleFacadeException, ModuleException {
byte[] pdfData = "PDFDATA".getBytes();
PdfResponse pdfResp = new PdfResponse(pdfData, "file.pdf");
when(moduleApi.pdfEmployer(anyString(), anyList(), any(ApplicationOrigin.class), anyList(), eq(false))).thenReturn(pdfResp);
IntygPdf intygPdf = moduleFacade.convertFromInternalToPdfDocument(CERTIFICATE_TYPE, INT_JSON, Arrays.asList(new Status(CertificateState.RECEIVED, "", LocalDateTime.now())), true);
assertNotNull(intygPdf.getPdfData());
assertEquals("file.pdf", intygPdf.getFilename());
verify(moduleApi).pdfEmployer(anyString(), anyList(), eq(ApplicationOrigin.WEBCERT), anyList(), eq(false));
}
use of se.inera.intyg.common.support.model.Status in project webcert by sklintyg.
the class IntygModuleFacadeTest method testConvertFromInternalToPdfDocumentModuleException.
@SuppressWarnings("unchecked")
@Test(expected = IntygModuleFacadeException.class)
public void testConvertFromInternalToPdfDocumentModuleException() throws IntygModuleFacadeException, ModuleException {
when(moduleApi.pdf(anyString(), anyList(), any(ApplicationOrigin.class), eq(false))).thenThrow(new ModuleException(""));
moduleFacade.convertFromInternalToPdfDocument(CERTIFICATE_TYPE, INT_JSON, Arrays.asList(new Status(CertificateState.RECEIVED, "", LocalDateTime.now())), false);
}
Aggregations