JmsRequestMessageCreator implements MessageCreator { @Override public Message createMessage(final Session session) throws JMSException { request.setInputStream(null); request.clearEvaluationResults(); ObjectMessage message = session.createObjectMessage(); message.setObject(request); message.setBooleanProperty("bodyDecompressed", true); return message; } JmsRequestMessageCreator(final WilmaHttpRequest request); @Override Message createMessage(final Session session);  }
@Test public void testCreateMessageShouldSetRequestOnMessage() throws JMSException { given(session.createObjectMessage()).willReturn(objectMessage); underTest.createMessage(session); verify(objectMessage).setObject(wilmaRequest); }