FeedMappingServiceClient implements BackgroundResource { public final MutateFeedMappingsResponse mutateFeedMappings( String customerId, List<FeedMappingOperation> operations) { MutateFeedMappingsRequest request = MutateFeedMappingsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateFeedMappings(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 mutateFeedMappingsTest() { MutateFeedMappingsResponse expectedResponse = MutateFeedMappingsResponse.newBuilder().build(); mockFeedMappingService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<FeedMappingOperation> operations = new ArrayList<>(); MutateFeedMappingsResponse actualResponse = client.mutateFeedMappings(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockFeedMappingService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateFeedMappingsRequest actualRequest = (MutateFeedMappingsRequest) actualRequests.get(0); Assert.assertEquals(customerId, actualRequest.getCustomerId()); Assert.assertEquals(operations, actualRequest.getOperationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void mutateFeedMappingsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockFeedMappingService.addException(exception); try { String customerId = "customerId-1772061412"; List<FeedMappingOperation> operations = new ArrayList<>(); client.mutateFeedMappings(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }