|
5 | 5 |
|
6 | 6 | package software.amazon.nio.spi.s3; |
7 | 7 |
|
| 8 | +import org.junit.jupiter.api.AfterEach; |
| 9 | +import org.junit.jupiter.api.BeforeEach; |
| 10 | +import org.junit.jupiter.api.Test; |
| 11 | +import org.junit.jupiter.api.extension.ExtendWith; |
| 12 | +import org.mockito.Mock; |
| 13 | +import org.mockito.junit.jupiter.MockitoExtension; |
| 14 | +import software.amazon.awssdk.services.s3.S3AsyncClient; |
| 15 | +import software.amazon.awssdk.services.s3.model.HeadObjectResponse; |
| 16 | + |
8 | 17 | import java.io.IOException; |
9 | 18 | import java.net.URI; |
10 | 19 | import java.nio.file.FileSystemNotFoundException; |
11 | 20 | import java.nio.file.FileSystems; |
12 | | -import java.nio.file.Files; |
13 | 21 | import java.nio.file.Path; |
14 | | -import java.nio.file.Paths; |
15 | 22 | import java.util.Collections; |
16 | 23 | import java.util.Iterator; |
17 | 24 | import java.util.concurrent.CompletableFuture; |
18 | 25 |
|
19 | | -import static org.assertj.core.api.Assertions.assertThatThrownBy; |
20 | 26 | import static org.assertj.core.api.BDDAssertions.then; |
21 | | -import org.junit.jupiter.api.AfterEach; |
22 | 27 | import static org.junit.jupiter.api.Assertions.*; |
23 | | -import org.junit.jupiter.api.BeforeEach; |
24 | | -import org.junit.jupiter.api.Test; |
25 | | -import org.junit.jupiter.api.extension.ExtendWith; |
26 | | -import org.mockito.Mock; |
27 | 28 | import static org.mockito.Mockito.lenient; |
28 | 29 | import static software.amazon.nio.spi.s3.Constants.PATH_SEPARATOR; |
29 | 30 | import static software.amazon.nio.spi.s3.S3Matchers.anyConsumer; |
30 | 31 |
|
31 | | -import org.mockito.junit.jupiter.MockitoExtension; |
32 | | -import software.amazon.awssdk.core.exception.SdkClientException; |
33 | | -import software.amazon.awssdk.services.s3.S3AsyncClient; |
34 | | -import software.amazon.awssdk.services.s3.model.HeadObjectResponse; |
35 | | - |
36 | 32 | @ExtendWith(MockitoExtension.class) |
37 | 33 | public class S3FileSystemTest { |
38 | 34 | S3FileSystemProvider provider; |
@@ -135,16 +131,4 @@ public void testGetOpenChannelsIsNotModifiable() { |
135 | 131 | // |
136 | 132 | assertThrows(UnsupportedOperationException.class, () -> s3FileSystem.getOpenChannels().add(null)); |
137 | 133 | } |
138 | | - |
139 | | - @Test |
140 | | - public void plainInitializationWithError() { |
141 | | - // |
142 | | - // Was want to try a plain initialization (i.e. without any mocks). |
143 | | - // We expect standard client to throw an exception due to missing credentials |
144 | | - final Path path = Paths.get(URI.create("s3://does-not-exists-" + System.currentTimeMillis() + "/dir")); |
145 | | - then(path).isInstanceOf(S3Path.class); |
146 | | - assertThatThrownBy(() -> Files.exists(path)) |
147 | | - .isInstanceOf(SdkClientException.class) |
148 | | - .hasMessageStartingWith("Unable to load credentials"); |
149 | | - } |
150 | 134 | } |
0 commit comments