CustomerManagerLinkServiceClient implements BackgroundResource { public final MutateCustomerManagerLinkResponse mutateCustomerManagerLink( String customerId, List<CustomerManagerLinkOperation> operations) { MutateCustomerManagerLinkRequest request = MutateCustomerManagerLinkRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateCustomerManagerLink(request); } protected  CustomerManagerLinkServiceClient(CustomerManagerLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CustomerManagerLinkServiceClient(CustomerManagerLinkServiceStub stub); static final CustomerManagerLinkServiceClient create(); static final CustomerManagerLinkServiceClient create(
      CustomerManagerLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CustomerManagerLinkServiceClient create(CustomerManagerLinkServiceStub stub); final CustomerManagerLinkServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CustomerManagerLinkServiceStub getStub(); final CustomerManagerLink getCustomerManagerLink(CustomerManagerLinkName resourceName); final CustomerManagerLink getCustomerManagerLink(String resourceName); final CustomerManagerLink getCustomerManagerLink(GetCustomerManagerLinkRequest request); final UnaryCallable<GetCustomerManagerLinkRequest, CustomerManagerLink> getCustomerManagerLinkCallable(); final MutateCustomerManagerLinkResponse mutateCustomerManagerLink(
      String customerId, List<CustomerManagerLinkOperation> operations); final MutateCustomerManagerLinkResponse mutateCustomerManagerLink(
      MutateCustomerManagerLinkRequest request); final UnaryCallable<MutateCustomerManagerLinkRequest, MutateCustomerManagerLinkResponse> mutateCustomerManagerLinkCallable(); final MoveManagerLinkResponse moveManagerLink(
      String customerId, String previousCustomerManagerLink, String newManager); final MoveManagerLinkResponse moveManagerLink(MoveManagerLinkRequest request); final UnaryCallable<MoveManagerLinkRequest, MoveManagerLinkResponse> moveManagerLinkCallable(); @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 mutateCustomerManagerLinkTest() { MutateCustomerManagerLinkResponse expectedResponse = MutateCustomerManagerLinkResponse.newBuilder().build(); mockCustomerManagerLinkService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<CustomerManagerLinkOperation> operations = new ArrayList<>(); MutateCustomerManagerLinkResponse actualResponse = client.mutateCustomerManagerLink(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCustomerManagerLinkService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateCustomerManagerLinkRequest actualRequest = (MutateCustomerManagerLinkRequest) 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 mutateCustomerManagerLinkExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCustomerManagerLinkService.addException(exception); try { String customerId = "customerId-1772061412"; List<CustomerManagerLinkOperation> operations = new ArrayList<>(); client.mutateCustomerManagerLink(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }