use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType in project webcert by sklintyg.
the class ReceiveQuestionResponderImplTest method inflateQuestion.
private QuestionFromFkType inflateQuestion(String filePath) {
try {
JAXBContext jaxbContext = JAXBContext.newInstance(QuestionFromFkType.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
QuestionFromFkType question = unmarshaller.unmarshal(new StreamSource(new ClassPathResource(filePath).getInputStream()), QuestionFromFkType.class).getValue();
return question;
} catch (Exception e) {
return null;
}
}
use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType in project webcert by sklintyg.
the class FKAnswerConverterTest method testConvertAnswer.
@Test
public void testConvertAnswer() throws Exception {
QuestionFromFkType questionFromFK = inflateQuestionFromFK();
AnswerToFkType referenceAnswerToFK = inflateAnswerToFK();
// convert QuestionFromFK to FragaSvar entity
FragaSvar fragaSvar = fragaSvarConverter.convert(questionFromFK);
// add some data
fragaSvar.setInternReferens(321L);
fragaSvar.setSvarsText(fragaSvar.getFrageText());
fragaSvar.setSvarSigneringsDatum(fragaSvar.getFrageSigneringsDatum());
// convert FragaSvar entity to AnswerToFK
AnswerToFkType convertedAnswerToFK = FKAnswerConverter.convert(fragaSvar);
// compare convertedAnswerToFK to reference
String expected = jaxbToXml(referenceAnswerToFK);
String actual = jaxbToXml(convertedAnswerToFK);
assertEquals(expected, actual);
}
use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType in project webcert by sklintyg.
the class FKAnswerConverterTest method inflateQuestionFromFK.
private QuestionFromFkType inflateQuestionFromFK() throws Exception {
JAXBContext jaxbContext = JAXBContext.newInstance(QuestionFromFkType.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
return unmarshaller.unmarshal(new StreamSource(new ClassPathResource("FragaSvarConverterTest/question.xml").getInputStream()), QuestionFromFkType.class).getValue();
}
use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType in project webcert by sklintyg.
the class FKQuestionConverterTest method testConvertQuestion.
@Test
public void testConvertQuestion() throws Exception {
QuestionFromFkType questionFromFK = inflateQuestionFromFK();
QuestionToFkType referenceQuestionToFK = inflateQuestionToFK();
// convert QuestionFromFK to FragaSvar entity
FragaSvar fragaSvar = fragaSvarConverter.convert(questionFromFK);
// add some data
fragaSvar.setAmne(Amne.KONTAKT);
fragaSvar.setInternReferens(321L);
// convert fragaSvar entity to QuestionToFK
QuestionToFkType convertedQuestionToFK = FKQuestionConverter.convert(fragaSvar);
// compare convertedQuestionToFK to reference
String expected = jaxbToXml(referenceQuestionToFK);
String actual = jaxbToXml(convertedQuestionToFK);
assertEquals(expected, actual);
}
use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType in project webcert by sklintyg.
the class FragaSvarConverterTest method question.
private QuestionFromFkType question(String fileName) throws Exception {
JAXBContext jaxbContext = JAXBContext.newInstance(QuestionFromFkType.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
return unmarshaller.unmarshal(new StreamSource(new ClassPathResource(fileName).getInputStream()), QuestionFromFkType.class).getValue();
}
Aggregations