FeedMappingServiceClient implements BackgroundResource { public final FeedMapping getFeedMapping(FeedMappingName resourceName) { GetFeedMappingRequest request = GetFeedMappingRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getFeedMapping(request); } protected  FeedMappingServiceClient(FeedMappingServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  FeedMappingServiceClient(FeedMappingServiceStub stub); static final FeedMappingServiceClient create(); static final FeedMappingServiceClient create(FeedMappingServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final FeedMappingServiceClient create(FeedMappingServiceStub stub); final FeedMappingServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") FeedMappingServiceStub getStub(); final FeedMapping getFeedMapping(FeedMappingName resourceName); final FeedMapping getFeedMapping(String resourceName); final FeedMapping getFeedMapping(GetFeedMappingRequest request); final UnaryCallable<GetFeedMappingRequest, FeedMapping> getFeedMappingCallable(); final MutateFeedMappingsResponse mutateFeedMappings(
      String customerId, List<FeedMappingOperation> operations); final MutateFeedMappingsResponse mutateFeedMappings(MutateFeedMappingsRequest request); final UnaryCallable<MutateFeedMappingsRequest, MutateFeedMappingsResponse> mutateFeedMappingsCallable(); @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 getFeedMappingTest() { com.google.ads.googleads.v5.services.FeedMappingName resourceName2 = com.google.ads.googleads.v5.services.FeedMappingName.of("[CUSTOMER]", "[FEED_MAPPING]"); FeedMapping expectedResponse = FeedMapping.newBuilder().setResourceName(resourceName2.toString()).build(); mockFeedMappingService.addResponse(expectedResponse); FeedMappingName resourceName = FeedMappingName.of("[CUSTOMER]", "[FEED_MAPPING]"); FeedMapping actualResponse = client.getFeedMapping(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockFeedMappingService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetFeedMappingRequest actualRequest = (GetFeedMappingRequest) actualRequests.get(0); Assert.assertEquals(resourceName, FeedMappingName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getFeedMappingExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockFeedMappingService.addException(exception); try { FeedMappingName resourceName = FeedMappingName.of("[CUSTOMER]", "[FEED_MAPPING]"); client.getFeedMapping(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }