@Test
	public void testJsonStringWithWrongContentTypeHeaderReturnsNull() {
		String json = "{\"foo\":\"bar\"}";
		CompositeMessageConverter converter = converterFactory.newInstance(MimeTypeUtils.APPLICATION_JSON);

		Message<?> msg = MessageBuilder.withPayload(json).copyHeaders(
				Collections.singletonMap(MessageHeaders.CONTENT_TYPE, MimeTypeUtils.APPLICATION_XML))
				.build();

		Message<?> result = (Message<?>) converter.fromMessage(msg, Foo.class);
		assertNull(result);
	}
Tests for converting from a Message.

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