@Test
public void testMethodMatchWithArguments() throws Exception
{
ReflectionEntryPointResolver resolver = new ReflectionEntryPointResolver();
InvocationResult result = resolver.invoke(new FruitBowl(), getTestEventContext(new Object[]{new Apple(), new Banana()}));
assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
assertTrue(result.getResult() instanceof Fruit[]);
//test that the correct methd was called
assertTrue(((Fruit[]) result.getResult())[0] instanceof Apple);
assertTrue(((Fruit[]) result.getResult())[1] instanceof Banana);
assertEquals("addAppleAndBanana", result.getMethodCalled());
result = resolver.invoke(new FruitBowl(), getTestEventContext(new Object[]{new Banana(), new Apple()}));
assertEquals(result.getState(), InvocationResult.State.SUCCESSFUL);
assertTrue(result.getResult() instanceof Fruit[]);
assertTrue(((Fruit[]) result.getResult())[0] instanceof Banana);
assertTrue(((Fruit[]) result.getResult())[1] instanceof Apple);
assertEquals("addBananaAndApple", result.getMethodCalled());