AdGroupExtensionSettingServiceClient implements BackgroundResource { public final MutateAdGroupExtensionSettingsResponse mutateAdGroupExtensionSettings( String customerId, List<AdGroupExtensionSettingOperation> operations) { MutateAdGroupExtensionSettingsRequest request = MutateAdGroupExtensionSettingsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateAdGroupExtensionSettings(request); } protected  AdGroupExtensionSettingServiceClient(AdGroupExtensionSettingServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdGroupExtensionSettingServiceClient(AdGroupExtensionSettingServiceStub stub); static final AdGroupExtensionSettingServiceClient create(); static final AdGroupExtensionSettingServiceClient create(
      AdGroupExtensionSettingServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdGroupExtensionSettingServiceClient create(
      AdGroupExtensionSettingServiceStub stub); final AdGroupExtensionSettingServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdGroupExtensionSettingServiceStub getStub(); final AdGroupExtensionSetting getAdGroupExtensionSetting(
      AdGroupExtensionSettingName resourceName); final AdGroupExtensionSetting getAdGroupExtensionSetting(String resourceName); final AdGroupExtensionSetting getAdGroupExtensionSetting(
      GetAdGroupExtensionSettingRequest request); final UnaryCallable<GetAdGroupExtensionSettingRequest, AdGroupExtensionSetting> getAdGroupExtensionSettingCallable(); final MutateAdGroupExtensionSettingsResponse mutateAdGroupExtensionSettings(
      String customerId, List<AdGroupExtensionSettingOperation> operations); final MutateAdGroupExtensionSettingsResponse mutateAdGroupExtensionSettings(
      MutateAdGroupExtensionSettingsRequest request); final UnaryCallable<
          MutateAdGroupExtensionSettingsRequest, MutateAdGroupExtensionSettingsResponse> mutateAdGroupExtensionSettingsCallable(); @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 mutateAdGroupExtensionSettingsTest() { MutateAdGroupExtensionSettingsResponse expectedResponse = MutateAdGroupExtensionSettingsResponse.newBuilder().build(); mockAdGroupExtensionSettingService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<AdGroupExtensionSettingOperation> operations = new ArrayList<>(); MutateAdGroupExtensionSettingsResponse actualResponse = client.mutateAdGroupExtensionSettings(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdGroupExtensionSettingService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateAdGroupExtensionSettingsRequest actualRequest = (MutateAdGroupExtensionSettingsRequest) actualRequests.get(0); Assert.assertEquals(customerId, actualRequest.getCustomerId()); Assert.assertEquals(operations, actualRequest.getOperationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void mutateAdGroupExtensionSettingsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdGroupExtensionSettingService.addException(exception); try { String customerId = "customerId-1772061412"; List<AdGroupExtensionSettingOperation> operations = new ArrayList<>(); client.mutateAdGroupExtensionSettings(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }