OutboundEndpoint endpoint = muleContext.getEndpointFactory().getOutboundEndpoint(
getTestEndpointURI());
Service service = getTestService(uniqueName("testComponent"), FunctionalTestComponent.class);
// TODO Simplify this API for adding an outbound endpoint.
OutboundPassThroughRouter passThroughRouter = new OutboundPassThroughRouter();
passThroughRouter.addRoute(endpoint);
((OutboundRouterCollection) service.getOutboundMessageProcessor()).addRoute(passThroughRouter);
//muleContext.getRegistry().registerComponent(service);
MuleMessage message = new DefaultMuleMessage(MESSAGE, muleContext);
message.setOutboundProperty(MailProperties.TO_ADDRESSES_PROPERTY, EMAIL);