diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpOutboundTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpOutboundTests.java index 12f7435a2f..d172cf5080 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpOutboundTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpOutboundTests.java @@ -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")); } diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpServerOutboundTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpServerOutboundTests.java index fd7aab8cdc..dbca776f29 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpServerOutboundTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpServerOutboundTests.java @@ -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");