View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.ssl;
8   
9   import org.mule.api.endpoint.InboundEndpoint;
10  import org.mule.api.service.Service;
11  import org.mule.api.transport.MessageReceiver;
12  import org.mule.service.ServiceCompositeMessageSource;
13  import org.mule.transport.AbstractMessageReceiverTestCase;
14  
15  import com.mockobjects.dynamic.Mock;
16  
17  public class SslMessageReceiverTestCase extends AbstractMessageReceiverTestCase
18  {
19      public MessageReceiver getMessageReceiver() throws Exception
20      {
21          Mock mockComponent = new Mock(Service.class);
22          mockComponent.expect("getResponseRouter");
23          mockComponent.expectAndReturn("getInboundRouter", new ServiceCompositeMessageSource());
24          return new SslMessageReceiver(endpoint.getConnector(), (Service) mockComponent.proxy(), endpoint);
25      }
26  
27      public InboundEndpoint getEndpoint() throws Exception
28      {
29          return muleContext.getEndpointFactory().getInboundEndpoint("ssl://localhost:1234");
30      }
31  }