title: Spring integration DSL creating Sftp Inbound Adapter in java 1.7
body: <p>I am creating a sftp inbound flow in spring dsl but when I am trying to test this in junit the mesage is coming null. I think the sftp ibound adapter is not starting properly, but not sure. So I am not able to go further. Can any ony one please provide any pointer to it as I am not able to proceed.</p>
  
  <p>This is my flow....</p>
  
  <pre><code>    @Bean
      public IntegrationFlow sftpInboundFlow() {
          return IntegrationFlows
                  .from(Sftp.inboundAdapter(this.sftpSessionFactory)
                          .preserveTimestamp(true).remoteDirectory(remDir)
                          .regexFilter(".*\\.txt$")
                          .localFilenameExpression("#this.toUpperCase()")
                          .localDirectory(new File(localDir))
                          .remoteFileSeparator("/"),
                          new Consumer&lt;SourcePollingChannelAdapterSpec&gt;() {
                              @Override
                              public void accept(
                                      SourcePollingChannelAdapterSpec e) {
                                  e.id("sftpInboundAdapter")
                                          .autoStartup(true)
                                          .poller(Pollers.fixedRate(1000)
                                                  .maxMessagesPerPoll(1));
                              }
                          })
                  .channel(MessageChannels.queue("sftpInboundResultChannel"))
                  .get();
      }
  </code></pre>
  
  <p>This is my session Factory...</p>
  
  <pre><code>        @Autowired
          private DefaultSftpSessionFactory sftpSessionFactory;
  
          @Bean
          public DefaultSftpSessionFactory sftpSessionFactory() {
              DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory(
                      true);
              factory.setHost("111.11.12.143");
              factory.setPort(22);
              factory.setUser("sftp");
              factory.setPassword("*******");         
              return factory;
          }
  </code></pre>
  
  <p>This is my Pollable channel..</p>
  
  <pre><code>    @Autowired
          private PollableChannel sftpInboundResultChannel;   
  
      @Bean
          public PollableChannel sftpChannel() {
          return new QueueChannel();
      }
  </code></pre>
  
  <p>And this is my Test method..</p>
  
  <pre><code>    @Test
      public void testSftpInboundFlow() {
  
          Message&lt;?&gt; message = ((PollableChannel) sftpInboundResultChannel).receive(1000);     //Not receiving any message
          System.out.println("message====" + message);
          Object payload = message.getPayload();
  
          File file = (File) payload;
          message = this.sftpInboundResultChannel.receive(1000);
          file = (File) message.getPayload(); 
  
      }   
  </code></pre>