AdGroupFeedServiceClient implements BackgroundResource { public final MutateAdGroupFeedsResponse mutateAdGroupFeeds( String customerId, List<AdGroupFeedOperation> operations) { MutateAdGroupFeedsRequest request = MutateAdGroupFeedsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateAdGroupFeeds(request); } protected  AdGroupFeedServiceClient(AdGroupFeedServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdGroupFeedServiceClient(AdGroupFeedServiceStub stub); static final AdGroupFeedServiceClient create(); static final AdGroupFeedServiceClient create(AdGroupFeedServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdGroupFeedServiceClient create(AdGroupFeedServiceStub stub); final AdGroupFeedServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdGroupFeedServiceStub getStub(); final AdGroupFeed getAdGroupFeed(AdGroupFeedName resourceName); final AdGroupFeed getAdGroupFeed(String resourceName); final AdGroupFeed getAdGroupFeed(GetAdGroupFeedRequest request); final UnaryCallable<GetAdGroupFeedRequest, AdGroupFeed> getAdGroupFeedCallable(); final MutateAdGroupFeedsResponse mutateAdGroupFeeds(
      String customerId, List<AdGroupFeedOperation> operations); final MutateAdGroupFeedsResponse mutateAdGroupFeeds(MutateAdGroupFeedsRequest request); final UnaryCallable<MutateAdGroupFeedsRequest, MutateAdGroupFeedsResponse> mutateAdGroupFeedsCallable(); @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 mutateAdGroupFeedsTest() { MutateAdGroupFeedsResponse expectedResponse = MutateAdGroupFeedsResponse.newBuilder().build(); mockAdGroupFeedService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<AdGroupFeedOperation> operations = new ArrayList<>(); MutateAdGroupFeedsResponse actualResponse = client.mutateAdGroupFeeds(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdGroupFeedService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateAdGroupFeedsRequest actualRequest = (MutateAdGroupFeedsRequest) 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 mutateAdGroupFeedsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdGroupFeedService.addException(exception); try { String customerId = "customerId-1772061412"; List<AdGroupFeedOperation> operations = new ArrayList<>(); client.mutateAdGroupFeeds(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }