CustomerClientLinkServiceClient implements BackgroundResource { public final MutateCustomerClientLinkResponse mutateCustomerClientLink( String customerId, CustomerClientLinkOperation operation) { MutateCustomerClientLinkRequest request = MutateCustomerClientLinkRequest.newBuilder() .setCustomerId(customerId) .setOperation(operation) .build(); return mutateCustomerClientLink(request); } protected  CustomerClientLinkServiceClient(CustomerClientLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CustomerClientLinkServiceClient(CustomerClientLinkServiceStub stub); static final CustomerClientLinkServiceClient create(); static final CustomerClientLinkServiceClient create(
      CustomerClientLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CustomerClientLinkServiceClient create(CustomerClientLinkServiceStub stub); final CustomerClientLinkServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CustomerClientLinkServiceStub getStub(); final CustomerClientLink getCustomerClientLink(CustomerClientLinkName resourceName); final CustomerClientLink getCustomerClientLink(String resourceName); final CustomerClientLink getCustomerClientLink(GetCustomerClientLinkRequest request); final UnaryCallable<GetCustomerClientLinkRequest, CustomerClientLink> getCustomerClientLinkCallable(); final MutateCustomerClientLinkResponse mutateCustomerClientLink(
      String customerId, CustomerClientLinkOperation operation); final MutateCustomerClientLinkResponse mutateCustomerClientLink(
      MutateCustomerClientLinkRequest request); final UnaryCallable<MutateCustomerClientLinkRequest, MutateCustomerClientLinkResponse> mutateCustomerClientLinkCallable(); @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 mutateCustomerClientLinkTest() { MutateCustomerClientLinkResponse expectedResponse = MutateCustomerClientLinkResponse.newBuilder().build(); mockCustomerClientLinkService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; CustomerClientLinkOperation operation = CustomerClientLinkOperation.newBuilder().build(); MutateCustomerClientLinkResponse actualResponse = client.mutateCustomerClientLink(customerId, operation); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCustomerClientLinkService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateCustomerClientLinkRequest actualRequest = (MutateCustomerClientLinkRequest) actualRequests.get(0); Assert.assertEquals(customerId, actualRequest.getCustomerId()); Assert.assertEquals(operation, actualRequest.getOperation()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void mutateCustomerClientLinkExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCustomerClientLinkService.addException(exception); try { String customerId = "customerId-1772061412"; CustomerClientLinkOperation operation = CustomerClientLinkOperation.newBuilder().build(); client.mutateCustomerClientLink(customerId, operation); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }