@Test public void setOkHttpClient_isSetAndCallsNewBuilderDuringConstruction() throws Exception { OkHttpClient client = mock(OkHttpClient.class); when(client.newBuilder()).thenReturn(new OkHttpClient.Builder()); UberRidesApi.Builder builder = UberRidesApi.with(session).setOkHttpClient(client); builder.build(); verify(client).newBuilder(); assertEquals(client, builder.client); }
@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();  }