CustomerExtensionSettingServiceClient implements BackgroundResource { public final MutateCustomerExtensionSettingsResponse mutateCustomerExtensionSettings( String customerId, List<CustomerExtensionSettingOperation> operations) { MutateCustomerExtensionSettingsRequest request = MutateCustomerExtensionSettingsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateCustomerExtensionSettings(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 mutateCustomerExtensionSettingsTest() { MutateCustomerExtensionSettingsResponse expectedResponse = MutateCustomerExtensionSettingsResponse.newBuilder().build(); mockCustomerExtensionSettingService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<CustomerExtensionSettingOperation> operations = new ArrayList<>(); MutateCustomerExtensionSettingsResponse actualResponse = client.mutateCustomerExtensionSettings(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCustomerExtensionSettingService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateCustomerExtensionSettingsRequest actualRequest = (MutateCustomerExtensionSettingsRequest) 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 mutateCustomerExtensionSettingsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCustomerExtensionSettingService.addException(exception); try { String customerId = "customerId-1772061412"; List<CustomerExtensionSettingOperation> operations = new ArrayList<>(); client.mutateCustomerExtensionSettings(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }