forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListNetworksCmdIT.java
More file actions
30 lines (21 loc) · 992 Bytes
/
Copy pathListNetworksCmdIT.java
File metadata and controls
30 lines (21 loc) · 992 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
package com.github.dockerjava.cmd;
import com.github.dockerjava.api.exception.DockerException;
import com.github.dockerjava.api.model.Network;
import com.github.dockerjava.utils.TestUtils;
import org.junit.Test;
import java.util.List;
import static com.github.dockerjava.junit.DockerAssume.assumeNotSwarm;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
public class ListNetworksCmdIT extends CmdIT {
@Test
public void listNetworks() throws DockerException {
assumeNotSwarm("Swarm has no network", dockerRule);
List<Network> networks = dockerRule.getClient().listNetworksCmd().exec();
Network network = TestUtils.findNetwork(networks, "bridge");
assertThat(network.getName(), equalTo("bridge"));
assertThat(network.getScope(), equalTo("local"));
assertThat(network.getDriver(), equalTo("bridge"));
assertThat(network.getIpam().getDriver(), equalTo("default"));
}
}