use of mockwebserver3.Dispatcher in project apollo-android by apollographql.
the class OptimisticCacheTestCase method setUp.
@Before
public void setUp() {
OkHttpClient okHttpClient = new OkHttpClient.Builder().dispatcher(new Dispatcher(Utils.immediateExecutorService())).build();
apolloClient = ApolloClient.builder().serverUrl(server.url("/")).okHttpClient(okHttpClient).normalizedCache(new LruNormalizedCacheFactory(EvictionPolicy.NO_EVICTION), new IdFieldCacheKeyResolver()).dispatcher(Utils.immediateExecutor()).build();
}
use of mockwebserver3.Dispatcher in project apollo-android by apollographql.
the class ResponseWriteTestCase method setUp.
@Before
public void setUp() {
OkHttpClient okHttpClient = new OkHttpClient.Builder().dispatcher(new Dispatcher(Utils.immediateExecutorService())).build();
apolloClient = ApolloClient.builder().serverUrl(server.url("/")).okHttpClient(okHttpClient).normalizedCache(new LruNormalizedCacheFactory(EvictionPolicy.NO_EVICTION), new IdFieldCacheKeyResolver()).dispatcher(Utils.immediateExecutor()).addCustomTypeAdapter(CustomType.DATE, new CustomTypeAdapter<Date>() {
@Override
public Date decode(CustomTypeValue value) {
try {
return DATE_TIME_FORMAT.parse(value.value.toString());
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
@Override
public CustomTypeValue encode(Date value) {
return new CustomTypeValue.GraphQLString(DATE_TIME_FORMAT.format(value));
}
}).build();
}
use of mockwebserver3.Dispatcher in project apollo-android by apollographql.
the class RxApolloTest method setup.
@Before
public void setup() {
OkHttpClient okHttpClient = new OkHttpClient.Builder().dispatcher(new Dispatcher(Utils.immediateExecutorService())).build();
apolloClient = ApolloClient.builder().serverUrl(server.url("/")).okHttpClient(okHttpClient).dispatcher(Utils.immediateExecutor()).normalizedCache(new LruNormalizedCacheFactory(EvictionPolicy.NO_EVICTION), new IdFieldCacheKeyResolver()).build();
}
use of mockwebserver3.Dispatcher in project apollo-android by apollographql.
the class NormalizedCacheTestCase method setUp.
@Before
public void setUp() {
OkHttpClient okHttpClient = new OkHttpClient.Builder().writeTimeout(2, TimeUnit.SECONDS).readTimeout(2, TimeUnit.SECONDS).dispatcher(new Dispatcher(Utils.immediateExecutorService())).build();
apolloClient = ApolloClient.builder().serverUrl(server.url("/")).okHttpClient(okHttpClient).normalizedCache(new LruNormalizedCacheFactory(EvictionPolicy.NO_EVICTION), new IdFieldCacheKeyResolver()).dispatcher(Utils.immediateExecutor()).build();
}
use of mockwebserver3.Dispatcher in project apollo-android by apollographql.
the class Rx2ApolloTest method setup.
@Before
public void setup() {
OkHttpClient okHttpClient = new OkHttpClient.Builder().dispatcher(new Dispatcher(immediateExecutorService())).build();
apolloClient = ApolloClient.builder().serverUrl(server.url("/")).dispatcher(immediateExecutor()).okHttpClient(okHttpClient).normalizedCache(new LruNormalizedCacheFactory(EvictionPolicy.NO_EVICTION), new IdFieldCacheKeyResolver()).build();
}
Aggregations