JmsMessageTransformer implements RecordProcessor<String, Message> { @Override public JmsRecord processRecord(final Record<String> record) throws Exception { TextMessage message = session.createTextMessage(); message.setText(record.getPayload()); return new JmsRecord(record.getHeader(), message); } JmsMessageTransformer(final Session session); @Override JmsRecord processRecord(final Record<String> record);  }
@Test public void testProcessRecord() throws Exception { JmsRecord actual = jmsMessageTransformer.processRecord(record); assertThat(actual).isNotNull(); assertThat(actual.getHeader()).isEqualTo(header); assertThat(actual.getPayload()).isEqualTo(message); }