FeedPlaceholderViewServiceClient implements BackgroundResource { public final FeedPlaceholderView getFeedPlaceholderView(FeedPlaceholderViewName resourceName) { GetFeedPlaceholderViewRequest request = GetFeedPlaceholderViewRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getFeedPlaceholderView(request); } protected  FeedPlaceholderViewServiceClient(FeedPlaceholderViewServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  FeedPlaceholderViewServiceClient(FeedPlaceholderViewServiceStub stub); static final FeedPlaceholderViewServiceClient create(); static final FeedPlaceholderViewServiceClient create(
      FeedPlaceholderViewServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final FeedPlaceholderViewServiceClient create(FeedPlaceholderViewServiceStub stub); final FeedPlaceholderViewServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") FeedPlaceholderViewServiceStub getStub(); final FeedPlaceholderView getFeedPlaceholderView(FeedPlaceholderViewName resourceName); final FeedPlaceholderView getFeedPlaceholderView(String resourceName); final FeedPlaceholderView getFeedPlaceholderView(GetFeedPlaceholderViewRequest request); final UnaryCallable<GetFeedPlaceholderViewRequest, FeedPlaceholderView> getFeedPlaceholderViewCallable(); @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 getFeedPlaceholderViewTest() { com.google.ads.googleads.v5.services.FeedPlaceholderViewName resourceName2 = com.google.ads.googleads.v5.services.FeedPlaceholderViewName.of( "[CUSTOMER]", "[FEED_PLACEHOLDER_VIEW]"); FeedPlaceholderView expectedResponse = FeedPlaceholderView.newBuilder().setResourceName(resourceName2.toString()).build(); mockFeedPlaceholderViewService.addResponse(expectedResponse); FeedPlaceholderViewName resourceName = FeedPlaceholderViewName.of("[CUSTOMER]", "[FEED_PLACEHOLDER_VIEW]"); FeedPlaceholderView actualResponse = client.getFeedPlaceholderView(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockFeedPlaceholderViewService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetFeedPlaceholderViewRequest actualRequest = (GetFeedPlaceholderViewRequest) actualRequests.get(0); Assert.assertEquals( resourceName, FeedPlaceholderViewName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getFeedPlaceholderViewExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockFeedPlaceholderViewService.addException(exception); try { FeedPlaceholderViewName resourceName = FeedPlaceholderViewName.of("[CUSTOMER]", "[FEED_PLACEHOLDER_VIEW]"); client.getFeedPlaceholderView(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }