return client.authenticator().authenticate(route, userResponse);
return client.authenticator().authenticate(route, userResponse);
@Override public Authenticator authenticator() { return delegate.authenticator(); }
@Override public Authenticator authenticator() { return delegate.authenticator(); }
@Override public Authenticator authenticator() { return delegate.authenticator(); }
return client.authenticator().authenticate(route, userResponse);
return client.authenticator().authenticate(route, userResponse);
return client.authenticator().authenticate(route, userResponse);
Request authenticateRequest = client.authenticator().authenticate(request); if (authenticateRequest != null) { request = authenticateRequest;
@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"); } } }