summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-05-10 17:30:49 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-05-10 17:30:49 +0200
commitbb7e2b32ef5ef531ac3f007c09206c4a9db32ca9 (patch)
tree45db33608d033749b71cd5e6862c31face26e88a /test
parenta4db85de038f3d07bd379ddaf37bc7815c37b28b (diff)
downloadDatafiller-bb7e2b32ef5ef531ac3f007c09206c4a9db32ca9.tar.gz
Centralize Gson creation and registration
Diffstat (limited to 'test')
-rw-r--r--test/data/ValidatingJsonDeserializerTest.java7
1 files changed, 1 insertions, 6 deletions
diff --git a/test/data/ValidatingJsonDeserializerTest.java b/test/data/ValidatingJsonDeserializerTest.java
index b51631a..73523f4 100644
--- a/test/data/ValidatingJsonDeserializerTest.java
+++ b/test/data/ValidatingJsonDeserializerTest.java
@@ -1,7 +1,6 @@
package data;
import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonNull;
@@ -278,9 +277,7 @@ public class ValidatingJsonDeserializerTest {
+ "}";
private Object deserializeJson(String json, Class cls) {
- Gson gson = new GsonBuilder()
- .registerTypeAdapter(cls, new ValidatingJsonDeserializer<>())
- .create();
+ Gson gson = TwitterJsonDeserializer.getGsonBuilder().create();
return gson.fromJson(json, cls);
}
@@ -312,8 +309,6 @@ public class ValidatingJsonDeserializerTest {
@Test
public void testDeserializeTweet() {
Tweet tweet = (Tweet) deserializeJson(exampleTweet, Tweet.class);
- Gson gson = new GsonBuilder().setPrettyPrinting().create();
- //System.out.println(gson.toJson(tweet));
assertEquals(461441338630619136L, tweet.id);
assertNotNull(tweet.retweeted_status);
assertEquals("Wed Apr 30 09:46:02 +0000 2014", tweet.created_at);