Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit 3060fc9

Browse files
author
Fabian Zeller
committed
configured tests
1 parent 0ca7afa commit 3060fc9

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

src/main/java/com/sybit/airtable/Airtable.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,15 @@ public Airtable configure(Configuration config, ObjectMapper objectMapper) throw
180180
* @param proxy
181181
*/
182182
public void setProxy(String proxy) {
183-
if (proxy != null && !proxy.isEmpty() && !proxy.equals(" ")) {
183+
184+
if (proxy == null) {
185+
this.config.setProxy(proxy);
186+
Unirest.setProxy(null);
187+
} else {
184188
this.config.setProxy(proxy);
189+
Unirest.setProxy(HttpHost.create(this.config.getProxy()));
185190
}
186-
Unirest.setProxy(HttpHost.create(this.config.getProxy()));
191+
187192
}
188193

189194
/**
@@ -202,18 +207,22 @@ private void configureProxy(String endpointUrl) {
202207
&& (endpointUrl.contains("127.0.0.1")
203208
|| endpointUrl.contains("localhost"))) {
204209
LOG.info("Use Proxy: ignored for 'localhost' ann '127.0.0.1'");
205-
this.config.setProxy(null);
210+
setProxy(null);
206211
} else if (httpsProxy != null
207212
&& (endpointUrl.contains("https"))) {
208213
LOG.info("Use Proxy: Environment variable 'https_proxy' found and used: " + httpsProxy);
209-
this.config.setProxy(httpProxy);
214+
setProxy(httpProxy);
210215
} else if (httpProxy != null
211216
&& (endpointUrl.contains("http"))) {
212217
LOG.info("Use Proxy: Environment variable 'http_proxy' found and used: " + httpProxy);
213-
this.config.setProxy(httpsProxy);
218+
setProxy(httpsProxy);
214219
} else {
215-
this.config.setProxy(null);
220+
setProxy(null);
216221
}
222+
} else if ((endpointUrl.contains("127.0.0.1")
223+
|| endpointUrl.contains("localhost"))) {
224+
LOG.info("Use Proxy: ignored for 'localhost' ann '127.0.0.1'");
225+
setProxy(null);
217226
}
218227
}
219228

src/test/java/com/sybit/airtable/BaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class BaseTest {
2323
@Before
2424
public void before() throws AirtableException{
2525

26-
this.airtable = new Airtable().configure(new Configuration("123","url",null));
26+
this.airtable = new Airtable().configure(new Configuration("123","https://url",null));
2727

2828

2929
}

src/test/java/com/sybit/airtable/TableTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class TableTest {
2323
@Before
2424
public void before() throws AirtableException{
2525

26-
Airtable airtable = new Airtable().configure(new Configuration("123","url",null));
26+
Airtable airtable = new Airtable().configure(new Configuration("123","https://url",null));
2727
this.base = new Base("base", airtable);
2828

2929
}

0 commit comments

Comments
 (0)