@Test public void hashCode_doesNotCollide() { GoogleAdsClient clientA = GoogleAdsClient.newBuilder() .setCredentials(fakeCredentials) .setDeveloperToken(DEVELOPER_TOKEN) .setEnableGeneratedCatalog(enabledGeneratedCatalog) .build(); GoogleAdsClient clientB = GoogleAdsClient.newBuilder() .setCredentials(fakeCredentials) .setDeveloperToken(DEVELOPER_TOKEN + "asdf") .setEnableGeneratedCatalog(enabledGeneratedCatalog) .build(); assertNotEquals( "Clients with distinct params should have distinct hashCodes", clientA.hashCode(), clientB.hashCode()); }
public static Builder newBuilder() { AutoValue_GoogleAdsClient.Builder clientBuilder = new AutoValue_GoogleAdsClient.Builder(); clientBuilder.setEnableGeneratedCatalog(true); InstantiatingGrpcChannelProvider transportChannelProvider = InstantiatingGrpcChannelProvider.newBuilder() .setInterceptorProvider( () -> ImmutableList.of( new LoggingInterceptor( new RequestLogger(), clientBuilder.getHeaders(), clientBuilder.getEndpoint()))) .setMaxInboundMetadataSize(16 * 1024 * 1024) .setMaxInboundMessageSize(64 * 1024 * 1024) .build(); clientBuilder .setEndpoint(DEFAULT_ENDPOINT) .setTransportChannelProvider(transportChannelProvider); return clientBuilder; }
GoogleAdsClient extends AbstractGoogleAdsClient { public static Builder newBuilder() { AutoValue_GoogleAdsClient.Builder clientBuilder = new AutoValue_GoogleAdsClient.Builder(); clientBuilder.setEnableGeneratedCatalog(true); InstantiatingGrpcChannelProvider transportChannelProvider = InstantiatingGrpcChannelProvider.newBuilder() .setInterceptorProvider( () -> ImmutableList.of( new LoggingInterceptor( new RequestLogger(), clientBuilder.getHeaders(), clientBuilder.getEndpoint()))) .setMaxInboundMetadataSize(16 * 1024 * 1024) .setMaxInboundMessageSize(64 * 1024 * 1024) .build(); clientBuilder .setEndpoint(DEFAULT_ENDPOINT) .setTransportChannelProvider(transportChannelProvider); return clientBuilder; } }
GoogleAdsClient extends AbstractGoogleAdsClient { public static Builder newBuilder() { AutoValue_GoogleAdsClient.Builder clientBuilder = new AutoValue_GoogleAdsClient.Builder(); clientBuilder.setEnableGeneratedCatalog(true); InstantiatingGrpcChannelProvider transportChannelProvider = InstantiatingGrpcChannelProvider.newBuilder() .setInterceptorProvider( () -> ImmutableList.of( new LoggingInterceptor( new RequestLogger(), clientBuilder.getHeaders(), clientBuilder.getEndpoint()))) .setMaxInboundMetadataSize(16 * 1024 * 1024) .setMaxInboundMessageSize(64 * 1024 * 1024) .build(); clientBuilder .setEndpoint(DEFAULT_ENDPOINT) .setTransportChannelProvider(transportChannelProvider); return clientBuilder; }  }
GoogleAdsClient extends AbstractGoogleAdsClient { public static Builder newBuilder() { AutoValue_GoogleAdsClient.Builder clientBuilder = new AutoValue_GoogleAdsClient.Builder(); clientBuilder.setEnableGeneratedCatalog(true); InstantiatingGrpcChannelProvider transportChannelProvider = InstantiatingGrpcChannelProvider.newBuilder() .setInterceptorProvider( () -> ImmutableList.of( new LoggingInterceptor( new RequestLogger(), clientBuilder.getHeaders(), clientBuilder.getEndpoint()))) .setMaxInboundMetadataSize(16 * 1024 * 1024) .setMaxInboundMessageSize(64 * 1024 * 1024) .build(); clientBuilder .setEndpoint(DEFAULT_ENDPOINT) .setTransportChannelProvider(transportChannelProvider); return clientBuilder; }  static Builder newBuilder(); abstract Credentials getCredentials(); abstract String getDeveloperToken(); abstract String getEndpoint(); @Nullable abstract Long getLoginCustomerId(); @Nullable abstract Long getLinkedCustomerId(); abstract Builder toBuilder(); }
GoogleAdsClient extends AbstractGoogleAdsClient { public static Builder newBuilder() { AutoValue_GoogleAdsClient.Builder clientBuilder = new AutoValue_GoogleAdsClient.Builder(); clientBuilder.setEnableGeneratedCatalog(true); InstantiatingGrpcChannelProvider transportChannelProvider = InstantiatingGrpcChannelProvider.newBuilder() .setInterceptorProvider( () -> ImmutableList.of( new LoggingInterceptor( new RequestLogger(), clientBuilder.getHeaders(), clientBuilder.getEndpoint()))) .setMaxInboundMetadataSize(16 * 1024 * 1024) .setMaxInboundMessageSize(64 * 1024 * 1024) .build(); clientBuilder .setEndpoint(DEFAULT_ENDPOINT) .setTransportChannelProvider(transportChannelProvider); return clientBuilder; }  static Builder newBuilder(); abstract Credentials getCredentials(); abstract String getDeveloperToken(); abstract String getEndpoint(); @Nullable abstract Long getLoginCustomerId(); @Nullable abstract Long getLinkedCustomerId(); abstract Builder toBuilder();  }