use of com.apollographql.apollo.integration.normalizer.CharacterDetailsQuery in project apollo-android by apollographql.
the class NormalizedCacheTestCase method masterDetailFailIncomplete.
@Test
public void masterDetailFailIncomplete() throws Exception {
enqueueAndAssertResponse(server, "HeroAndFriendsNameWithIdsResponse.json", apolloClient.query(new HeroAndFriendsNamesWithIDsQuery(Input.fromNullable(Episode.NEWHOPE))).responseFetcher(NETWORK_ONLY), new Predicate<Response<HeroAndFriendsNamesWithIDsQuery.Data>>() {
@Override
public boolean test(Response<HeroAndFriendsNamesWithIDsQuery.Data> response) throws Exception {
return !response.hasErrors();
}
});
assertResponse(apolloClient.query(new CharacterDetailsQuery("1002")).responseFetcher(CACHE_ONLY), new Predicate<Response<CharacterDetailsQuery.Data>>() {
@Override
public boolean test(Response<CharacterDetailsQuery.Data> response) throws Exception {
assertThat(response.data()).isNull();
return true;
}
});
}
Aggregations