|
10 | 10 | import com.github.dockerjava.client.AbstractDockerClientTest; |
11 | 11 | import com.github.dockerjava.core.RemoteApiVersion; |
12 | 12 | import org.testng.ITestResult; |
| 13 | +import org.testng.SkipException; |
13 | 14 | import org.testng.annotations.AfterMethod; |
14 | 15 | import org.testng.annotations.AfterTest; |
15 | 16 | import org.testng.annotations.BeforeMethod; |
|
20 | 21 | import java.lang.reflect.Method; |
21 | 22 |
|
22 | 23 | import static com.github.dockerjava.test.serdes.JSONSamples.testRoundTrip; |
| 24 | +import static com.github.dockerjava.utils.TestUtils.getVersion; |
23 | 25 | import static org.hamcrest.CoreMatchers.is; |
24 | 26 | import static org.hamcrest.MatcherAssert.assertThat; |
25 | 27 | import static org.hamcrest.collection.IsCollectionWithSize.hasSize; |
@@ -55,14 +57,19 @@ public void afterMethod(ITestResult result) { |
55 | 57 |
|
56 | 58 | @Test(groups = "ignoreInCircleCi") |
57 | 59 | public void updateContainer() throws DockerException, IOException { |
| 60 | + final RemoteApiVersion apiVersion = getVersion(dockerClient); |
| 61 | + |
| 62 | + if (!apiVersion.isGreaterOrEqual(RemoteApiVersion.VERSION_1_22)) { |
| 63 | + throw new SkipException("API version should be >= 1.22"); |
| 64 | + } |
| 65 | + |
58 | 66 | CreateContainerResponse response = dockerClient.createContainerCmd(BUSYBOX_IMAGE) |
59 | 67 | .withCmd("sleep", "9999") |
60 | 68 | .exec(); |
61 | 69 | String containerId = response.getId(); |
62 | 70 | dockerClient.startContainerCmd(containerId).exec(); |
63 | 71 |
|
64 | 72 | InspectContainerResponse inspectBefore = dockerClient.inspectContainerCmd(containerId).exec(); |
65 | | - final HostConfig beforeHostConfig = inspectBefore.getHostConfig(); |
66 | 73 |
|
67 | 74 | final UpdateContainerResponse updateResponse = dockerClient.updateContainerCmd(containerId) |
68 | 75 | .withBlkioWeight(300) |
|
0 commit comments