use of se.inera.intyg.common.util.integration.json.CustomObjectMapper in project webcert by sklintyg.
the class ArendeViewConverterTest method convertToJson.
@Test
public void convertToJson() throws JsonGenerationException, JsonMappingException, IOException {
Arende arende = buildArende("lisjp");
StringWriter jsonWriter = new StringWriter();
CustomObjectMapper objectMapper = new CustomObjectMapper();
objectMapper.writeValue(jsonWriter, arende);
}
use of se.inera.intyg.common.util.integration.json.CustomObjectMapper in project webcert by sklintyg.
the class IntygResource method updateUtkastForSend.
private void updateUtkastForSend(@PathParam("id") String id) {
Utkast utkast = utkastRepository.findOne(id);
if (utkast != null) {
utkast.setStatus(UtkastStatus.SIGNED);
Utlatande utlatande = moduleFacade.getUtlatandeFromInternalModel(utkast.getIntygsTyp(), utkast.getModel());
utlatande.getGrundData().setSigneringsdatum(LocalDateTime.now());
try {
CustomObjectMapper mapper = new CustomObjectMapper();
StringWriter writer = new StringWriter();
mapper.writeValue(writer, utlatande);
utkast.setModel(writer.toString());
} catch (IOException e) {
LOG.error("Could not update the model of the utkast. Failed with message ", e.getMessage());
}
if (utkast.getSignatur() == null) {
Signatur sig = new Signatur(LocalDateTime.now(), "", id, "", "", "");
utkast.setSignatur(sig);
}
utkast.setSkickadTillMottagare("FKASSA");
utkast.setSkickadTillMottagareDatum(LocalDateTime.now());
utkastRepository.save(utkast);
}
}
use of se.inera.intyg.common.util.integration.json.CustomObjectMapper in project webcert by sklintyg.
the class FragaSvarBootstrapBean method addFragaSvar.
private void addFragaSvar(Resource res) {
try {
FragaSvar fragaSvar = new CustomObjectMapper().readValue(res.getInputStream(), FragaSvar.class);
fragaSvarRepository.save(fragaSvar);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
use of se.inera.intyg.common.util.integration.json.CustomObjectMapper in project webcert by sklintyg.
the class IntygServiceConfigurationManagerTest method setup.
@Before
public void setup() {
configurationManager = new IntygServiceConfigurationManagerImpl();
configurationManager.setObjectMapper(new CustomObjectMapper());
}
use of se.inera.intyg.common.util.integration.json.CustomObjectMapper in project webcert by sklintyg.
the class MailNotificationServiceTest method setupTestlandVardgivare.
@PostConstruct
public void setupTestlandVardgivare() throws IOException {
Vardgivare vardgivare = new CustomObjectMapper().readValue(new ClassPathResource("MailNotificationServiceTest/landstinget-testland.json").getFile(), Vardgivare.class);
hsaStub.getVardgivare().add(vardgivare);
}
Aggregations