@Test public void shouldNotSetTlsVerifyForTcpSchemeOnLinux() { CubeDockerConfigurationResolver resolver = new CubeDockerConfigurationResolver(new Top(), new DockerMachine(null), new Boot2Docker(null), mockDefaultDocker(), operatingSystemInterface); when(infoCmd.exec()).thenThrow(new ProcessingException("test exception")); String sockUri = "unix: when(defaultOperatingSystemFamilyInterface.getServerUri()).thenReturn(sockUri); when(operatingSystemInterface.getDefaultFamily()).thenReturn(defaultOperatingSystemFamilyInterface); when(operatingSystemInterface.getFamily()).thenReturn(OperatingSystem.LINUX_OS.getFamily()); Map<String, String> config = new HashMap<>(); config.put(CubeDockerConfiguration.DOCKER_URI, "tcp: Map<String, String> resolvedConfig = resolver.resolve(config); assertThat(Boolean.valueOf(resolvedConfig.get(CubeDockerConfiguration.TLS_VERIFY)), is(false)); assertThat(resolvedConfig.get(CubeDockerConfiguration.CERT_PATH), is(nullValue())); }
public Map<String, String> resolve(Map<String, String> config) { config = resolveSystemEnvironmentVariables(config); config = resolveSystemDefaultSetup(config); config = resolveDockerInsideDocker(config); config = resolveDownloadDockerMachine(config); config = resolveAutoStartDockerMachine(config); config = resolveDefaultDockerMachine(config); config = resolveServerUriByOperativeSystem(config); config = resolveServerIp(config); config = resolveTlsVerification(config); return config; }
CubeDockerConfigurationResolver { public Map<String, String> resolve(Map<String, String> config) { config = resolveSystemEnvironmentVariables(config); config = resolveSystemDefaultSetup(config); config = resolveDockerInsideDocker(config); config = resolveDownloadDockerMachine(config); config = resolveAutoStartDockerMachine(config); config = resolveDefaultDockerMachine(config); config = resolveServerUriByOperativeSystem(config); config = resolveServerIp(config); config = resolveTlsVerification(config); return config; } }
CubeDockerConfigurationResolver { public Map<String, String> resolve(Map<String, String> config) { config = resolveSystemEnvironmentVariables(config); config = resolveSystemDefaultSetup(config); config = resolveDockerInsideDocker(config); config = resolveDownloadDockerMachine(config); config = resolveAutoStartDockerMachine(config); config = resolveDefaultDockerMachine(config); config = resolveServerUriByOperativeSystem(config); config = resolveServerIp(config); config = resolveTlsVerification(config); return config; } CubeDockerConfigurationResolver(Top top, DockerMachine dockerMachine, Boot2Docker boot2Docker,
                                           DefaultDocker defaultDocker, OperatingSystemInterface operatingSystem); }
CubeDockerConfigurationResolver { public Map<String, String> resolve(Map<String, String> config) { config = resolveSystemEnvironmentVariables(config); config = resolveSystemDefaultSetup(config); config = resolveDockerInsideDocker(config); config = resolveDownloadDockerMachine(config); config = resolveAutoStartDockerMachine(config); config = resolveDefaultDockerMachine(config); config = resolveServerUriByOperativeSystem(config); config = resolveServerIp(config); config = resolveTlsVerification(config); return config; } CubeDockerConfigurationResolver(Top top, DockerMachine dockerMachine, Boot2Docker boot2Docker,
                                           DefaultDocker defaultDocker, OperatingSystemInterface operatingSystem); Map<String, String> resolve(Map<String, String> config); }
CubeDockerConfigurationResolver { public Map<String, String> resolve(Map<String, String> config) { config = resolveSystemEnvironmentVariables(config); config = resolveSystemDefaultSetup(config); config = resolveDockerInsideDocker(config); config = resolveDownloadDockerMachine(config); config = resolveAutoStartDockerMachine(config); config = resolveDefaultDockerMachine(config); config = resolveServerUriByOperativeSystem(config); config = resolveServerIp(config); config = resolveTlsVerification(config); return config; } CubeDockerConfigurationResolver(Top top, DockerMachine dockerMachine, Boot2Docker boot2Docker,
                                           DefaultDocker defaultDocker, OperatingSystemInterface operatingSystem); Map<String, String> resolve(Map<String, String> config);  }