@Test public void answerIsAccepted() { AttributedURIType address = new AttributedURIType(); address.setValue(SEND_QUESTION_STUB_ADDRESS); SendMedicalCertificateQuestionType parameters = createQuestion("Message"); SendMedicalCertificateQuestionResponseType answer = stub.sendMedicalCertificateQuestion(address, parameters); assertEquals(answer.getResult().getErrorText(), ResultCodeEnum.OK, answer.getResult().getResultCode()); }
@Override public SendMedicalCertificateQuestionResponseType sendMedicalCertificateQuestion( AttributedURIType logicalAddress, SendMedicalCertificateQuestionType parameters) { SendMedicalCertificateQuestionResponseType response = new SendMedicalCertificateQuestionResponseType(); if (logicalAddress == null) { response.setResult(ResultOfCallUtil .failResult("Ingen LogicalAddress är satt")); } else if (!LOGICAL_ADDRESS.equals(logicalAddress.getValue())) { response.setResult(ResultOfCallUtil.failResult("LogicalAddress '" + logicalAddress.getValue() + "' är inte samma som '" + LOGICAL_ADDRESS + "'")); } else if ("error".equalsIgnoreCase(parameters.getQuestion().getFraga().getMeddelandeText())) { response.setResult(ResultOfCallUtil .failResult("Du ville ju få ett fel")); } else { QuestionToFkType questionType = parameters.getQuestion(); SendMedicalCertificateQuestionValidator validator = new SendMedicalCertificateQuestionValidator( questionType); try { validator.validateAndCorrect(); response.setResult(ResultOfCallUtil.okResult()); } catch (ValidationException e) { response.setResult(ResultOfCallUtil.failResult(e.getMessage())); } questionAnswerStore.addQuestion(parameters.getQuestion()); } return response; }
SendQuestionStub implements
    SendMedicalCertificateQuestionResponderInterface { @Override public SendMedicalCertificateQuestionResponseType sendMedicalCertificateQuestion( AttributedURIType logicalAddress, SendMedicalCertificateQuestionType parameters) { SendMedicalCertificateQuestionResponseType response = new SendMedicalCertificateQuestionResponseType(); if (logicalAddress == null) { response.setResult(ResultOfCallUtil .failResult("Ingen LogicalAddress är satt")); } else if (!LOGICAL_ADDRESS.equals(logicalAddress.getValue())) { response.setResult(ResultOfCallUtil.failResult("LogicalAddress '" + logicalAddress.getValue() + "' är inte samma som '" + LOGICAL_ADDRESS + "'")); } else if ("error".equalsIgnoreCase(parameters.getQuestion().getFraga().getMeddelandeText())) { response.setResult(ResultOfCallUtil .failResult("Du ville ju få ett fel")); } else { QuestionToFkType questionType = parameters.getQuestion(); SendMedicalCertificateQuestionValidator validator = new SendMedicalCertificateQuestionValidator( questionType); try { validator.validateAndCorrect(); response.setResult(ResultOfCallUtil.okResult()); } catch (ValidationException e) { response.setResult(ResultOfCallUtil.failResult(e.getMessage())); } questionAnswerStore.addQuestion(parameters.getQuestion()); } return response; } }
