use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionType in project webcert by sklintyg.
the class QuestionAnswerValidatorTest method testQVCatchesMissingHsaPersonIdExtension.
@Test
public void testQVCatchesMissingHsaPersonIdExtension() {
// Arrange
ReceiveMedicalCertificateQuestionType request = createValidQuestionRequest();
request.getQuestion().getAdressVard().getHosPersonal().getPersonalId().setExtension(null);
// Act
final List<String> result = QuestionAnswerValidator.validate(request);
// Assert
assertEquals(1, result.size());
}
use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionType in project webcert by sklintyg.
the class QuestionAnswerValidatorTest method testQVCatchesInvalidHsaPersonIdRoot.
@Test
public void testQVCatchesInvalidHsaPersonIdRoot() {
// Arrange
ReceiveMedicalCertificateQuestionType request = createValidQuestionRequest();
request.getQuestion().getAdressVard().getHosPersonal().getPersonalId().setRoot("INVALID");
// Act
final List<String> result = QuestionAnswerValidator.validate(request);
// Assert
assertEquals(1, result.size());
}
use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionType in project webcert by sklintyg.
the class QuestionAnswerValidatorTest method testQVCatchesMissingVardgivarIdExtension.
@Test
public void testQVCatchesMissingVardgivarIdExtension() {
// Arrange
ReceiveMedicalCertificateQuestionType request = createValidQuestionRequest();
request.getQuestion().getAdressVard().getHosPersonal().getEnhet().getVardgivare().getVardgivareId().setExtension(null);
// Act
final List<String> result = QuestionAnswerValidator.validate(request);
// Assert
assertEquals(1, result.size());
}
use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionType in project webcert by sklintyg.
the class QuestionAnswerValidatorTest method testQVPassesValidRequest.
@Test
public void testQVPassesValidRequest() {
ReceiveMedicalCertificateQuestionType request = createValidQuestionRequest();
assertEquals(0, QuestionAnswerValidator.validate(request).size());
}
use of se.inera.ifv.insuranceprocess.healthreporting.receivemedicalcertificatequestionsponder.v1.ReceiveMedicalCertificateQuestionType in project webcert by sklintyg.
the class ReceiveQuestionResponderImpl method receiveMedicalCertificateQuestion.
@Override
public ReceiveMedicalCertificateQuestionResponseType receiveMedicalCertificateQuestion(AttributedURIType logicalAddress, ReceiveMedicalCertificateQuestionType request) {
ReceiveMedicalCertificateQuestionResponseType response = new ReceiveMedicalCertificateQuestionResponseType();
// Validate incoming request
List<String> validationMessages = QuestionAnswerValidator.validate(request);
if (!validationMessages.isEmpty()) {
response.setResult(ResultOfCallUtil.failResult(Joiner.on(",").join(validationMessages)));
return response;
}
// Transform to a FragaSvar object
FragaSvar fragaSvar = converter.convert(request.getQuestion());
// Notify stakeholders
sendNotification(processQuestion(fragaSvar));
// Set result and send response back to caller
response.setResult(ResultOfCallUtil.okResult());
return response;
}
Aggregations