use of se.inera.intyg.common.support.modules.support.api.dto.CertificateMetaData in project webcert by sklintyg.
the class UtkastIntygDecoratorTest method buildCertificateMetaData.
private CertificateMetaData buildCertificateMetaData() {
CertificateMetaData metaData = new CertificateMetaData();
metaData.setStatus(new ArrayList<Status>());
Status statusSigned = new Status(CertificateState.RECEIVED, "FKASSA", LocalDateTime.now());
metaData.getStatus().add(statusSigned);
return metaData;
}
use of se.inera.intyg.common.support.modules.support.api.dto.CertificateMetaData in project webcert by sklintyg.
the class AbstractIntygServiceTest method setupMocks.
@Before
public void setupMocks() throws Exception {
json = FileUtils.getStringFromFile(new ClassPathResource("IntygServiceTest/utlatande.json").getFile());
utlatande = objectMapper.readValue(json, Fk7263Utlatande.class);
CertificateMetaData metaData = buildCertificateMetaData();
certificateResponse = new CertificateResponse(json, utlatande, metaData, false);
when(moduleFacade.getCertificate(any(String.class), any(String.class))).thenReturn(certificateResponse);
when(certificateRelationService.getNewestRelationOfType(anyString(), any(RelationKod.class), any(List.class))).thenReturn(Optional.empty());
when(intygRelationHelper.getRelationsForIntyg(anyString())).thenReturn(new Relations());
when(patientDetailsResolver.resolvePatient(any(Personnummer.class), anyString())).thenReturn(buildPatient(false, false));
when(moduleRegistry.getModuleApi(anyString())).thenReturn(moduleApi);
when(moduleApi.getUtlatandeFromJson(anyString())).thenReturn(new Fk7263Utlatande());
when(moduleApi.updateBeforeSave(anyString(), any(Patient.class))).thenReturn("MODEL");
}
use of se.inera.intyg.common.support.modules.support.api.dto.CertificateMetaData in project webcert by sklintyg.
the class IntygServiceRevokeTest method setupMocks.
@Override
@Before
public void setupMocks() throws Exception {
json = FileUtils.getStringFromFile(new ClassPathResource("IntygServiceTest/utlatande.json").getFile());
utlatande = objectMapper.readValue(json, Fk7263Utlatande.class);
CertificateMetaData metaData = buildCertificateMetaData();
certificateResponse = new CertificateResponse(json, utlatande, metaData, false);
when(moduleFacade.getCertificate(any(String.class), any(String.class))).thenReturn(certificateResponse);
when(intygRelationHelper.getRelationsForIntyg(anyString())).thenReturn(new Relations());
when(patientDetailsResolver.resolvePatient(any(Personnummer.class), anyString())).thenReturn(buildPatient(false, false));
when(moduleRegistry.getModuleApi(anyString())).thenReturn(moduleApi);
when(moduleApi.getUtlatandeFromJson(anyString())).thenReturn(new Fk7263Utlatande());
when(moduleApi.updateBeforeSave(anyString(), any(Patient.class))).thenReturn("MODEL");
}
use of se.inera.intyg.common.support.modules.support.api.dto.CertificateMetaData in project webcert by sklintyg.
the class IntygServiceTest method setupIntygstjanstResponse.
@Before
public void setupIntygstjanstResponse() throws Exception {
vardpersonReferens = new VardpersonReferens();
vardpersonReferens.setHsaId(HSA_ID);
vardpersonReferens.setNamn(CREATED_BY_NAME);
json = FileUtils.getStringFromFile(new ClassPathResource("IntygServiceTest/utlatande.json").getFile());
Fk7263Utlatande utlatande = objectMapper.readValue(json, Fk7263Utlatande.class);
CertificateMetaData metaData = new CertificateMetaData();
metaData.setStatus(new ArrayList<>());
CertificateResponse certificateResponse = new CertificateResponse(json, utlatande, metaData, false);
when(moduleFacade.getCertificate(any(String.class), any(String.class))).thenReturn(certificateResponse);
when(moduleFacade.getUtlatandeFromInternalModel(anyString(), anyString())).thenReturn(utlatande);
}
Aggregations