forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInspectNetworkCmdIT.java
More file actions
32 lines (23 loc) · 1.27 KB
/
Copy pathInspectNetworkCmdIT.java
File metadata and controls
32 lines (23 loc) · 1.27 KB
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
package com.github.dockerjava.cmd;
import com.github.dockerjava.api.exception.DockerException;
import com.github.dockerjava.api.model.Network;
import org.junit.Test;
import java.util.List;
import static com.github.dockerjava.junit.DockerAssume.assumeNotSwarm;
import static com.github.dockerjava.utils.TestUtils.findNetwork;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
public class InspectNetworkCmdIT extends CmdIT {
@Test
public void inspectNetwork() throws DockerException {
assumeNotSwarm("no network in swarm", dockerRule);
List<Network> networks = dockerRule.getClient().listNetworksCmd().exec();
Network expected = findNetwork(networks, "bridge");
Network network = dockerRule.getClient().inspectNetworkCmd().withNetworkId(expected.getId()).exec();
assertThat(network.getName(), equalTo(expected.getName()));
assertThat(network.getScope(), equalTo(expected.getScope()));
assertThat(network.getDriver(), equalTo(expected.getDriver()));
assertThat(network.getIpam().getConfig().get(0).getSubnet(), equalTo(expected.getIpam().getConfig().get(0).getSubnet()));
assertThat(network.getIpam().getDriver(), equalTo(expected.getIpam().getDriver()));
}
}