@Test public void testReceiveQuestionValidationError() { ReceiveMedicalCertificateQuestionType request = createRequest("RecieveQuestionAnswerResponders/question-from-fk-integrated.xml"); request.getQuestion().setAmne(null); ReceiveMedicalCertificateQuestionResponseType response = receiveQuestionResponder.receiveMedicalCertificateQuestion(null, request); verifyNoInteractions(mockNotificationService); verifyNoInteractions(mockFragaSvarService); assertNotNull(response); assertEquals(ResultCodeEnum.ERROR, response.getResult().getResultCode()); assertEquals(ErrorIdEnum.VALIDATION_ERROR, response.getResult().getErrorId()); assertEquals("Amne är felaktigt", response.getResult().getErrorText()); }
@Override public ReceiveMedicalCertificateQuestionResponseType receiveMedicalCertificateQuestion( AttributedURIType logicalAddress, ReceiveMedicalCertificateQuestionType request) { ReceiveMedicalCertificateQuestionResponseType response = new ReceiveMedicalCertificateQuestionResponseType(); List<String> validationMessages = QuestionAnswerValidator.validate(request); if (!validationMessages.isEmpty()) { response.setResult(ResultOfCallUtil.failResult(Joiner.on(",").join(validationMessages))); return response; } FragaSvar fragaSvar = converter.convert(request.getQuestion()); sendNotification(processQuestion(fragaSvar)); certificateEventService.createCertificateEvent( fragaSvar.getIntygsReferens().getIntygsId(), "FK", EventCode.NYFRFM, String.format("received medical certificate question: %s}", fragaSvar.getFrageText())); response.setResult(ResultOfCallUtil.okResult()); return response; }
ReceiveQuestionResponderImpl implements ReceiveMedicalCertificateQuestionResponderInterface { @Override public ReceiveMedicalCertificateQuestionResponseType receiveMedicalCertificateQuestion( AttributedURIType logicalAddress, ReceiveMedicalCertificateQuestionType request) { ReceiveMedicalCertificateQuestionResponseType response = new ReceiveMedicalCertificateQuestionResponseType(); List<String> validationMessages = QuestionAnswerValidator.validate(request); if (!validationMessages.isEmpty()) { response.setResult(ResultOfCallUtil.failResult(Joiner.on(",").join(validationMessages))); return response; } FragaSvar fragaSvar = converter.convert(request.getQuestion()); sendNotification(processQuestion(fragaSvar)); certificateEventService.createCertificateEvent( fragaSvar.getIntygsReferens().getIntygsId(), "FK", EventCode.NYFRFM, String.format("received medical certificate question: %s}", fragaSvar.getFrageText())); response.setResult(ResultOfCallUtil.okResult()); return response; } }
ReceiveQuestionResponderImpl implements ReceiveMedicalCertificateQuestionResponderInterface { @Override public ReceiveMedicalCertificateQuestionResponseType receiveMedicalCertificateQuestion( AttributedURIType logicalAddress, ReceiveMedicalCertificateQuestionType request) { ReceiveMedicalCertificateQuestionResponseType response = new ReceiveMedicalCertificateQuestionResponseType(); List<String> validationMessages = QuestionAnswerValidator.validate(request); if (!validationMessages.isEmpty()) { response.setResult(ResultOfCallUtil.failResult(Joiner.on(",").join(validationMessages))); return response; } FragaSvar fragaSvar = converter.convert(request.getQuestion()); sendNotification(processQuestion(fragaSvar)); certificateEventService.createCertificateEvent( fragaSvar.getIntygsReferens().getIntygsId(), "FK", EventCode.NYFRFM, String.format("received medical certificate question: %s}", fragaSvar.getFrageText())); response.setResult(ResultOfCallUtil.okResult()); return response; }  }
ReceiveQuestionResponderImpl implements ReceiveMedicalCertificateQuestionResponderInterface { @Override public ReceiveMedicalCertificateQuestionResponseType receiveMedicalCertificateQuestion( AttributedURIType logicalAddress, ReceiveMedicalCertificateQuestionType request) { ReceiveMedicalCertificateQuestionResponseType response = new ReceiveMedicalCertificateQuestionResponseType(); List<String> validationMessages = QuestionAnswerValidator.validate(request); if (!validationMessages.isEmpty()) { response.setResult(ResultOfCallUtil.failResult(Joiner.on(",").join(validationMessages))); return response; } FragaSvar fragaSvar = converter.convert(request.getQuestion()); sendNotification(processQuestion(fragaSvar)); certificateEventService.createCertificateEvent( fragaSvar.getIntygsReferens().getIntygsId(), "FK", EventCode.NYFRFM, String.format("received medical certificate question: %s}", fragaSvar.getFrageText())); response.setResult(ResultOfCallUtil.okResult()); return response; }  @Override ReceiveMedicalCertificateQuestionResponseType receiveMedicalCertificateQuestion(
        AttributedURIType logicalAddress, ReceiveMedicalCertificateQuestionType request); }
ReceiveQuestionResponderImpl implements ReceiveMedicalCertificateQuestionResponderInterface { @Override public ReceiveMedicalCertificateQuestionResponseType receiveMedicalCertificateQuestion( AttributedURIType logicalAddress, ReceiveMedicalCertificateQuestionType request) { ReceiveMedicalCertificateQuestionResponseType response = new ReceiveMedicalCertificateQuestionResponseType(); List<String> validationMessages = QuestionAnswerValidator.validate(request); if (!validationMessages.isEmpty()) { response.setResult(ResultOfCallUtil.failResult(Joiner.on(",").join(validationMessages))); return response; } FragaSvar fragaSvar = converter.convert(request.getQuestion()); sendNotification(processQuestion(fragaSvar)); certificateEventService.createCertificateEvent( fragaSvar.getIntygsReferens().getIntygsId(), "FK", EventCode.NYFRFM, String.format("received medical certificate question: %s}", fragaSvar.getFrageText())); response.setResult(ResultOfCallUtil.okResult()); return response; }  @Override ReceiveMedicalCertificateQuestionResponseType receiveMedicalCertificateQuestion(
        AttributedURIType logicalAddress, ReceiveMedicalCertificateQuestionType request);  }