SendQuestionStub implements
    SendMedicalCertificateQuestionResponderInterface { @Override public SendMedicalCertificateQuestionResponseType sendMedicalCertificateQuestion( AttributedURIType logicalAddress, SendMedicalCertificateQuestionType parameters) { SendMedicalCertificateQuestionResponseType response = new SendMedicalCertificateQuestionResponseType(); if (logicalAddress == null) { response.setResult(ResultOfCallUtil .failResult("Ingen LogicalAddress är satt")); } else if (!LOGICAL_ADDRESS.equals(logicalAddress.getValue())) { response.setResult(ResultOfCallUtil.failResult("LogicalAddress '" + logicalAddress.getValue() + "' är inte samma som '" + LOGICAL_ADDRESS + "'")); } else if ("error".equalsIgnoreCase(parameters.getQuestion().getFraga().getMeddelandeText())) { response.setResult(ResultOfCallUtil .failResult("Du ville ju få ett fel")); } else { QuestionToFkType questionType = parameters.getQuestion(); SendMedicalCertificateQuestionValidator validator = new SendMedicalCertificateQuestionValidator( questionType); try { validator.validateAndCorrect(); response.setResult(ResultOfCallUtil.okResult()); } catch (ValidationException e) { response.setResult(ResultOfCallUtil.failResult(e.getMessage())); } questionAnswerStore.addQuestion(parameters.getQuestion()); } return response; }  }
SendQuestionStub implements
    SendMedicalCertificateQuestionResponderInterface { @Override public SendMedicalCertificateQuestionResponseType sendMedicalCertificateQuestion( AttributedURIType logicalAddress, SendMedicalCertificateQuestionType parameters) { SendMedicalCertificateQuestionResponseType response = new SendMedicalCertificateQuestionResponseType(); if (logicalAddress == null) { response.setResult(ResultOfCallUtil .failResult("Ingen LogicalAddress är satt")); } else if (!LOGICAL_ADDRESS.equals(logicalAddress.getValue())) { response.setResult(ResultOfCallUtil.failResult("LogicalAddress '" + logicalAddress.getValue() + "' är inte samma som '" + LOGICAL_ADDRESS + "'")); } else if ("error".equalsIgnoreCase(parameters.getQuestion().getFraga().getMeddelandeText())) { response.setResult(ResultOfCallUtil .failResult("Du ville ju få ett fel")); } else { QuestionToFkType questionType = parameters.getQuestion(); SendMedicalCertificateQuestionValidator validator = new SendMedicalCertificateQuestionValidator( questionType); try { validator.validateAndCorrect(); response.setResult(ResultOfCallUtil.okResult()); } catch (ValidationException e) { response.setResult(ResultOfCallUtil.failResult(e.getMessage())); } questionAnswerStore.addQuestion(parameters.getQuestion()); } return response; }  @Override SendMedicalCertificateQuestionResponseType sendMedicalCertificateQuestion(
        AttributedURIType logicalAddress,
        SendMedicalCertificateQuestionType parameters); }
SendQuestionStub implements
    SendMedicalCertificateQuestionResponderInterface { @Override public SendMedicalCertificateQuestionResponseType sendMedicalCertificateQuestion( AttributedURIType logicalAddress, SendMedicalCertificateQuestionType parameters) { SendMedicalCertificateQuestionResponseType response = new SendMedicalCertificateQuestionResponseType(); if (logicalAddress == null) { response.setResult(ResultOfCallUtil .failResult("Ingen LogicalAddress är satt")); } else if (!LOGICAL_ADDRESS.equals(logicalAddress.getValue())) { response.setResult(ResultOfCallUtil.failResult("LogicalAddress '" + logicalAddress.getValue() + "' är inte samma som '" + LOGICAL_ADDRESS + "'")); } else if ("error".equalsIgnoreCase(parameters.getQuestion().getFraga().getMeddelandeText())) { response.setResult(ResultOfCallUtil .failResult("Du ville ju få ett fel")); } else { QuestionToFkType questionType = parameters.getQuestion(); SendMedicalCertificateQuestionValidator validator = new SendMedicalCertificateQuestionValidator( questionType); try { validator.validateAndCorrect(); response.setResult(ResultOfCallUtil.okResult()); } catch (ValidationException e) { response.setResult(ResultOfCallUtil.failResult(e.getMessage())); } questionAnswerStore.addQuestion(parameters.getQuestion()); } return response; }  @Override SendMedicalCertificateQuestionResponseType sendMedicalCertificateQuestion(
        AttributedURIType logicalAddress,
        SendMedicalCertificateQuestionType parameters);  }