AccountBudgetProposalServiceClient implements BackgroundResource { public final MutateAccountBudgetProposalResponse mutateAccountBudgetProposal( String customerId, AccountBudgetProposalOperation operation) { MutateAccountBudgetProposalRequest request = MutateAccountBudgetProposalRequest.newBuilder() .setCustomerId(customerId) .setOperation(operation) .build(); return mutateAccountBudgetProposal(request); } protected  AccountBudgetProposalServiceClient(AccountBudgetProposalServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AccountBudgetProposalServiceClient(AccountBudgetProposalServiceStub stub); static final AccountBudgetProposalServiceClient create(); static final AccountBudgetProposalServiceClient create(
      AccountBudgetProposalServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AccountBudgetProposalServiceClient create(
      AccountBudgetProposalServiceStub stub); final AccountBudgetProposalServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AccountBudgetProposalServiceStub getStub(); final AccountBudgetProposal getAccountBudgetProposal(
      AccountBudgetProposalName resourceName); final AccountBudgetProposal getAccountBudgetProposal(String resourceName); final AccountBudgetProposal getAccountBudgetProposal(
      GetAccountBudgetProposalRequest request); final UnaryCallable<GetAccountBudgetProposalRequest, AccountBudgetProposal> getAccountBudgetProposalCallable(); final MutateAccountBudgetProposalResponse mutateAccountBudgetProposal(
      String customerId, AccountBudgetProposalOperation operation); final MutateAccountBudgetProposalResponse mutateAccountBudgetProposal(
      MutateAccountBudgetProposalRequest request); final UnaryCallable<
          MutateAccountBudgetProposalRequest, MutateAccountBudgetProposalResponse> mutateAccountBudgetProposalCallable(); @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 mutateAccountBudgetProposalTest() { MutateAccountBudgetProposalResponse expectedResponse = MutateAccountBudgetProposalResponse.newBuilder().build(); mockAccountBudgetProposalService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; AccountBudgetProposalOperation operation = AccountBudgetProposalOperation.newBuilder().build(); MutateAccountBudgetProposalResponse actualResponse = client.mutateAccountBudgetProposal(customerId, operation); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAccountBudgetProposalService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateAccountBudgetProposalRequest actualRequest = (MutateAccountBudgetProposalRequest) 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 mutateAccountBudgetProposalExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAccountBudgetProposalService.addException(exception); try { String customerId = "customerId-1772061412"; AccountBudgetProposalOperation operation = AccountBudgetProposalOperation.newBuilder().build(); client.mutateAccountBudgetProposal(customerId, operation); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }