Skip to content

Commit a14ce79

Browse files
author
Karl Rieb
committed
Add test for Void data type deserialization.
1 parent 0031ac6 commit a14ce79

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/main/java/com/dropbox/core/babel/BabelSerializers.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ public void serialize(Void value, JsonGenerator g) throws IOException, JsonGener
209209

210210
@Override
211211
public Void deserialize(JsonParser p) throws IOException, JsonParseException {
212+
skipValue(p);
212213
return null;
213214
}
214215
}

src/test/java/com/dropbox/core/babel/BabelSerializersTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ public void testV2BadShortTimestamp() throws Exception {
6262
BabelSerializers.timestamp().deserialize(quoted("2016/03/08"));
6363
}
6464

65+
@Test
66+
public void testDeserializeNonEmptyVoidType() throws Exception {
67+
BabelSerializers.void_().deserialize("{\".tag\":\"foo\"}");
68+
BabelSerializers.void_().deserialize(quoted("bar"));
69+
}
70+
6571
private static String quoted(String value) {
6672
return "\"" + value + "\"";
6773
}

0 commit comments

Comments
 (0)