use of com.apollographql.apollo.api.internal.Optional in project apollo-android by apollographql.
the class ApolloWatcherTest method setUp.
@Before
public void setUp() throws IOException {
OkHttpClient okHttpClient = new OkHttpClient.Builder().dispatcher(new Dispatcher(Utils.immediateExecutorService())).build();
apolloClient = ApolloClient.builder().serverUrl(server.url("/")).dispatcher(immediateExecutor()).okHttpClient(okHttpClient).logger(new Logger() {
@Override
public void log(int priority, @Nonnull String message, @Nonnull Optional<Throwable> t, @Nonnull Object... args) {
String throwableTrace = "";
if (t.isPresent()) {
throwableTrace = t.get().getMessage();
}
System.out.println(String.format(message, args) + " " + throwableTrace);
}
}).normalizedCache(new LruNormalizedCacheFactory(EvictionPolicy.NO_EVICTION), new IdFieldCacheKeyResolver()).build();
}
Aggregations