|
33 | 33 | import java.io.ByteArrayInputStream; |
34 | 34 | import java.io.ByteArrayOutputStream; |
35 | 35 | import java.io.File; |
36 | | -import java.io.FileInputStream; |
37 | 36 | import java.io.IOException; |
38 | 37 | import java.io.InputStream; |
39 | 38 | import java.net.InetSocketAddress; |
40 | 39 | import java.net.URL; |
| 40 | +import java.nio.file.Files; |
41 | 41 | import java.nio.file.Paths; |
42 | 42 | import java.time.Duration; |
43 | 43 | import java.time.temporal.ChronoUnit; |
@@ -174,7 +174,7 @@ public void imageCreateImportFromInputStream() throws IOException { |
174 | 174 | InputStream tarFile = imageApi.imageGet(testImage.getImageWithTag()); |
175 | 175 | File destDir = new TarUtil().unTar(tarFile); |
176 | 176 | File rootLayerTar = new ManifestUtil().getRootLayerLocation(destDir); |
177 | | - try (InputStream source = new FileInputStream(rootLayerTar)) { |
| 177 | + try (InputStream source = Files.newInputStream(rootLayerTar.toPath())) { |
178 | 178 | assertDoesNotThrow(() -> imageApi.imageCreate(null, "-", "test", "from-stream", null, null, singletonList(String.format("LABEL %1$s=\"%2$s\"", LABEL_KEY, LABEL_VALUE)), null, source)); |
179 | 179 | } |
180 | 180 | imageApi.imageDelete("test:from-stream", null, null); |
@@ -213,7 +213,7 @@ public void imageCommit() { |
213 | 213 | @Test |
214 | 214 | public void imageList() { |
215 | 215 | List<ImageSummary> images = imageApi.imageList(null, null, null); |
216 | | - assertEquals(1, images.stream().filter((i) -> i.getRepoTags() != null && i.getRepoTags().stream().filter((t) -> t.equals(testImage.getImageWithTag())).count() > 0).count()); |
| 216 | + assertEquals(1, images.stream().filter((i) -> i.getRepoTags() != null && i.getRepoTags().stream().anyMatch((t) -> t.equals(testImage.getImageWithTag()))).count()); |
217 | 217 | } |
218 | 218 |
|
219 | 219 | @Test |
|
0 commit comments