FeedItemServiceClient implements BackgroundResource { public final FeedItem getFeedItem(FeedItemName resourceName) { GetFeedItemRequest request = GetFeedItemRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getFeedItem(request); } protected  FeedItemServiceClient(FeedItemServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  FeedItemServiceClient(FeedItemServiceStub stub); static final FeedItemServiceClient create(); static final FeedItemServiceClient create(FeedItemServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final FeedItemServiceClient create(FeedItemServiceStub stub); final FeedItemServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") FeedItemServiceStub getStub(); final FeedItem getFeedItem(FeedItemName resourceName); final FeedItem getFeedItem(String resourceName); final FeedItem getFeedItem(GetFeedItemRequest request); final UnaryCallable<GetFeedItemRequest, FeedItem> getFeedItemCallable(); final MutateFeedItemsResponse mutateFeedItems(
      String customerId, List<FeedItemOperation> operations); final MutateFeedItemsResponse mutateFeedItems(MutateFeedItemsRequest request); final UnaryCallable<MutateFeedItemsRequest, MutateFeedItemsResponse> mutateFeedItemsCallable(); @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 getFeedItemTest() { com.google.ads.googleads.v5.services.FeedItemName resourceName2 = com.google.ads.googleads.v5.services.FeedItemName.of("[CUSTOMER]", "[FEED_ITEM]"); FeedItem expectedResponse = FeedItem.newBuilder().setResourceName(resourceName2.toString()).build(); mockFeedItemService.addResponse(expectedResponse); FeedItemName resourceName = FeedItemName.of("[CUSTOMER]", "[FEED_ITEM]"); FeedItem actualResponse = client.getFeedItem(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockFeedItemService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetFeedItemRequest actualRequest = (GetFeedItemRequest) actualRequests.get(0); Assert.assertEquals(resourceName, FeedItemName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getFeedItemExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockFeedItemService.addException(exception); try { FeedItemName resourceName = FeedItemName.of("[CUSTOMER]", "[FEED_ITEM]"); client.getFeedItem(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }