@Test
	public void testPojoToJsonPrettyPrint() {
		//OS agnostic
		String json = String.format("{%n  \"foo\" : \"bar\"%n}");
		PojoToJsonMessageConverter messageConverter = new PojoToJsonMessageConverter();
		messageConverter.setPrettyPrint(true);
		Message<?> msg = (Message<?>) messageConverter.fromMessage(new GenericMessage<Foo>(new Foo()), String.class);
		assertEquals(json, msg.getPayload().toString().trim());
		assertEquals(MimeTypeUtils.APPLICATION_JSON, msg.getHeaders().get(MessageHeaders.CONTENT_TYPE));
	}
Tests for converting from a Message.

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