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