CampaignFeedServiceClient implements BackgroundResource { public final MutateCampaignFeedsResponse mutateCampaignFeeds( String customerId, List<CampaignFeedOperation> operations) { MutateCampaignFeedsRequest request = MutateCampaignFeedsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateCampaignFeeds(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 mutateCampaignFeedsTest() { MutateCampaignFeedsResponse expectedResponse = MutateCampaignFeedsResponse.newBuilder().build(); mockCampaignFeedService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<CampaignFeedOperation> operations = new ArrayList<>(); MutateCampaignFeedsResponse actualResponse = client.mutateCampaignFeeds(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCampaignFeedService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateCampaignFeedsRequest actualRequest = (MutateCampaignFeedsRequest) 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 mutateCampaignFeedsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCampaignFeedService.addException(exception); try { String customerId = "customerId-1772061412"; List<CampaignFeedOperation> operations = new ArrayList<>(); client.mutateCampaignFeeds(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }