org.testcontainers.containers.Network.builder()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.testcontainers.containers.Network.builder()方法的一些代码示例,展示了Network.builder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.builder()方法的具体详情如下:
包路径:org.testcontainers.containers.Network
类名称:Network
方法名:builder

Network.builder介绍

暂无

代码示例

代码示例来源:origin: testcontainers/testcontainers-java

static Network newNetwork() {
  return builder().build();
}

代码示例来源:origin: testcontainers/testcontainers-java

@Test
public void testBuilder() throws Exception {
  try (
      Network network = Network.builder()
          .driver("macvlan")
          .build();
  ) {
    String id = network.getId();
    assertEquals(
        "Flag is set",
        "macvlan",
        DockerClientFactory.instance().client().inspectNetworkCmd().withNetworkId(id).exec().getDriver()
    );
  }
}

代码示例来源:origin: testcontainers/testcontainers-java

@Test
public void testModifiers() throws Exception {
  try (
      Network network = Network.builder()
          .createNetworkCmdModifier(cmd -> cmd.withDriver("macvlan"))
          .build();
  ) {
    String id = network.getId();
    assertEquals(
        "Flag is set",
        "macvlan",
        DockerClientFactory.instance().client().inspectNetworkCmd().withNetworkId(id).exec().getDriver()
    );
  }
}

代码示例来源:origin: org.testcontainers/testcontainers

static NetworkImpl.NetworkImplBuilder builder() {
  return NetworkImpl.builder();
}

代码示例来源:origin: org.testcontainers/testcontainers

static Network newNetwork() {
  return builder().build();
}

代码示例来源:origin: etcd-io/jetcd

public static EtcdCluster buildCluster(@NonNull String clusterName, int nodes, boolean ssl, boolean restartable) {
 final Network network = Network.builder().id(clusterName).build();
 final CountDownLatch latch = new CountDownLatch(nodes);
 final EtcdContainer.LifecycleListener listener = new EtcdContainer.LifecycleListener() {

代码示例来源:origin: io.etcd/jetcd-launcher

public static EtcdCluster buildCluster(@NonNull String clusterName, int nodes, boolean ssl, boolean restartable) {
 final Network network = Network.builder().id(clusterName).build();
 final CountDownLatch latch = new CountDownLatch(nodes);
 final EtcdContainer.LifecycleListener listener = new EtcdContainer.LifecycleListener() {

代码示例来源:origin: com.github.mxsm/jetcd-launcher

public static EtcdCluster buildCluster(@NonNull String clusterName, int nodes, boolean ssl, boolean restartable) {
 final Network network = Network.builder().id(clusterName).build();
 final CountDownLatch latch = new CountDownLatch(nodes);
 final EtcdContainer.LifecycleListener listener = new EtcdContainer.LifecycleListener() {

代码示例来源:origin: jurmous/etcd4j

public static EtcdCluster buildCluster(String clusterName, int nodes, boolean ssl) {
  final Network network = Network.builder().id(clusterName).build();
  final CountDownLatch latch = new CountDownLatch(nodes);
  final EtcdContainer.LifecycleListener listener = new EtcdContainer.LifecycleListener() {

相关文章