DynamicSearchAdsSearchTermViewServiceClient implements BackgroundResource { public final DynamicSearchAdsSearchTermView getDynamicSearchAdsSearchTermView( DynamicSearchAdsSearchTermViewName resourceName) { GetDynamicSearchAdsSearchTermViewRequest request = GetDynamicSearchAdsSearchTermViewRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getDynamicSearchAdsSearchTermView(request); } protected  DynamicSearchAdsSearchTermViewServiceClient(
      DynamicSearchAdsSearchTermViewServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  DynamicSearchAdsSearchTermViewServiceClient(
      DynamicSearchAdsSearchTermViewServiceStub stub); static final DynamicSearchAdsSearchTermViewServiceClient create(); static final DynamicSearchAdsSearchTermViewServiceClient create(
      DynamicSearchAdsSearchTermViewServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final DynamicSearchAdsSearchTermViewServiceClient create(
      DynamicSearchAdsSearchTermViewServiceStub stub); final DynamicSearchAdsSearchTermViewServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") DynamicSearchAdsSearchTermViewServiceStub getStub(); final DynamicSearchAdsSearchTermView getDynamicSearchAdsSearchTermView(
      DynamicSearchAdsSearchTermViewName resourceName); final DynamicSearchAdsSearchTermView getDynamicSearchAdsSearchTermView(
      String resourceName); final DynamicSearchAdsSearchTermView getDynamicSearchAdsSearchTermView(
      GetDynamicSearchAdsSearchTermViewRequest request); final UnaryCallable<
          GetDynamicSearchAdsSearchTermViewRequest, DynamicSearchAdsSearchTermView> getDynamicSearchAdsSearchTermViewCallable(); @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 getDynamicSearchAdsSearchTermViewTest() { com.google.ads.googleads.v5.services.DynamicSearchAdsSearchTermViewName resourceName2 = com.google.ads.googleads.v5.services.DynamicSearchAdsSearchTermViewName.of( "[CUSTOMER]", "[DYNAMIC_SEARCH_ADS_SEARCH_TERM_VIEW]"); String searchTerm = "searchTerm-539238237"; String headline = "headline-1115058732"; String landingPage = "landingPage-1755408457"; String pageUrl = "pageUrl859797439"; boolean hasNegativeKeyword = true; boolean hasMatchingKeyword = true; boolean hasNegativeUrl = true; DynamicSearchAdsSearchTermView expectedResponse = DynamicSearchAdsSearchTermView.newBuilder() .setResourceName(resourceName2.toString()) .setSearchTerm(searchTerm) .setHeadline(headline) .setLandingPage(landingPage) .setPageUrl(pageUrl) .setHasNegativeKeyword(hasNegativeKeyword) .setHasMatchingKeyword(hasMatchingKeyword) .setHasNegativeUrl(hasNegativeUrl) .build(); mockDynamicSearchAdsSearchTermViewService.addResponse(expectedResponse); DynamicSearchAdsSearchTermViewName resourceName = DynamicSearchAdsSearchTermViewName.of( "[CUSTOMER]", "[DYNAMIC_SEARCH_ADS_SEARCH_TERM_VIEW]"); DynamicSearchAdsSearchTermView actualResponse = client.getDynamicSearchAdsSearchTermView(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockDynamicSearchAdsSearchTermViewService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetDynamicSearchAdsSearchTermViewRequest actualRequest = (GetDynamicSearchAdsSearchTermViewRequest) actualRequests.get(0); Assert.assertEquals( resourceName, DynamicSearchAdsSearchTermViewName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getDynamicSearchAdsSearchTermViewExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockDynamicSearchAdsSearchTermViewService.addException(exception); try { DynamicSearchAdsSearchTermViewName resourceName = DynamicSearchAdsSearchTermViewName.of( "[CUSTOMER]", "[DYNAMIC_SEARCH_ADS_SEARCH_TERM_VIEW]"); client.getDynamicSearchAdsSearchTermView(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }