}
@Test
public void testDispatchAsyncComplex() throws Throwable
{
MuleClient client = muleContext.getClient();
//TODO MULE-4951 Dispatch no longer works (fails with class cast exception, probably need to configure AXIS.OneWay)
//switching to send() does work
client.send(getDispatchAsyncComplexEndpoint1(), new Person("Betty", "Rubble"), null);
// lets get our newly added person
MuleMessage result = client.request(getDispatchAsyncComplexEndpoint2(), RECEIVE_TIMEOUT);
assertNotNull(result);
assertTrue("Did not receive a Person but: " + result.getPayload().getClass(),
result.getPayload() instanceof Person);
assertEquals("Betty", ((Person)result.getPayload()).getFirstName());
assertEquals("Rubble", ((Person)result.getPayload()).getLastName());