Convert byte[] via text/plain to String
Fix #898 When the payload is `byte[]` ensure that the String is the String representation, not the toString() conversion result.
This commit is contained in:
committed by
Ilayaperumal Gopinathan
parent
8f3e448f07
commit
9ea4ff324c
@@ -63,6 +63,16 @@ public class TextPlainConversionTest {
|
||||
assertThat(received.getPayload()).isEqualTo("Foo{name='Bar'}");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testByteArrayConversionOnOutput() throws Exception {
|
||||
testProcessor.output().send(MessageBuilder.withPayload("Bar".getBytes()).build());
|
||||
@SuppressWarnings("unchecked")
|
||||
Message<?> received = ((TestSupportBinder) binderFactory.getBinder(null, MessageChannel.class))
|
||||
.messageCollector().forChannel(testProcessor.output()).poll(1, TimeUnit.SECONDS);
|
||||
assertThat(received).isNotNull();
|
||||
assertThat(received.getPayload()).isEqualTo("Bar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTextPlainConversionOnInputAndOutput() throws Exception {
|
||||
testProcessor.input().send(MessageBuilder.withPayload(new Foo("Bar")).build());
|
||||
|
||||
Reference in New Issue
Block a user