AccountBudgetProposalServiceClient implements BackgroundResource { public final AccountBudgetProposal getAccountBudgetProposal( AccountBudgetProposalName resourceName) { GetAccountBudgetProposalRequest request = GetAccountBudgetProposalRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getAccountBudgetProposal(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 getAccountBudgetProposalTest() { com.google.ads.googleads.v5.services.AccountBudgetProposalName resourceName2 = com.google.ads.googleads.v5.services.AccountBudgetProposalName.of( "[CUSTOMER]", "[ACCOUNT_BUDGET_PROPOSAL]"); AccountBudgetProposal expectedResponse = AccountBudgetProposal.newBuilder().setResourceName(resourceName2.toString()).build(); mockAccountBudgetProposalService.addResponse(expectedResponse); AccountBudgetProposalName resourceName = AccountBudgetProposalName.of("[CUSTOMER]", "[ACCOUNT_BUDGET_PROPOSAL]"); AccountBudgetProposal actualResponse = client.getAccountBudgetProposal(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAccountBudgetProposalService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetAccountBudgetProposalRequest actualRequest = (GetAccountBudgetProposalRequest) actualRequests.get(0); Assert.assertEquals( resourceName, AccountBudgetProposalName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getAccountBudgetProposalExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAccountBudgetProposalService.addException(exception); try { AccountBudgetProposalName resourceName = AccountBudgetProposalName.of("[CUSTOMER]", "[ACCOUNT_BUDGET_PROPOSAL]"); client.getAccountBudgetProposal(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }