KeywordPlanAdGroupKeywordServiceClient implements BackgroundResource { public final MutateKeywordPlanAdGroupKeywordsResponse mutateKeywordPlanAdGroupKeywords( String customerId, List<KeywordPlanAdGroupKeywordOperation> operations) { MutateKeywordPlanAdGroupKeywordsRequest request = MutateKeywordPlanAdGroupKeywordsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateKeywordPlanAdGroupKeywords(request); } protected  KeywordPlanAdGroupKeywordServiceClient(
      KeywordPlanAdGroupKeywordServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  KeywordPlanAdGroupKeywordServiceClient(KeywordPlanAdGroupKeywordServiceStub stub); static final KeywordPlanAdGroupKeywordServiceClient create(); static final KeywordPlanAdGroupKeywordServiceClient create(
      KeywordPlanAdGroupKeywordServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final KeywordPlanAdGroupKeywordServiceClient create(
      KeywordPlanAdGroupKeywordServiceStub stub); final KeywordPlanAdGroupKeywordServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") KeywordPlanAdGroupKeywordServiceStub getStub(); final KeywordPlanAdGroupKeyword getKeywordPlanAdGroupKeyword(
      KeywordPlanAdGroupKeywordName resourceName); final KeywordPlanAdGroupKeyword getKeywordPlanAdGroupKeyword(String resourceName); final KeywordPlanAdGroupKeyword getKeywordPlanAdGroupKeyword(
      GetKeywordPlanAdGroupKeywordRequest request); final UnaryCallable<GetKeywordPlanAdGroupKeywordRequest, KeywordPlanAdGroupKeyword> getKeywordPlanAdGroupKeywordCallable(); final MutateKeywordPlanAdGroupKeywordsResponse mutateKeywordPlanAdGroupKeywords(
      String customerId, List<KeywordPlanAdGroupKeywordOperation> operations); final MutateKeywordPlanAdGroupKeywordsResponse mutateKeywordPlanAdGroupKeywords(
      MutateKeywordPlanAdGroupKeywordsRequest request); final UnaryCallable<
          MutateKeywordPlanAdGroupKeywordsRequest, MutateKeywordPlanAdGroupKeywordsResponse> mutateKeywordPlanAdGroupKeywordsCallable(); @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 mutateKeywordPlanAdGroupKeywordsTest() { MutateKeywordPlanAdGroupKeywordsResponse expectedResponse = MutateKeywordPlanAdGroupKeywordsResponse.newBuilder().build(); mockKeywordPlanAdGroupKeywordService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<KeywordPlanAdGroupKeywordOperation> operations = new ArrayList<>(); MutateKeywordPlanAdGroupKeywordsResponse actualResponse = client.mutateKeywordPlanAdGroupKeywords(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockKeywordPlanAdGroupKeywordService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateKeywordPlanAdGroupKeywordsRequest actualRequest = (MutateKeywordPlanAdGroupKeywordsRequest) 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 mutateKeywordPlanAdGroupKeywordsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockKeywordPlanAdGroupKeywordService.addException(exception); try { String customerId = "customerId-1772061412"; List<KeywordPlanAdGroupKeywordOperation> operations = new ArrayList<>(); client.mutateKeywordPlanAdGroupKeywords(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }