ExtensionFeedItemServiceClient implements BackgroundResource { public final MutateExtensionFeedItemsResponse mutateExtensionFeedItems( String customerId, List<ExtensionFeedItemOperation> operations) { MutateExtensionFeedItemsRequest request = MutateExtensionFeedItemsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateExtensionFeedItems(request); } protected  ExtensionFeedItemServiceClient(ExtensionFeedItemServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  ExtensionFeedItemServiceClient(ExtensionFeedItemServiceStub stub); static final ExtensionFeedItemServiceClient create(); static final ExtensionFeedItemServiceClient create(
      ExtensionFeedItemServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final ExtensionFeedItemServiceClient create(ExtensionFeedItemServiceStub stub); final ExtensionFeedItemServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") ExtensionFeedItemServiceStub getStub(); final ExtensionFeedItem getExtensionFeedItem(ExtensionFeedItemName resourceName); final ExtensionFeedItem getExtensionFeedItem(String resourceName); final ExtensionFeedItem getExtensionFeedItem(GetExtensionFeedItemRequest request); final UnaryCallable<GetExtensionFeedItemRequest, ExtensionFeedItem> getExtensionFeedItemCallable(); final MutateExtensionFeedItemsResponse mutateExtensionFeedItems(
      String customerId, List<ExtensionFeedItemOperation> operations); final MutateExtensionFeedItemsResponse mutateExtensionFeedItems(
      MutateExtensionFeedItemsRequest request); final UnaryCallable<MutateExtensionFeedItemsRequest, MutateExtensionFeedItemsResponse> mutateExtensionFeedItemsCallable(); @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 mutateExtensionFeedItemsTest() { MutateExtensionFeedItemsResponse expectedResponse = MutateExtensionFeedItemsResponse.newBuilder().build(); mockExtensionFeedItemService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<ExtensionFeedItemOperation> operations = new ArrayList<>(); MutateExtensionFeedItemsResponse actualResponse = client.mutateExtensionFeedItems(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockExtensionFeedItemService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateExtensionFeedItemsRequest actualRequest = (MutateExtensionFeedItemsRequest) 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 mutateExtensionFeedItemsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockExtensionFeedItemService.addException(exception); try { String customerId = "customerId-1772061412"; List<ExtensionFeedItemOperation> operations = new ArrayList<>(); client.mutateExtensionFeedItems(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }