PumbaStandaloneContainerHandler implements StandaloneManager { @Override public StandaloneContainer install() { StandaloneContainer.Builder builder = StandaloneContainer.create(); if (isNativeDocker()) { builder.volumes(Collections.singletonList("/var/run/docker.sock:/var/run/docker.sock")); } else { final CubeDockerConfiguration cubeDockerConfiguration = cubeDockerConfigurationInstance.get(); builder.volumes(Collections.singletonList(cubeDockerConfiguration.getCertPath() + ":/etc/ssl/docker")); } return builder.build(); }  @Override StandaloneContainer install();  }
@Test public void shouldAddUnixVolume() { when(cubeDockerConfiguration.getDockerServerUri()).thenReturn("unix: PumbaStandaloneContainerHandler pumbaStandaloneContainerHandler = new PumbaStandaloneContainerHandler(); pumbaStandaloneContainerHandler.cubeDockerConfigurationInstance = () -> cubeDockerConfiguration; final StandaloneContainer install = pumbaStandaloneContainerHandler.install(); assertThat(install.getCube().getBinds()).contains("/var/run/docker.sock:/var/run/docker.sock"); }
@Test public void shouldAddCertsVolume() { when(cubeDockerConfiguration.getDockerServerUri()).thenReturn("https: when(cubeDockerConfiguration.getCertPath()).thenReturn("/home/user/.machine/ssl"); PumbaStandaloneContainerHandler pumbaStandaloneContainerHandler = new PumbaStandaloneContainerHandler(); pumbaStandaloneContainerHandler.cubeDockerConfigurationInstance = () -> cubeDockerConfiguration; final StandaloneContainer install = pumbaStandaloneContainerHandler.install(); assertThat(install.getCube().getBinds()).contains("/home/user/.machine/ssl:/etc/ssl/docker"); }