Skip to content

Commit a283049

Browse files
committed
chore
1 parent ce07415 commit a283049

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

api-client/src/test/java/de/gesellix/docker/remote/api/client/ImageApiIntegrationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
import java.io.ByteArrayInputStream;
3434
import java.io.ByteArrayOutputStream;
3535
import java.io.File;
36-
import java.io.FileInputStream;
3736
import java.io.IOException;
3837
import java.io.InputStream;
3938
import java.net.InetSocketAddress;
4039
import java.net.URL;
40+
import java.nio.file.Files;
4141
import java.nio.file.Paths;
4242
import java.time.Duration;
4343
import java.time.temporal.ChronoUnit;
@@ -174,7 +174,7 @@ public void imageCreateImportFromInputStream() throws IOException {
174174
InputStream tarFile = imageApi.imageGet(testImage.getImageWithTag());
175175
File destDir = new TarUtil().unTar(tarFile);
176176
File rootLayerTar = new ManifestUtil().getRootLayerLocation(destDir);
177-
try (InputStream source = new FileInputStream(rootLayerTar)) {
177+
try (InputStream source = Files.newInputStream(rootLayerTar.toPath())) {
178178
assertDoesNotThrow(() -> imageApi.imageCreate(null, "-", "test", "from-stream", null, null, singletonList(String.format("LABEL %1$s=\"%2$s\"", LABEL_KEY, LABEL_VALUE)), null, source));
179179
}
180180
imageApi.imageDelete("test:from-stream", null, null);
@@ -213,7 +213,7 @@ public void imageCommit() {
213213
@Test
214214
public void imageList() {
215215
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());
217217
}
218218

219219
@Test

0 commit comments

Comments
 (0)