@Test public void createClient_setsSessionAndLoggingInterceptor() { HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(); OkHttpClient client = UberRidesApi.with(session) .createClient(new OkHttpClient(), session, loggingInterceptor); assertEquals(authenticator, ((RefreshAuthenticator) client.authenticator()).authenticator); for (Interceptor interceptor : client.interceptors()) { if (interceptor instanceof ApiInterceptor) { assertEquals(authenticator, ((ApiInterceptor)interceptor).authenticator); } else if (interceptor instanceof HttpLoggingInterceptor){ assertEquals(loggingInterceptor, interceptor); } else { fail("Interceptors did not match expected ones"); } } }
@Nonnull public static Builder with(@Nonnull Session session) { return new Builder(session); }
UberRidesApi { @Nonnull public static Builder with(@Nonnull Session session) { return new Builder(session); } }
UberRidesApi { @Nonnull public static Builder with(@Nonnull Session session) { return new Builder(session); } private  UberRidesApi(@Nonnull Retrofit retrofit); }
UberRidesApi { @Nonnull public static Builder with(@Nonnull Session session) { return new Builder(session); } private  UberRidesApi(@Nonnull Retrofit retrofit); @Nonnull static Builder with(@Nonnull Session session); RidesService createService(); }
UberRidesApi { @Nonnull public static Builder with(@Nonnull Session session) { return new Builder(session); } private  UberRidesApi(@Nonnull Retrofit retrofit); @Nonnull static Builder with(@Nonnull Session session); RidesService createService();  }