KeywordPlanCampaignKeywordServiceClient implements BackgroundResource { public final MutateKeywordPlanCampaignKeywordsResponse mutateKeywordPlanCampaignKeywords( String customerId, List<KeywordPlanCampaignKeywordOperation> operations) { MutateKeywordPlanCampaignKeywordsRequest request = MutateKeywordPlanCampaignKeywordsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateKeywordPlanCampaignKeywords(request); } protected  KeywordPlanCampaignKeywordServiceClient(
      KeywordPlanCampaignKeywordServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  KeywordPlanCampaignKeywordServiceClient(KeywordPlanCampaignKeywordServiceStub stub); static final KeywordPlanCampaignKeywordServiceClient create(); static final KeywordPlanCampaignKeywordServiceClient create(
      KeywordPlanCampaignKeywordServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final KeywordPlanCampaignKeywordServiceClient create(
      KeywordPlanCampaignKeywordServiceStub stub); final KeywordPlanCampaignKeywordServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") KeywordPlanCampaignKeywordServiceStub getStub(); final KeywordPlanCampaignKeyword getKeywordPlanCampaignKeyword(
      KeywordPlanCampaignKeywordName resourceName); final KeywordPlanCampaignKeyword getKeywordPlanCampaignKeyword(String resourceName); final KeywordPlanCampaignKeyword getKeywordPlanCampaignKeyword(
      GetKeywordPlanCampaignKeywordRequest request); final UnaryCallable<GetKeywordPlanCampaignKeywordRequest, KeywordPlanCampaignKeyword> getKeywordPlanCampaignKeywordCallable(); final MutateKeywordPlanCampaignKeywordsResponse mutateKeywordPlanCampaignKeywords(
      String customerId, List<KeywordPlanCampaignKeywordOperation> operations); final MutateKeywordPlanCampaignKeywordsResponse mutateKeywordPlanCampaignKeywords(
      MutateKeywordPlanCampaignKeywordsRequest request); final UnaryCallable<
          MutateKeywordPlanCampaignKeywordsRequest, MutateKeywordPlanCampaignKeywordsResponse> mutateKeywordPlanCampaignKeywordsCallable(); @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 mutateKeywordPlanCampaignKeywordsTest() { MutateKeywordPlanCampaignKeywordsResponse expectedResponse = MutateKeywordPlanCampaignKeywordsResponse.newBuilder().build(); mockKeywordPlanCampaignKeywordService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<KeywordPlanCampaignKeywordOperation> operations = new ArrayList<>(); MutateKeywordPlanCampaignKeywordsResponse actualResponse = client.mutateKeywordPlanCampaignKeywords(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockKeywordPlanCampaignKeywordService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateKeywordPlanCampaignKeywordsRequest actualRequest = (MutateKeywordPlanCampaignKeywordsRequest) 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 mutateKeywordPlanCampaignKeywordsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockKeywordPlanCampaignKeywordService.addException(exception); try { String customerId = "customerId-1772061412"; List<KeywordPlanCampaignKeywordOperation> operations = new ArrayList<>(); client.mutateKeywordPlanCampaignKeywords(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }