use of se.inera.intyg.common.util.integration.json.CustomObjectMapper 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.util.integration.json.CustomObjectMapper 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.util.integration.json.CustomObjectMapper 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.util.integration.json.CustomObjectMapper in project webcert by sklintyg.
the class IntegreradeEnheterBootstrapBean method addIntegreradEnhet.
private void addIntegreradEnhet(Resource res) {
try {
IntegreradEnhet integreradEnhet = new CustomObjectMapper().readValue(res.getInputStream(), IntegreradEnhet.class);
integreradEnhet.setSkapadDatum(LocalDateTime.now());
integreradEnhetRepository.save(integreradEnhet);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
use of se.inera.intyg.common.util.integration.json.CustomObjectMapper in project webcert by sklintyg.
the class FragaSvarConverterTest method compareObjectWithReferenceFile.
private void compareObjectWithReferenceFile(Object object, String fileName) throws IOException {
ObjectMapper objectMapper = new CustomObjectMapper();
JsonNode tree = objectMapper.valueToTree(object);
JsonNode expectedTree = objectMapper.readTree(new ClassPathResource(fileName).getInputStream());
assertEquals("JSON does not match expectation. Resulting JSON is \n" + tree.toString() + "\n", expectedTree, tree);
}
Aggregations