use of saulmm.avengers.entities.CollectionItem in project Avengers by saulmm.
the class GsonDeserializersTest method testThatACollectionDeserialzierDeserializesACollection.
@Test
public void testThatACollectionDeserialzierDeserializesACollection() throws Exception {
MarvelResultsDeserializer<CollectionItem> marvelResultsDeserializer = new MarvelResultsDeserializer<>();
JsonElement collectionElement = new JsonParser().parse(getComicsCollectionJsonString());
Type t = new TypeToken<List<CollectionItem>>() {
}.getType();
List<CollectionItem> collectionList = marvelResultsDeserializer.deserialize(collectionElement, t, mock(JsonDeserializationContext.class));
assertThat(collectionList.isEmpty(), is(false));
assertNotNull(collectionList.get(0).getThumbnail());
}
Aggregations