@Test
public void testTupleSerialization() {
Tuple payload = TupleBuilder.tuple().of("foo", "bar");
Message<?> converted = messageBus.serializePayloadIfNecessary(new GenericMessage<Tuple>(payload),
MimeTypeUtils.APPLICATION_OCTET_STREAM);
MimeType mimeType = contentTypeResolver.resolve(converted.getHeaders());
assertEquals("application", mimeType.getType());
assertEquals("x-java-object", mimeType.getSubtype());
assertEquals(DefaultTuple.class.getName(), mimeType.getParameter("type"));
Message<?> reconstructed = messageBus.deserializePayloadIfNecessary(converted);
assertEquals("bar", ((Tuple) reconstructed.getPayload()).getString("foo"));
assertNull(reconstructed.getHeaders().get(MessageHeaders.CONTENT_TYPE));
}