@Test
public void testGetEndpoint() throws Exception {

	EndpointMapping mappingMock = createMock(EndpointMapping.class);
	dispatcher.setEndpointMappings(Collections.singletonList(mappingMock));
	EndpointInvocationChain chain = new EndpointInvocationChain(new Object());
	expect(mappingMock.getEndpoint(messageContext)).andReturn(chain);
	replay(mappingMock, factoryMock);
	EndpointInvocationChain result = dispatcher.getEndpoint(messageContext);
	verify(mappingMock, factoryMock);
	Assert.assertEquals("getEndpoint returns invalid EndpointInvocationChain", chain, result);
}