forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSaveImageCmdIT.java
More file actions
34 lines (26 loc) · 998 Bytes
/
Copy pathSaveImageCmdIT.java
File metadata and controls
34 lines (26 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.github.dockerjava.cmd;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.InputStream;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.not;
public class SaveImageCmdIT extends CmdIT {
public static final Logger LOG = LoggerFactory.getLogger(SaveImageCmdIT.class);
@Test
public void saveImage() throws Exception {
try (
InputStream inputStream = dockerRule.getClient().saveImageCmd("busybox").exec();
InputStream image = IOUtils.toBufferedInputStream(inputStream)
) {
assertThat(image.read(), not(-1));
}
try (
InputStream inputStream = dockerRule.getClient().saveImageCmd("busybox").withTag("latest").exec();
InputStream image2 = IOUtils.toBufferedInputStream(inputStream)
) {
assertThat(image2.read(), not(-1));
}
}
}