UserListServiceClient implements BackgroundResource { public final MutateUserListsResponse mutateUserLists( String customerId, List<UserListOperation> operations) { MutateUserListsRequest request = MutateUserListsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateUserLists(request); } protected  UserListServiceClient(UserListServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  UserListServiceClient(UserListServiceStub stub); static final UserListServiceClient create(); static final UserListServiceClient create(UserListServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final UserListServiceClient create(UserListServiceStub stub); final UserListServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") UserListServiceStub getStub(); final UserList getUserList(UserListName resourceName); final UserList getUserList(String resourceName); final UserList getUserList(GetUserListRequest request); final UnaryCallable<GetUserListRequest, UserList> getUserListCallable(); final MutateUserListsResponse mutateUserLists(
      String customerId, List<UserListOperation> operations); final MutateUserListsResponse mutateUserLists(MutateUserListsRequest request); final UnaryCallable<MutateUserListsRequest, MutateUserListsResponse> mutateUserListsCallable(); @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 mutateUserListsTest() { MutateUserListsResponse expectedResponse = MutateUserListsResponse.newBuilder().build(); mockUserListService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<UserListOperation> operations = new ArrayList<>(); MutateUserListsResponse actualResponse = client.mutateUserLists(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockUserListService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateUserListsRequest actualRequest = (MutateUserListsRequest) 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 mutateUserListsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockUserListService.addException(exception); try { String customerId = "customerId-1772061412"; List<UserListOperation> operations = new ArrayList<>(); client.mutateUserLists(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }