}
@Test
public void testThatTheCorrectSoapPortIsChosen() throws Exception
{
DefaultInboundEndpoint inboundEndpoint;
if (variant.equals(ConfigVariant.FLOW))
{
final Flow flow = muleContext.getRegistry().lookupObject("CXFProxyService");
inboundEndpoint = (DefaultInboundEndpoint) flow.getMessageSource();
}
else
{
final Service service = muleContext.getRegistry().lookupService("CXFProxyService");
ServiceCompositeMessageSource messageSource = (ServiceCompositeMessageSource) service.getMessageSource();
List<InboundEndpoint> endpoints = messageSource.getEndpoints();
inboundEndpoint = (DefaultInboundEndpoint) endpoints.get(0);
}
List<MessageProcessor> processors = inboundEndpoint.getMessageProcessors();
FlowConfiguringMessageProcessor wrapper = (FlowConfiguringMessageProcessor) processors.get(0);
CxfInboundMessageProcessor cxfProcessor = (CxfInboundMessageProcessor) wrapper.getWrappedMessageProcessor();
Server server = cxfProcessor.getServer();
EndpointInfo endpointInfo = server.getEndpoint().getEndpointInfo();