@Test
public void testListAttachmentsWithOptional() throws Exception
{
Map<String, DataHandler> attachments = new HashMap<String, DataHandler>();
attachments.put("foo", new DataHandler(new StringDataSource("fooValue")));
attachments.put("bar", new DataHandler(new StringDataSource("barValue")));
eventContext = createEventContext(null, attachments);
InvocationResult response = invokeResolver("processAttachmentsListOptional", eventContext);
assertTrue("Message payload should be a List", response.getResult() instanceof List);
List<DataHandler> result = (List<DataHandler>) response.getResult();