CampaignFeedServiceClient implements BackgroundResource { public final CampaignFeed getCampaignFeed(CampaignFeedName resourceName) { GetCampaignFeedRequest request = GetCampaignFeedRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getCampaignFeed(request); } protected  CampaignFeedServiceClient(CampaignFeedServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CampaignFeedServiceClient(CampaignFeedServiceStub stub); static final CampaignFeedServiceClient create(); static final CampaignFeedServiceClient create(CampaignFeedServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CampaignFeedServiceClient create(CampaignFeedServiceStub stub); final CampaignFeedServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CampaignFeedServiceStub getStub(); final CampaignFeed getCampaignFeed(CampaignFeedName resourceName); final CampaignFeed getCampaignFeed(String resourceName); final CampaignFeed getCampaignFeed(GetCampaignFeedRequest request); final UnaryCallable<GetCampaignFeedRequest, CampaignFeed> getCampaignFeedCallable(); final MutateCampaignFeedsResponse mutateCampaignFeeds(
      String customerId, List<CampaignFeedOperation> operations); final MutateCampaignFeedsResponse mutateCampaignFeeds(MutateCampaignFeedsRequest request); final UnaryCallable<MutateCampaignFeedsRequest, MutateCampaignFeedsResponse> mutateCampaignFeedsCallable(); @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 getCampaignFeedTest() { com.google.ads.googleads.v5.services.CampaignFeedName resourceName2 = com.google.ads.googleads.v5.services.CampaignFeedName.of("[CUSTOMER]", "[CAMPAIGN_FEED]"); CampaignFeed expectedResponse = CampaignFeed.newBuilder().setResourceName(resourceName2.toString()).build(); mockCampaignFeedService.addResponse(expectedResponse); CampaignFeedName resourceName = CampaignFeedName.of("[CUSTOMER]", "[CAMPAIGN_FEED]"); CampaignFeed actualResponse = client.getCampaignFeed(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCampaignFeedService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetCampaignFeedRequest actualRequest = (GetCampaignFeedRequest) actualRequests.get(0); Assert.assertEquals(resourceName, CampaignFeedName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getCampaignFeedExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCampaignFeedService.addException(exception); try { CampaignFeedName resourceName = CampaignFeedName.of("[CUSTOMER]", "[CAMPAIGN_FEED]"); client.getCampaignFeed(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }