Search in sources :

Example 6 with QuestionFromFkType

use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType in project webcert by sklintyg.

the class FKQuestionConverterTest 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();
}
Also used : StreamSource(javax.xml.transform.stream.StreamSource) QuestionFromFkType(se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType) JAXBContext(javax.xml.bind.JAXBContext) Unmarshaller(javax.xml.bind.Unmarshaller) ClassPathResource(org.springframework.core.io.ClassPathResource)

Example 7 with QuestionFromFkType

use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType in project webcert by sklintyg.

the class ReceiveQuestionResponderImplTest method createRequest.

private ReceiveMedicalCertificateQuestionType createRequest(String questionFile) {
    ReceiveMedicalCertificateQuestionType request = new ReceiveMedicalCertificateQuestionType();
    QuestionFromFkType question = inflateQuestion(questionFile);
    if (question == null) {
        throw new RuntimeException("Could not inflate file");
    }
    request.setQuestion(question);
    return request;
}
Also used : ReceiveMedicalCertificateQuestionType(se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionType) QuestionFromFkType(se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType)

Example 8 with QuestionFromFkType

use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType in project webcert by sklintyg.

the class QuestionAnswerValidatorTest method createValidQuestionRequest.

private ReceiveMedicalCertificateQuestionType createValidQuestionRequest() {
    ReceiveMedicalCertificateQuestionType request = new ReceiveMedicalCertificateQuestionType();
    try {
        JAXBContext jaxbContext = JAXBContext.newInstance(QuestionFromFkType.class);
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        QuestionFromFkType question = unmarshaller.unmarshal(new StreamSource(new ClassPathResource("QuestionAnswerValidator/valid-question-from-fk.xml").getInputStream()), QuestionFromFkType.class).getValue();
        request.setQuestion(question);
        return request;
    } catch (Exception e) {
        throw new RuntimeException("Failed to load QuestionRequest template");
    }
}
Also used : ReceiveMedicalCertificateQuestionType(se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionType) StreamSource(javax.xml.transform.stream.StreamSource) QuestionFromFkType(se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType) JAXBContext(javax.xml.bind.JAXBContext) Unmarshaller(javax.xml.bind.Unmarshaller) ClassPathResource(org.springframework.core.io.ClassPathResource)

Aggregations

QuestionFromFkType (se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.QuestionFromFkType)8 JAXBContext (javax.xml.bind.JAXBContext)5 Unmarshaller (javax.xml.bind.Unmarshaller)5 StreamSource (javax.xml.transform.stream.StreamSource)5 ClassPathResource (org.springframework.core.io.ClassPathResource)5 Test (org.junit.Test)2 ReceiveMedicalCertificateQuestionType (se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionType)2 FragaSvar (se.inera.intyg.webcert.persistence.fragasvar.model.FragaSvar)2 AnswerToFkType (se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificateanswerresponder.v1.AnswerToFkType)1 QuestionToFkType (se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificatequestionresponder.v1.QuestionToFkType)1