Skip to content

Commit

Permalink
GH-3247: Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell committed Apr 14, 2020
1 parent d6c9406 commit aeada86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
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;
Expand All @@ -51,7 +52,6 @@
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;
Expand Down Expand Up @@ -413,7 +413,7 @@ public void testExists() throws SftpException, IOException {

assertThat(sftpSession.exists("notExist")).isFalse();

assertThatExceptionOfType(NestedIOException.class).
assertThatExceptionOfType(UncheckedIOException.class).
isThrownBy(() -> sftpSession.exists("foo"));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -28,6 +28,7 @@
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;
Expand All @@ -44,7 +45,6 @@
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;
Expand Down Expand Up @@ -578,7 +578,7 @@ public void testSessionExists() throws IOException {

session.close();

assertThatExceptionOfType(NestedIOException.class)
assertThatExceptionOfType(UncheckedIOException.class)
.isThrownBy(() -> session.exists("any"))
.withRootCauseInstanceOf(IOException.class)
.withStackTraceContaining("Pipe closed");
Expand Down

0 comments on commit aeada86

Please sign in to comment.