@Test
	public void testStringToByteArray() throws UnsupportedEncodingException {
		CompositeMessageConverter converter = converterFactory.newInstance(MimeType.valueOf("application/octet-stream"));
		Message<String> msg = MessageBuilder.withPayload("hello").copyHeaders(
				Collections.singletonMap(MessageHeaders.CONTENT_TYPE, MimeType.valueOf("text/plain;charset=UTF-8"))).build();
		byte[] result = (byte[]) converter.fromMessage(msg, byte[].class);
		assertEquals("hello", new String(result, "UTF-8"));
	}
Tests for converting from a Message.

@author David Turanski
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/integration/bus/converter/FromMessageConverterTests.java