public void testAnnotatedMethod() throws Exception
{
AnnotatedEntryPointResolver resolver = new AnnotatedEntryPointResolver();
AnnotatedComponent2 component = new AnnotatedComponent2();
MuleEventContext context = getTestEventContext(TEST_PAYLOAD);
context.getMessage().setProperty("foo", "fooValue", PropertyScope.INBOUND);
//Since AnnotatedComponent2 has two annotated methods we need to set the method to call
context.getMessage().setProperty(MuleProperties.MULE_METHOD_PROPERTY, "doSomething", PropertyScope.INVOCATION);
InvocationResult result = resolver.invoke(component, context);
assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
//We need to parse the xml to normalise it so that the final assert passes
assertEquals(TEST_PAYLOAD.getClass().getName() + ":fooValue:" + FruitBowl.class, result.getResult());