@Test public void shouldUseProvidedInternalHostOnRetrievalOfExternalAddresses() throws Exception { Map<String, List<PortBinding>> exposedPorts = new HashMap<>(); exposedPorts.put( "8080/tcp", singletonList(new PortBinding().withHostIp("127.0.0.1").withHostPort("32789"))); exposedPorts.put( "9090/udp", singletonList(new PortBinding().withHostIp("192.168.0.1").withHostPort("20000"))); when(networkSettings.getPorts()).thenReturn(exposedPorts); Map<String, String> externalAddressesAndPorts = strategy.getExternalAddressesAndPorts(containerInfo, HOST); for (Map.Entry<String, List<PortBinding>> entry : exposedPorts.entrySet()) { assertEquals( externalAddressesAndPorts.get(entry.getKey()), HOST + ":" + entry.getValue().get(0).getHostPort()); } }
@Override protected Map<String, String> getExternalAddressesAndPorts( ContainerInfo containerInfo, String internalHost) { return getInternalAddressesAndPorts(containerInfo, internalHost); }
CodenvyDockerServerEvaluationStrategy extends ServerEvaluationStrategy { @Override protected Map<String, String> getExternalAddressesAndPorts( ContainerInfo containerInfo, String internalHost) { return getInternalAddressesAndPorts(containerInfo, internalHost); } }
CodenvyDockerServerEvaluationStrategy extends ServerEvaluationStrategy { @Override protected Map<String, String> getExternalAddressesAndPorts( ContainerInfo containerInfo, String internalHost) { return getInternalAddressesAndPorts(containerInfo, internalHost); }  }
CodenvyDockerServerEvaluationStrategy extends ServerEvaluationStrategy { @Override protected Map<String, String> getExternalAddressesAndPorts( ContainerInfo containerInfo, String internalHost) { return getInternalAddressesAndPorts(containerInfo, internalHost); }   }
CodenvyDockerServerEvaluationStrategy extends ServerEvaluationStrategy { @Override protected Map<String, String> getExternalAddressesAndPorts( ContainerInfo containerInfo, String internalHost) { return getInternalAddressesAndPorts(containerInfo, internalHost); }    }