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