public static final String ITEM_XML = "<item><code>1234</code><description>Vacuum Cleaner</description><in-stock>true</in-stock></item>";
public void testCustomTransform() throws Exception
{
MuleMessage message = new DefaultMuleMessage(ITEM_XML, muleContext);
Item item = (Item) message.getPayload(DataTypeFactory.create(Item.class));
assertNotNull(item);
assertEquals("1234", item.getCode());
assertEquals("Vacuum Cleaner", item.getDescription());
assertTrue(item.isInStock());
//and back again
Document doc = (Document) message.getPayload(DataTypeFactory.create(Document.class));
assertNotNull(doc);