@Test public void testReceiveQuestionOK() { FragaSvar fraga = buildFraga(INTEGRERAD_ENHET, Status.PENDING_INTERNAL_ACTION); when(mockFragaSvarService.processIncomingQuestion(any(FragaSvar.class))).thenReturn(fraga); ReceiveMedicalCertificateQuestionType request = createRequest("RecieveQuestionAnswerResponders/question-from-fk-integrated.xml"); ReceiveMedicalCertificateQuestionResponseType response = receiveQuestionResponder.receiveMedicalCertificateQuestion(null, request); verify(mockNotificationService).sendNotificationForQuestionReceived(any(FragaSvar.class)); verify(certificateEventService) .createCertificateEvent(anyString(), anyString(), eq(EventCode.NYFRFM), anyString()); assertNotNull(response); assertEquals(ResultCodeEnum.OK, response.getResult().getResultCode()); }
@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);  }