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.sftp;
8   
9   import org.mule.api.endpoint.InboundEndpoint;
10  import org.mule.tck.junit4.AbstractMuleContextTestCase;
11  
12  import org.junit.Test;
13  
14  import static org.junit.Assert.assertEquals;
15  import static org.junit.Assert.assertNotNull;
16  import static org.junit.Assert.assertTrue;
17  
18  public class SftpConnectorFactoryTestCase extends AbstractMuleContextTestCase
19  {
20  
21      @Test
22      public void testCreateFromFactory() throws Exception
23      {
24          InboundEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint(
25              getEndpointURI());
26          assertNotNull(endpoint);
27          assertNotNull(endpoint.getConnector());
28          assertTrue(endpoint.getConnector() instanceof SftpConnector);
29          assertEquals(getEndpointURI(), endpoint.getEndpointURI().getAddress());
30      }
31  
32      public String getEndpointURI()
33      {
34          return "sftp://ms/data";
35      }
36  }