CustomerExtensionSettingServiceClient implements BackgroundResource { public final CustomerExtensionSetting getCustomerExtensionSetting( CustomerExtensionSettingName resourceName) { GetCustomerExtensionSettingRequest request = GetCustomerExtensionSettingRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getCustomerExtensionSetting(request); } protected  CustomerExtensionSettingServiceClient(CustomerExtensionSettingServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CustomerExtensionSettingServiceClient(CustomerExtensionSettingServiceStub stub); static final CustomerExtensionSettingServiceClient create(); static final CustomerExtensionSettingServiceClient create(
      CustomerExtensionSettingServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CustomerExtensionSettingServiceClient create(
      CustomerExtensionSettingServiceStub stub); final CustomerExtensionSettingServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CustomerExtensionSettingServiceStub getStub(); final CustomerExtensionSetting getCustomerExtensionSetting(
      CustomerExtensionSettingName resourceName); final CustomerExtensionSetting getCustomerExtensionSetting(String resourceName); final CustomerExtensionSetting getCustomerExtensionSetting(
      GetCustomerExtensionSettingRequest request); final UnaryCallable<GetCustomerExtensionSettingRequest, CustomerExtensionSetting> getCustomerExtensionSettingCallable(); final MutateCustomerExtensionSettingsResponse mutateCustomerExtensionSettings(
      String customerId, List<CustomerExtensionSettingOperation> operations); final MutateCustomerExtensionSettingsResponse mutateCustomerExtensionSettings(
      MutateCustomerExtensionSettingsRequest request); final UnaryCallable<
          MutateCustomerExtensionSettingsRequest, MutateCustomerExtensionSettingsResponse> mutateCustomerExtensionSettingsCallable(); @Override final void close(); @Override void shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdownNow(); @Override boolean awaitTermination(long duration, TimeUnit unit);  }
@Test @SuppressWarnings("all") public void getCustomerExtensionSettingTest() { com.google.ads.googleads.v5.services.CustomerExtensionSettingName resourceName2 = com.google.ads.googleads.v5.services.CustomerExtensionSettingName.of( "[CUSTOMER]", "[CUSTOMER_EXTENSION_SETTING]"); CustomerExtensionSetting expectedResponse = CustomerExtensionSetting.newBuilder().setResourceName(resourceName2.toString()).build(); mockCustomerExtensionSettingService.addResponse(expectedResponse); CustomerExtensionSettingName resourceName = CustomerExtensionSettingName.of("[CUSTOMER]", "[CUSTOMER_EXTENSION_SETTING]"); CustomerExtensionSetting actualResponse = client.getCustomerExtensionSetting(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCustomerExtensionSettingService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetCustomerExtensionSettingRequest actualRequest = (GetCustomerExtensionSettingRequest) actualRequests.get(0); Assert.assertEquals( resourceName, CustomerExtensionSettingName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getCustomerExtensionSettingExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCustomerExtensionSettingService.addException(exception); try { CustomerExtensionSettingName resourceName = CustomerExtensionSettingName.of("[CUSTOMER]", "[CUSTOMER_EXTENSION_SETTING]"); client.getCustomerExtensionSetting(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }