FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add Network create attribute by juanmolle · Pull Request #2344 · docker-java/docker-java · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (3) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;

Expand All @@ -18,6 +19,9 @@ public class Network extends DockerObject implements Serializable {
@JsonProperty("Id")
private String id;

@JsonProperty("Created")
private Date created;

@JsonProperty("Name")
private String name;

Expand Down Expand Up @@ -52,6 +56,10 @@ public String getId() {
return id;
}

public Date getCreated() {
return created;
}

public String getName() {
return name;
}
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import static com.github.dockerjava.junit.DockerMatchers.isGreaterOrEqual;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeThat;

Expand All @@ -37,6 +39,7 @@ public void createNetwork() throws DockerException {
Network network = dockerRule.getClient().inspectNetworkCmd().withNetworkId(createNetworkResponse.getId()).exec();
assertThat(network.getName(), is(networkName));
assertThat(network.getDriver(), is("bridge"));
assertThat(network.getCreated().getTime(), greaterThan(0L));
}

@Test
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import static com.github.dockerjava.utils.TestUtils.findNetwork;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;

public class InspectNetworkCmdIT extends CmdIT {

Expand All @@ -28,5 +29,6 @@ public void inspectNetwork() throws DockerException {
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()));
assertThat(network.getCreated().getTime(), greaterThan(0L));
}
}

Back | FazBrowse Home | New Git URL