use of email.schaal.ocreader.api.json.FeedTypeAdapter in project ocreader by schaal.
the class JsonTest method TestJsonWithUnexpectedNull.
@Test
public void TestJsonWithUnexpectedNull() throws IOException {
Moshi moshi = new Moshi.Builder().add(Feed.class, new FeedTypeAdapter()).build();
String feedJson = "{\"id\":28,\"url\":\"http://rss.slashdot.org/Slashdot/slashdot\",\"title\":\"Slashdot\",\"faviconLink\":null,\"added\":1435334890,\"folderId\":0,\"unreadCount\":1093,\"ordering\":null,\"link\":\"http://slashdot.org/\",\"pinned\":false}";
Feed feed = moshi.adapter(Feed.class).fromJson(feedJson);
assertNull(feed.getFaviconLink());
}
Aggregations