CustomerFeedServiceClient implements BackgroundResource { public final CustomerFeed getCustomerFeed(CustomerFeedName resourceName) { GetCustomerFeedRequest request = GetCustomerFeedRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getCustomerFeed(request); } protected  CustomerFeedServiceClient(CustomerFeedServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CustomerFeedServiceClient(CustomerFeedServiceStub stub); static final CustomerFeedServiceClient create(); static final CustomerFeedServiceClient create(CustomerFeedServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CustomerFeedServiceClient create(CustomerFeedServiceStub stub); final CustomerFeedServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CustomerFeedServiceStub getStub(); final CustomerFeed getCustomerFeed(CustomerFeedName resourceName); final CustomerFeed getCustomerFeed(String resourceName); final CustomerFeed getCustomerFeed(GetCustomerFeedRequest request); final UnaryCallable<GetCustomerFeedRequest, CustomerFeed> getCustomerFeedCallable(); final MutateCustomerFeedsResponse mutateCustomerFeeds(
      String customerId, List<CustomerFeedOperation> operations); final MutateCustomerFeedsResponse mutateCustomerFeeds(MutateCustomerFeedsRequest request); final UnaryCallable<MutateCustomerFeedsRequest, MutateCustomerFeedsResponse> mutateCustomerFeedsCallable(); @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 getCustomerFeedTest() { com.google.ads.googleads.v5.services.CustomerFeedName resourceName2 = com.google.ads.googleads.v5.services.CustomerFeedName.of("[CUSTOMER]", "[CUSTOMER_FEED]"); CustomerFeed expectedResponse = CustomerFeed.newBuilder().setResourceName(resourceName2.toString()).build(); mockCustomerFeedService.addResponse(expectedResponse); CustomerFeedName resourceName = CustomerFeedName.of("[CUSTOMER]", "[CUSTOMER_FEED]"); CustomerFeed actualResponse = client.getCustomerFeed(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCustomerFeedService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetCustomerFeedRequest actualRequest = (GetCustomerFeedRequest) actualRequests.get(0); Assert.assertEquals(resourceName, CustomerFeedName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getCustomerFeedExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCustomerFeedService.addException(exception); try { CustomerFeedName resourceName = CustomerFeedName.of("[CUSTOMER]", "[CUSTOMER_FEED]"); client.getCustomerFeed(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }