use of com.adaptris.core.MultiPayloadAdaptrisMessage in project interlok by adaptris.
the class MultiPayloadStreamOutputParameterTest method testInsertUseDefaultId.
@Test
public void testInsertUseDefaultId() throws Exception {
MultiPayloadMessageFactory messageFactory = new MultiPayloadMessageFactory();
MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) messageFactory.newMessage();
try (InputStream in = new ByteArrayInputStream(PAYLOAD.getBytes())) {
InputStreamWithEncoding stream = new InputStreamWithEncoding(in, ENCODING);
MultiPayloadStreamOutputParameter parameter = new MultiPayloadStreamOutputParameter();
parameter.insert(stream, null, message);
}
assertEquals(PAYLOAD, message.getContent(messageFactory.getDefaultPayloadId()));
}
use of com.adaptris.core.MultiPayloadAdaptrisMessage in project interlok by adaptris.
the class MultiPayloadStringOutputParameterTest method testInsert.
@Test
public void testInsert() throws Exception {
MultiPayloadStringOutputParameter parameter = new MultiPayloadStringOutputParameter();
MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage();
parameter.insert(PAYLOAD, ID, message);
assertEquals(PAYLOAD, message.getContent(ID));
}
use of com.adaptris.core.MultiPayloadAdaptrisMessage in project interlok by adaptris.
the class MultiPayloadStringOutputParameterTest method testInsertUseDefaultId.
@Test
public void testInsertUseDefaultId() throws Exception {
MultiPayloadStringOutputParameter parameter = new MultiPayloadStringOutputParameter();
MultiPayloadMessageFactory messageFactory = new MultiPayloadMessageFactory();
MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) messageFactory.newMessage();
parameter.insert(PAYLOAD, null, message);
assertEquals(PAYLOAD, message.getContent(messageFactory.getDefaultPayloadId()));
}
use of com.adaptris.core.MultiPayloadAdaptrisMessage in project interlok by adaptris.
the class MultiPayloadByteArrayInputParameterTest method testExtract.
@Test
public void testExtract() throws Exception {
MultiPayloadByteArrayInputParameter parameter = new MultiPayloadByteArrayInputParameter();
parameter.setPayloadId(ID);
MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage(ID, PAYLOAD);
assertArrayEquals(PAYLOAD, parameter.extract(message));
assertArrayEquals(PAYLOAD, parameter.extract(ID, message));
assertArrayEquals(PAYLOAD, parameter.extract(null, message));
}
use of com.adaptris.core.MultiPayloadAdaptrisMessage in project interlok by adaptris.
the class MultiPayloadByteArrayOutputParameterTest method testInsert.
@Test
public void testInsert() throws Exception {
MultiPayloadByteArrayOutputParameter parameter = new MultiPayloadByteArrayOutputParameter();
MultiPayloadAdaptrisMessage message = (MultiPayloadAdaptrisMessage) new MultiPayloadMessageFactory().newMessage();
parameter.insert(PAYLOAD, ID, message);
assertArrayEquals(PAYLOAD, message.getPayload(ID));
}
Aggregations