@SuppressWarnings("unchecked") @Test public void convertTextMessageWithoutUserProperties() throws JMSException { SimpleMessage m = new SimpleMessage("test", "queue1"); SimpleMessageTextCreator sut = new SimpleMessageTextCreator(m); TextMessage result = (TextMessage) sut.createMessage(mockSession); assertThat(result.getText()).isEqualTo("test"); assertThat(Collections.list(result.getPropertyNames())).isEmpty(); }
@Override public Message createMessage(Session session) throws JMSException { Message jmsMessage = messageConverter.toMessage(message.getText(), session); for (Entry<String, String> e : message.getProps().entrySet()) { jmsMessage.setStringProperty(e.getKey(), e.getValue()); } return jmsMessage; }
SimpleMessageTextCreator implements MessageCreator { @Override public Message createMessage(Session session) throws JMSException { Message jmsMessage = messageConverter.toMessage(message.getText(), session); for (Entry<String, String> e : message.getProps().entrySet()) { jmsMessage.setStringProperty(e.getKey(), e.getValue()); } return jmsMessage; } }
SimpleMessageTextCreator implements MessageCreator { @Override public Message createMessage(Session session) throws JMSException { Message jmsMessage = messageConverter.toMessage(message.getText(), session); for (Entry<String, String> e : message.getProps().entrySet()) { jmsMessage.setStringProperty(e.getKey(), e.getValue()); } return jmsMessage; } SimpleMessageTextCreator(SimpleMessage message); }
SimpleMessageTextCreator implements MessageCreator { @Override public Message createMessage(Session session) throws JMSException { Message jmsMessage = messageConverter.toMessage(message.getText(), session); for (Entry<String, String> e : message.getProps().entrySet()) { jmsMessage.setStringProperty(e.getKey(), e.getValue()); } return jmsMessage; } SimpleMessageTextCreator(SimpleMessage message); @Override Message createMessage(Session session); }
SimpleMessageTextCreator implements MessageCreator { @Override public Message createMessage(Session session) throws JMSException { Message jmsMessage = messageConverter.toMessage(message.getText(), session); for (Entry<String, String> e : message.getProps().entrySet()) { jmsMessage.setStringProperty(e.getKey(), e.getValue()); } return jmsMessage; } SimpleMessageTextCreator(SimpleMessage message); @Override Message createMessage(Session session);  }