}
@Test
public void testSftpSourceWithFileNameRegexPattern() {
String streamName = generateStreamName();
CounterSink counter = metrics().newCounterSink(streamName);
stream().create(streamName,
"sftp --user=%s --password=%s --port=%s --remoteDir=%s --localDir=%s --regexPattern=%s | %s",
server.getUser(), server.getPassword(), server.getPort(), server.getSourceSftpDirectory(),
server.getTargetLocalDirectory(), "'" + "(\\w+)\\.(txt|text)$" + "'", counter);
assertThat(counter, eventually(hasValue("2")));