AccountLinkServiceClient implements BackgroundResource { public final MutateAccountLinkResponse mutateAccountLink( String customerId, AccountLinkOperation operation) { MutateAccountLinkRequest request = MutateAccountLinkRequest.newBuilder() .setCustomerId(customerId) .setOperation(operation) .build(); return mutateAccountLink(request); } protected  AccountLinkServiceClient(AccountLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AccountLinkServiceClient(AccountLinkServiceStub stub); static final AccountLinkServiceClient create(); static final AccountLinkServiceClient create(AccountLinkServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AccountLinkServiceClient create(AccountLinkServiceStub stub); final AccountLinkServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AccountLinkServiceStub getStub(); final AccountLink getAccountLink(AccountLinkName resourceName); final AccountLink getAccountLink(String resourceName); final AccountLink getAccountLink(GetAccountLinkRequest request); final UnaryCallable<GetAccountLinkRequest, AccountLink> getAccountLinkCallable(); final CreateAccountLinkResponse createAccountLink(
      String customerId, AccountLink accountLink); final CreateAccountLinkResponse createAccountLink(CreateAccountLinkRequest request); final UnaryCallable<CreateAccountLinkRequest, CreateAccountLinkResponse> createAccountLinkCallable(); final MutateAccountLinkResponse mutateAccountLink(
      String customerId, AccountLinkOperation operation); final MutateAccountLinkResponse mutateAccountLink(MutateAccountLinkRequest request); final UnaryCallable<MutateAccountLinkRequest, MutateAccountLinkResponse> mutateAccountLinkCallable(); @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 mutateAccountLinkTest() { MutateAccountLinkResponse expectedResponse = MutateAccountLinkResponse.newBuilder().build(); mockAccountLinkService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; AccountLinkOperation operation = AccountLinkOperation.newBuilder().build(); MutateAccountLinkResponse actualResponse = client.mutateAccountLink(customerId, operation); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAccountLinkService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateAccountLinkRequest actualRequest = (MutateAccountLinkRequest) 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 mutateAccountLinkExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAccountLinkService.addException(exception); try { String customerId = "customerId-1772061412"; AccountLinkOperation operation = AccountLinkOperation.newBuilder().build(); client.mutateAccountLink(customerId, operation); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }