@Test
public void testMapHeadersWithGenerics() throws Exception
{
eventContext.getMessage().setProperty("apple", new Apple(), PropertyScope.INBOUND);
eventContext.getMessage().setProperty("banana", new Banana(), PropertyScope.INBOUND);
eventContext.getMessage().setProperty("orange", new Orange(), PropertyScope.INBOUND);
eventContext.getMessage().setProperty(MuleProperties.MULE_ENCODING_PROPERTY, "UTF-8", PropertyScope.INBOUND);
InvocationResult response = invokeResolver("processHeadersWithGenerics", eventContext);
assertTrue("Message payload should be a Map", response.getResult() instanceof Map);
Map<?, ?> result = (Map<?, ?>) response.getResult();
//Will match all Mule headers
assertEquals(2, result.size());
assertEquals(new Apple(), result.get("apple"));
assertEquals(new Orange(), result.get("orange"));
assertNull(result.get("banana"));
}