use of com.apollographql.apollo.integration.normalizer.SameHeroTwiceQuery in project apollo-android by apollographql.
the class ResponseNormalizationTest method testSameHeroTwiceQuery.
@Test
public void testSameHeroTwiceQuery() throws Exception {
assertHasNoErrors("SameHeroTwiceResponse.json", new SameHeroTwiceQuery());
Record record = normalizedCache.loadRecord(QUERY_ROOT_KEY, CacheHeaders.NONE);
CacheReference heroReference = (CacheReference) record.field("hero");
final Record hero = normalizedCache.loadRecord(heroReference.key(), CacheHeaders.NONE);
assertThat(hero.field("name")).isEqualTo("R2-D2");
assertThat(hero.field("appearsIn")).isEqualTo(Arrays.asList("NEWHOPE", "EMPIRE", "JEDI"));
}
Aggregations