Remove unnecessary unit test.
@@ -4061,62 +4061,6 @@ public class DefaultDockerClientTest {
}
- @Test
- public void testNetworksConnectContainerWithoutForcefulDisconnectNetwork() throws Exception {
- requireDockerApiVersionAtLeast("1.21", "createNetwork and listNetworks");
- assumeFalse(CIRCLECI);
-
- sut.pull(BUSYBOX_LATEST);
- final String networkName = randomName();
- final String containerName = randomName();
- final NetworkCreation networkCreation =
- sut.createNetwork(NetworkConfig.builder().name(networkName).build());
- assertThat(networkCreation.id(), is(notNullValue()));
- final ContainerConfig containerConfig =
- ContainerConfig.builder().image(BUSYBOX_LATEST).cmd("sh", "-c", "while :; do sleep 1; done")
- .build();
- final ContainerCreation containerCreation = sut.createContainer(containerConfig, containerName);
- assertThat(containerCreation.id(), is(notNullValue()));
- sut.startContainer(containerCreation.id());
- sut.connectToNetwork(containerCreation.id(), networkCreation.id());
-
- Network network = sut.inspectNetwork(networkCreation.id());
- assertThat(network.containers().size(), equalTo(1));
- final Network.Container container = network.containers().get(containerCreation.id());
- assertThat(container, notNullValue());
- if (dockerApiVersionAtLeast("1.22")) {
- assertThat(container.name(), notNullValue());
- }
- assertThat(container.macAddress(), notNullValue());
- assertThat(container.ipv4Address(), notNullValue());
- assertThat(container.ipv6Address(), notNullValue());
-
- final ContainerInfo containerInfo = sut.inspectContainer(containerCreation.id());
- assertThat(containerInfo.networkSettings().networks().size(), is(2));
- final AttachedNetwork attachedNetwork =
- containerInfo.networkSettings().networks().get(networkName);
- assertThat(attachedNetwork, is(notNullValue()));
- if (dockerApiVersionAtLeast("1.22")) {
- assertThat(attachedNetwork.networkId(), is(notNullValue()));
- }
- assertThat(attachedNetwork.endpointId(), is(notNullValue()));
- assertThat(attachedNetwork.gateway(), is(notNullValue()));
- assertThat(attachedNetwork.ipAddress(), is(notNullValue()));
- assertThat(attachedNetwork.ipPrefixLen(), is(notNullValue()));
- assertThat(attachedNetwork.macAddress(), is(notNullValue()));
- assertThat(attachedNetwork.ipv6Gateway(), is(notNullValue()));
- assertThat(attachedNetwork.globalIPv6Address(), is(notNullValue()));
- assertThat(attachedNetwork.globalIPv6PrefixLen(), greaterThanOrEqualTo(0));
- sut.disconnectFromNetwork(containerCreation.id(), networkCreation.id(), true);
- network = sut.inspectNetwork(networkCreation.id());
- assertThat(network.containers().size(), equalTo(0));
-
- sut.stopContainer(containerCreation.id(), 1);
- sut.removeContainer(containerCreation.id());
- sut.removeNetwork(networkCreation.id());
-
- }
-
@Test
public void testNetworksConnectContainerWithEndpointConfig() throws Exception {
requireDockerApiVersionAtLeast("1.22", "createNetwork and listNetworks");
