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

Commit 5cc333f

Browse files
author
kobisuissa
committed
Merge branch 'develop' of https://github.com/hubrick/airtable.java into feature/allow-object-mapper-injection
# Conflicts: # .travis.yml # build.gradle # src/main/java/com/sybit/airtable/Airtable.java
1 parent 2716c59 commit 5cc333f

7 files changed

Lines changed: 15 additions & 507 deletions

File tree

src/test/java/com/sybit/airtable/TableSelectJacksonOMTest.java renamed to src/itest/java/com/sybit/airtable/TableSelectJacksonOMTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.sybit.airtable.exception.AirtableException;
66
import com.sybit.airtable.movies.ActorSerializedNames;
77
import com.sybit.airtable.movies.Movie;
8-
import com.sybit.airtable.test.WireMockBaseTest;
8+
import com.sybit.airtable.mock.WireMockBaseTest;
99
import org.apache.http.client.HttpResponseException;
1010
import org.junit.Before;
1111
import org.junit.Test;

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,19 @@ public Airtable configure(String apiKey, ObjectMapper objectMapper) throws Airta
122122
* @throws com.sybit.airtable.exception.AirtableException Missing API-Key or Endpoint
123123
*/
124124
@SuppressWarnings("WeakerAccess")
125+
public Airtable configure(Configuration config) throws AirtableException {
126+
return configure(config, new GsonObjectMapper());
127+
}
128+
129+
130+
/**
131+
*
132+
* @param config
133+
* @param objectMapper A custom ObjectMapper implementation
134+
* @return
135+
* @throws com.sybit.airtable.exception.AirtableException Missing API-Key or Endpoint
136+
*/
137+
@SuppressWarnings("WeakerAccess")
125138
public Airtable configure(Configuration config, ObjectMapper objectMapper) throws AirtableException {
126139
if(config.getApiKey() == null) {
127140
throw new AirtableException("Missing Airtable API-Key");
@@ -140,7 +153,7 @@ public Airtable configure(Configuration config, ObjectMapper objectMapper) throw
140153
setProxy(config.getEndpointUrl());
141154

142155
// Only one time
143-
Unirest.setObjectMapper(new GsonObjectMapper());
156+
Unirest.setObjectMapper(objectMapper);
144157

145158
// Add specific Converter for Date
146159
DateTimeConverter dtConverter = new DateConverter();

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

Lines changed: 0 additions & 94 deletions
This file was deleted.

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

Lines changed: 0 additions & 153 deletions
This file was deleted.

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

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)