@Test public void sendMessageToRecipientTest() throws Exception { final String intygsId = "intygsId"; final String xmlBody = "xmlBody"; service.sendMessageToRecipient(intygsId, xmlBody); ArgumentCaptor<MessageCreator> messageCaptor = ArgumentCaptor.forClass(MessageCreator.class); verify(template).send(messageCaptor.capture()); Message res = messageCaptor.getValue().createMessage(session); assertEquals(Constants.SEND_MESSAGE_TO_RECIPIENT, res.getStringProperty(Constants.MESSAGE_TYPE)); assertEquals(intygsId, res.getStringProperty(Constants.INTYGS_ID)); assertEquals(LOGICAL_ADDRESS, res.getStringProperty(Constants.LOGICAL_ADDRESS)); assertEquals(xmlBody, ((TextMessage) res).getText()); }
@Override public void sendMessageToRecipient(String intygsId, String xmlBody) { send(new SendMessageToRecipientMessageCreator(intygsId, xmlBody, logicalAddress)); }
CertificateSenderServiceImpl implements CertificateSenderService { @Override public void sendMessageToRecipient(String intygsId, String xmlBody) { send(new SendMessageToRecipientMessageCreator(intygsId, xmlBody, logicalAddress)); } }
CertificateSenderServiceImpl implements CertificateSenderService { @Override public void sendMessageToRecipient(String intygsId, String xmlBody) { send(new SendMessageToRecipientMessageCreator(intygsId, xmlBody, logicalAddress)); }  }
CertificateSenderServiceImpl implements CertificateSenderService { @Override public void sendMessageToRecipient(String intygsId, String xmlBody) { send(new SendMessageToRecipientMessageCreator(intygsId, xmlBody, logicalAddress)); }  @PostConstruct void checkJmsTemplate(); @Override void storeCertificate(String intygsId, String intygsTyp, String jsonBody); @Override void sendCertificate(String intygsId, Personnummer personId, String jsonBody, String recipientId); @Override void sendCertificate(String intygsId, Personnummer personId, String jsonBody, String recipientId, boolean delay); @Override void revokeCertificate(String intygsId, String xmlBody, String intygsTyp, String intygsTypVersion); @Override void sendMessageToRecipient(String intygsId, String xmlBody); @Override void sendRegisterApprovedReceivers(String intygsId, String intygsTyp, String jsonBody); }
CertificateSenderServiceImpl implements CertificateSenderService { @Override public void sendMessageToRecipient(String intygsId, String xmlBody) { send(new SendMessageToRecipientMessageCreator(intygsId, xmlBody, logicalAddress)); }  @PostConstruct void checkJmsTemplate(); @Override void storeCertificate(String intygsId, String intygsTyp, String jsonBody); @Override void sendCertificate(String intygsId, Personnummer personId, String jsonBody, String recipientId); @Override void sendCertificate(String intygsId, Personnummer personId, String jsonBody, String recipientId, boolean delay); @Override void revokeCertificate(String intygsId, String xmlBody, String intygsTyp, String intygsTypVersion); @Override void sendMessageToRecipient(String intygsId, String xmlBody); @Override void sendRegisterApprovedReceivers(String intygsId, String intygsTyp, String jsonBody);  }