GH-3247: Fix test

This commit is contained in:
Gary Russell
2020-04-14 16:02:52 -04:00
parent d6c9406d93
commit aeada86c01
2 changed files with 5 additions and 5 deletions

View File

@@ -38,6 +38,7 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.Arrays;
@@ -51,7 +52,6 @@ import org.mockito.Mockito;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.NestedIOException;
import org.springframework.expression.common.LiteralExpression;
import org.springframework.integration.file.DefaultFileNameGenerator;
import org.springframework.integration.file.remote.FileInfo;
@@ -413,7 +413,7 @@ public class SftpOutboundTests {
assertThat(sftpSession.exists("notExist")).isFalse();
assertThatExceptionOfType(NestedIOException.class).
assertThatExceptionOfType(UncheckedIOException.class).
isThrownBy(() -> sftpSession.exists("foo"));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@ import java.io.File;
import java.io.IOException;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.io.UncheckedIOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
@@ -44,7 +45,6 @@ import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.core.NestedIOException;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.event.inbound.ApplicationEventListeningMessageProducer;
import org.springframework.integration.file.FileHeaders;
@@ -578,7 +578,7 @@ public class SftpServerOutboundTests extends SftpTestSupport {
session.close();
assertThatExceptionOfType(NestedIOException.class)
assertThatExceptionOfType(UncheckedIOException.class)
.isThrownBy(() -> session.exists("any"))
.withRootCauseInstanceOf(IOException.class)
.withStackTraceContaining("Pipe closed");