|
93 | 93 | import java.nio.file.Paths;
|
94 | 94 | import java.sql.Date;
|
95 | 95 | import java.time.Instant;
|
| 96 | +import java.util.Arrays; |
96 | 97 | import java.util.HashSet;
|
97 | 98 | import java.util.List;
|
98 | 99 | import java.util.Set;
|
@@ -203,12 +204,27 @@ public void testHostWithNonProxyHost() {
|
203 | 204 | try {
|
204 | 205 | System.setProperty("http.proxyHost", "gmodules.com");
|
205 | 206 | System.setProperty("http.proxyPort", "80");
|
206 |
| - System.setProperty("http.nonProxyHosts", "127.0.0.1|localhost|192.168.*"); |
207 |
| - final DefaultDockerClient client = DefaultDockerClient.builder() |
208 |
| - .uri("https://192.168.53.103:2375").build(); |
209 |
| - assertThat((String) client.getClient().getConfiguration() |
210 |
| - .getProperty("jersey.config.client.proxy.uri"), |
211 |
| - isEmptyOrNullString()); |
| 207 | + final String nonProxyHostsPropertyValue = "127.0.0.1|localhost|192.168.*"; |
| 208 | + final List<String> nonProxyHostsPropertyValues = Arrays.asList( |
| 209 | + nonProxyHostsPropertyValue, "\"" + nonProxyHostsPropertyValue + "\""); |
| 210 | + for (String value : nonProxyHostsPropertyValues) { |
| 211 | + System.setProperty("http.nonProxyHosts", value); |
| 212 | + final DefaultDockerClient client = DefaultDockerClient.builder() |
| 213 | + .uri("https://192.168.53.103:2375").build(); |
| 214 | + assertThat((String) client.getClient().getConfiguration() |
| 215 | + .getProperty("jersey.config.client.proxy.uri"), |
| 216 | + isEmptyOrNullString()); |
| 217 | + final DefaultDockerClient client1 = DefaultDockerClient.builder() |
| 218 | + .uri("https://127.0.0.1:2375").build(); |
| 219 | + assertThat((String) client1.getClient().getConfiguration() |
| 220 | + .getProperty("jersey.config.client.proxy.uri"), |
| 221 | + isEmptyOrNullString()); |
| 222 | + final DefaultDockerClient client2 = DefaultDockerClient.builder() |
| 223 | + .uri("https://localhost:2375").build(); |
| 224 | + assertThat((String) client2.getClient().getConfiguration() |
| 225 | + .getProperty("jersey.config.client.proxy.uri"), |
| 226 | + isEmptyOrNullString()); |
| 227 | + } |
212 | 228 | } finally {
|
213 | 229 | System.clearProperty("http.proxyHost");
|
214 | 230 | System.clearProperty("http.proxyPort");
|
|
0 commit comments