diff --git a/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/AbstractDynamicTest.java b/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/AbstractDynamicTest.java index f1f7521e58f..78bfff9a5f1 100644 --- a/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/AbstractDynamicTest.java +++ b/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/AbstractDynamicTest.java @@ -16,6 +16,7 @@ */ package org.apache.jackrabbit.oak.spi.security.authentication.external.impl; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.api.security.user.Authorizable; import org.apache.jackrabbit.api.security.user.UserManager; @@ -88,7 +89,7 @@ private void createAutoMembershipGroups() throws RepositoryException { DefaultSyncConfig sc = createSyncConfig(); UserManager um = getUserManager(r); // create automembership groups - for (String id : Iterables.concat(sc.user().getAutoMembership(), sc.group().getAutoMembership())) { + for (String id : IterableUtils.chainedIterable(sc.user().getAutoMembership(), sc.group().getAutoMembership())) { um.createGroup(id); } } diff --git a/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/AbstractPrincipalTest.java b/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/AbstractPrincipalTest.java index 49cc02ac3f0..5de40f2dd3c 100644 --- a/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/AbstractPrincipalTest.java +++ b/oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/AbstractPrincipalTest.java @@ -16,6 +16,7 @@ */ package org.apache.jackrabbit.oak.spi.security.authentication.external.impl.principal; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.api.security.principal.GroupPrincipal; import org.apache.jackrabbit.api.security.user.Group; @@ -81,7 +82,7 @@ protected DefaultSyncConfig createSyncConfig() { } @NotNull String[] getAutoMembership() { - return Iterables.toArray(Iterables.concat(syncConfig.user().getAutoMembership(),syncConfig.group().getAutoMembership()), String.class); + return Iterables.toArray(IterableUtils.chainedIterable(syncConfig.user().getAutoMembership(),syncConfig.group().getAutoMembership()), String.class); } @NotNull AutoMembershipConfig getAutoMembershipConfig() { diff --git a/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/CugPermissionProviderTest.java b/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/CugPermissionProviderTest.java index 9d26e422a25..7563f6b5b19 100644 --- a/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/CugPermissionProviderTest.java +++ b/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/CugPermissionProviderTest.java @@ -25,6 +25,7 @@ import javax.jcr.GuestCredentials; import javax.jcr.Session; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.oak.api.ContentSession; import org.apache.jackrabbit.oak.api.Root; @@ -519,7 +520,7 @@ public void testHasReadPrivilegesAtCug() { */ @Test public void testHasNonReadPrivileges() { - for (String p : Iterables.concat(READABLE_PATHS, NOT_READABLE_PATHS)) { + for (String p : IterableUtils.chainedIterable(READABLE_PATHS, NOT_READABLE_PATHS)) { Tree tree = root.getTree(p); if (tree.exists()) { assertFalse(cugPermProvider.hasPrivileges(tree, PrivilegeConstants.JCR_WRITE)); @@ -646,7 +647,7 @@ public void testGetTreePermissionNonExistingVersionTree() { */ @Test public void testIsGrantedNonRead() { - for (String p : Iterables.concat(READABLE_PATHS, NOT_READABLE_PATHS)) { + for (String p : IterableUtils.chainedIterable(READABLE_PATHS, NOT_READABLE_PATHS)) { Tree tree = root.getTree(p); if (tree.exists()) { assertFalse(cugPermProvider.isGranted(tree, null, Permissions.ALL)); diff --git a/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/NestedCugHookTest.java b/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/NestedCugHookTest.java index e5a8fef4bb0..d5ea1492613 100644 --- a/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/NestedCugHookTest.java +++ b/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/NestedCugHookTest.java @@ -16,6 +16,7 @@ */ package org.apache.jackrabbit.oak.spi.security.authorization.cug.impl; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.api.Type; @@ -354,7 +355,7 @@ public void testHiddenChildNodeAdded() throws Exception { NodeState child = mock(NodeState.class); Iterable newCnes = Collections.singleton(new MemoryChildNodeEntry(":hidden", child)); - Iterable cnes = Iterables.concat(newCnes, before.getChildNodeEntries()); + Iterable cnes = IterableUtils.chainedIterable(newCnes, before.getChildNodeEntries()); when(after.getChildNodeEntries()).thenReturn(cnes); when(after.getChildNode(":hidden")).thenReturn(child); @@ -373,13 +374,13 @@ public void testHiddenChildNodeChanged() { NodeState child = mock(NodeState.class); Iterable hidden = Collections.singleton(new MemoryChildNodeEntry(":hidden", child)); - Iterable cnes = Iterables.concat(hidden, nodeState.getChildNodeEntries()); + Iterable cnes = IterableUtils.chainedIterable(hidden, nodeState.getChildNodeEntries()); when(before.getChildNodeEntries()).thenReturn(cnes); when(before.getChildNode(":hidden")).thenReturn(child); NodeState child2 = when(mock(NodeState.class).exists()).thenReturn(true).getMock(); hidden = Collections.singleton(new MemoryChildNodeEntry(":hidden", child2)); - cnes = Iterables.concat(hidden, nodeState.getChildNodeEntries()); + cnes = IterableUtils.chainedIterable(hidden, nodeState.getChildNodeEntries()); when(after.getChildNodeEntries()).thenReturn(cnes); when(after.getChildNode(":hidden")).thenReturn(child2); @@ -398,7 +399,7 @@ public void testHiddenChildNodeDeleted() { NodeState child = mock(NodeState.class); Iterable deletedCnes = Collections.singleton(new MemoryChildNodeEntry(":hidden", child)); - Iterable cnes = Iterables.concat(deletedCnes, after.getChildNodeEntries()); + Iterable cnes = IterableUtils.chainedIterable(deletedCnes, after.getChildNodeEntries()); when(before.getChildNodeEntries()).thenReturn(cnes); when(before.getChildNode(":hidden")).thenReturn(child); diff --git a/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/VersionTest.java b/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/VersionTest.java index 0a90e552537..3ef3291c852 100644 --- a/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/VersionTest.java +++ b/oak-authorization-cug/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/cug/impl/VersionTest.java @@ -20,6 +20,7 @@ import java.util.List; import java.util.Set; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.JcrConstants; import org.apache.jackrabbit.oak.api.ContentSession; @@ -87,7 +88,7 @@ public void before() throws Exception { "/content/aa/bb" /* granted by ace, denied by cug */ ); - for (String path : Iterables.concat(readAccess, noReadAccess)) { + for (String path : IterableUtils.chainedIterable(readAccess, noReadAccess)) { addVersionContent(path); } diff --git a/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionHookTest.java b/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionHookTest.java index f438104af8d..3c968afb782 100644 --- a/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionHookTest.java +++ b/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/permission/PermissionHookTest.java @@ -16,6 +16,7 @@ */ package org.apache.jackrabbit.oak.security.authorization.permission; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.JcrConstants; import org.apache.jackrabbit.api.security.JackrabbitAccessControlList; @@ -816,7 +817,7 @@ public void testHiddenChildNodeAdded() throws Exception { NodeState child = mock(NodeState.class); Iterable newCnes = Collections.singleton(new MemoryChildNodeEntry(":hidden", child)); - Iterable cnes = Iterables.concat(newCnes, before.getChildNodeEntries()); + Iterable cnes = IterableUtils.chainedIterable(newCnes, before.getChildNodeEntries()); when(after.getChildNodeEntries()).thenReturn(cnes); when(after.getChildNode(":hidden")).thenReturn(child); @@ -836,13 +837,13 @@ public void testHiddenChildNodeChanged() { NodeState child = mock(NodeState.class); Iterable hidden = Collections.singleton(new MemoryChildNodeEntry(":hidden", child)); - Iterable cnes = Iterables.concat(hidden, nodeState.getChildNodeEntries()); + Iterable cnes = IterableUtils.chainedIterable(hidden, nodeState.getChildNodeEntries()); when(before.getChildNodeEntries()).thenReturn(cnes); when(before.getChildNode(":hidden")).thenReturn(child); NodeState child2 = when(mock(NodeState.class).exists()).thenReturn(true).getMock(); hidden = Collections.singleton(new MemoryChildNodeEntry(":hidden", child2)); - cnes = Iterables.concat(hidden, nodeState.getChildNodeEntries()); + cnes = IterableUtils.chainedIterable(hidden, nodeState.getChildNodeEntries()); when(after.getChildNodeEntries()).thenReturn(cnes); when(after.getChildNode(":hidden")).thenReturn(child2); @@ -861,7 +862,7 @@ public void testHiddenChildNodeDeleted() { NodeState child = mock(NodeState.class); Iterable deletedCnes = Collections.singleton(new MemoryChildNodeEntry(":hidden", child)); - Iterable cnes = Iterables.concat(deletedCnes, after.getChildNodeEntries()); + Iterable cnes = IterableUtils.chainedIterable(deletedCnes, after.getChildNodeEntries()); when(before.getChildNodeEntries()).thenReturn(cnes); when(before.getChildNode(":hidden")).thenReturn(child); diff --git a/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/MembershipBaseTest.java b/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/MembershipBaseTest.java index c141ab042e5..9261d443f29 100644 --- a/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/MembershipBaseTest.java +++ b/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/MembershipBaseTest.java @@ -16,6 +16,7 @@ */ package org.apache.jackrabbit.oak.security.user; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.JcrConstants; import org.apache.jackrabbit.api.security.user.Authorizable; @@ -72,7 +73,7 @@ public void after() throws Exception { try { clearInvocations(monitor); root.refresh(); - for (String path : Iterables.concat(testUsers, testGroups)) { + for (String path : IterableUtils.chainedIterable(testUsers, testGroups)) { Authorizable auth = userMgr.getAuthorizableByPath(path); if (auth != null) { auth.remove(); diff --git a/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserContextTest.java b/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserContextTest.java index 4afdd01266b..205893f086f 100644 --- a/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserContextTest.java +++ b/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserContextTest.java @@ -21,6 +21,8 @@ import java.util.List; import java.util.Map; import java.util.Set; + +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.JcrConstants; import org.apache.jackrabbit.oak.api.PropertyState; @@ -145,7 +147,7 @@ public void testNameNotDefinesProperty() { @Test public void testParentNotDefinesProperty() { - for (String propName : Iterables.concat(USER_PROPERTY_NAMES, GROUP_PROPERTY_NAMES)) { + for (String propName : IterableUtils.chainedIterable(USER_PROPERTY_NAMES, GROUP_PROPERTY_NAMES)) { PropertyState property = PropertyStates.createProperty(propName, "value"); for (String ntName : new String[] {NodeTypeConstants.NT_OAK_UNSTRUCTURED, NT_REP_AUTHORIZABLE_FOLDER}) { @@ -262,7 +264,7 @@ public void testNonExistingTreeDefinesLocation() { @Test public void testNonExistingTreeDefinesLocation2() { - for (String name : Iterables.concat(USER_PROPERTY_NAMES, GROUP_PROPERTY_NAMES)) { + for (String name : IterableUtils.chainedIterable(USER_PROPERTY_NAMES, GROUP_PROPERTY_NAMES)) { String path = "/some/path/endingWith/reservedName/" + name; for (String ntName : NT_NAMES) { @@ -279,7 +281,7 @@ public void testNonExistingTreeDefinesLocation2() { @Test public void testNoTreeDefinesLocationReservedEnding() { - for (String name : Iterables.concat(USER_PROPERTY_NAMES, GROUP_PROPERTY_NAMES)) { + for (String name : IterableUtils.chainedIterable(USER_PROPERTY_NAMES, GROUP_PROPERTY_NAMES)) { String path = "/some/path/endingWith/reservedName/" + name; TreeLocation location = Mockito.mock(TreeLocation.class); when(location.getPath()).thenReturn(path); diff --git a/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/action/GroupActionTest.java b/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/action/GroupActionTest.java index 302926740e0..2814c6b287f 100644 --- a/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/action/GroupActionTest.java +++ b/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/action/GroupActionTest.java @@ -16,6 +16,7 @@ */ package org.apache.jackrabbit.oak.security.user.action; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.api.security.user.Group; import org.apache.jackrabbit.api.security.user.User; @@ -120,7 +121,7 @@ public void testMembersAdded() throws Exception { Set memberIds = Set.of(testUser01.getID()); Set failedIds = Set.of(testUser02.getID(), testGroup.getID()); - Iterable ids = Iterables.concat(memberIds, failedIds); + Iterable ids = IterableUtils.chainedIterable(memberIds, failedIds); testGroup.addMembers(Iterables.toArray(ids, String.class)); @@ -143,7 +144,7 @@ public void testMembersRemoved() throws Exception { Set memberIds = Set.of(testUser01.getID()); Set failedIds = Set.of(testUser02.getID(), testGroup.getID()); - Iterable ids = Iterables.concat(memberIds, failedIds); + Iterable ids = IterableUtils.chainedIterable(memberIds, failedIds); testGroup.removeMembers(Iterables.toArray(ids, String.class)); verify(groupAction, times(1)).onMembersRemoved(testGroup, memberIds, failedIds, root, getNamePathMapper()); diff --git a/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ObservationQueueTest.java b/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ObservationQueueTest.java index 0171a38508a..3f55d7b2b21 100644 --- a/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ObservationQueueTest.java +++ b/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/ObservationQueueTest.java @@ -40,6 +40,7 @@ import javax.jcr.security.AccessControlManager; import javax.jcr.security.Privilege; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.guava.common.collect.Iterators; import org.apache.jackrabbit.api.JackrabbitSession; @@ -125,14 +126,14 @@ public void heavyLoad() throws Throwable { Session s = loginUser(repos.next()); observers.add(new Thread(new Observer(s, queueLength))); } - for (Thread t : Iterables.concat(writers, readers, observers, loggers)) { + for (Thread t : IterableUtils.chainedIterable(writers, readers, observers, loggers)) { t.start(); } - for (Thread t : Iterables.concat(writers, readers)) { + for (Thread t : IterableUtils.chainedIterable(writers, readers)) { t.join(); } LOG.info("Writes stopped. Waiting for observers..."); - for (Thread t : Iterables.concat(observers, loggers)) { + for (Thread t : IterableUtils.chainedIterable(observers, loggers)) { t.join(); } for (Throwable t : exceptions) { diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java index e8baf83f30e..e5292a302cc 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndexTest.java @@ -43,6 +43,7 @@ import javax.jcr.PropertyType; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.ComparisonChain; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.guava.common.io.CountingInputStream; @@ -1107,9 +1108,9 @@ public void sortQueriesWithStringIgnoredMulti_OrderedProps() throws Exception { root.commit(); assertOrderedQuery("select [jcr:path] from [nt:base] where [bar] = 'baz' order by [foo]", ListUtils - .toList(Iterables.concat(List.of("/test/a"), getSortedPaths(tuples, OrderDirection.ASC)))); + .toList(IterableUtils.chainedIterable(List.of("/test/a"), getSortedPaths(tuples, OrderDirection.ASC)))); assertOrderedQuery("select [jcr:path] from [nt:base] where [bar] = 'baz' order by [foo] DESC", ListUtils - .toList(Iterables.concat(getSortedPaths(tuples, OrderDirection.DESC), List.of("/test/a")))); + .toList(IterableUtils.chainedIterable(getSortedPaths(tuples, OrderDirection.DESC), List.of("/test/a")))); } void assertSortedString() throws CommitFailedException { @@ -1197,10 +1198,10 @@ public void sortQueriesWithDateStringMixed_OrderedProps() throws Exception { // Add the path of property added as timestamp string in the sorted list assertOrderedQuery("select [jcr:path] from [nt:base] where [bar] = 'baz' order by [foo]", ListUtils - .toList(Iterables.concat(List.of("/test/n0"), getSortedPaths(tuples, OrderDirection.ASC)))); + .toList(IterableUtils.chainedIterable(List.of("/test/n0"), getSortedPaths(tuples, OrderDirection.ASC)))); // Append the path of property added as timestamp string to the sorted list assertOrderedQuery("select [jcr:path] from [nt:base] where [bar] = 'baz' order by [foo] DESC", ListUtils - .toList(Iterables.concat(getSortedPaths(tuples, OrderDirection.DESC), List.of("/test/n0")))); + .toList(IterableUtils.chainedIterable(getSortedPaths(tuples, OrderDirection.DESC), List.of("/test/n0")))); } @Test diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java index 30a2117c615..401fe62e030 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java @@ -16,6 +16,7 @@ */ package org.apache.jackrabbit.oak.plugins.index.lucene.directory; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.oak.InitialContentHelper; import org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser; @@ -124,7 +125,7 @@ public void concurrentPrefetch() throws Exception { waitForLeechingCoRsToFinish(); - for (Directory d : Iterables.concat(Collections.singleton(firstCoR), leechingCoRs)) { + for (Directory d : IterableUtils.chainedIterable(Collections.singleton(firstCoR), leechingCoRs)) { IndexInput input = d.openInput("file", IOContext.READ); assertFalse(d + " must not be reading from remote", input.toString().startsWith(REMOTE_INPUT_PREFIX)); diff --git a/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/AuthInfoImplTest.java b/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/AuthInfoImplTest.java index a8fb7711fd5..12a72141c7f 100644 --- a/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/AuthInfoImplTest.java +++ b/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/AuthInfoImplTest.java @@ -25,6 +25,7 @@ import javax.jcr.SimpleCredentials; import javax.security.auth.Subject; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.oak.api.AuthInfo; import org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl; @@ -128,7 +129,7 @@ public void testCreateFromSubjectWithAnyCredentials() { @Test public void testCreateFromPrincipalIterables() { - AuthInfo info = new AuthInfoImpl(USER_ID, ATTRIBUTES, Iterables.concat(PRINCIPALS, Collections.emptyList())); + AuthInfo info = new AuthInfoImpl(USER_ID, ATTRIBUTES, IterableUtils.chainedIterable(PRINCIPALS, Collections.emptyList())); assertEquals(authInfo.toString(), info.toString()); } diff --git a/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/principal/CompositePrincipalProviderTest.java b/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/principal/CompositePrincipalProviderTest.java index edc9369b3e2..4fd1db96bb4 100644 --- a/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/principal/CompositePrincipalProviderTest.java +++ b/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/principal/CompositePrincipalProviderTest.java @@ -27,6 +27,7 @@ import java.util.Set; import java.util.TreeSet; +import org.apache.commons.collections4.IterableUtils; import org.apache.jackrabbit.guava.common.collect.Iterables; import org.apache.jackrabbit.api.security.principal.GroupPrincipal; @@ -55,7 +56,7 @@ public class CompositePrincipalProviderTest { private final PrincipalProvider cpp = CompositePrincipalProvider.of(List.of(pp1, pp2)); private Iterable testPrincipals() { - return Iterables.concat(pp1.getTestPrincipals(), pp2.getTestPrincipals()); + return IterableUtils.chainedIterable(pp1.getTestPrincipals(), pp2.getTestPrincipals()); } private static void assertIterator(@NotNull Iterable expected, @NotNull Iterator result) { @@ -136,7 +137,7 @@ public void findPrincipalsUnknown() { @Test public void findPrincipalsByTypeGroup() { - Iterable expected = Iterables.concat(Set.of(EveryonePrincipal.getInstance()), Iterables.filter(testPrincipals(), + Iterable expected = IterableUtils.chainedIterable(Set.of(EveryonePrincipal.getInstance()), Iterables.filter(testPrincipals(), input -> input instanceof GroupPrincipal)); Iterator result = cpp.findPrincipals(PrincipalManager.SEARCH_TYPE_GROUP); @@ -154,7 +155,7 @@ public void findPrincipalsByTypeNotGroup() { @Test public void findPrincipalsByTypeAll() { Iterator result = cpp.findPrincipals(PrincipalManager.SEARCH_TYPE_ALL); - assertIterator(Iterables.concat(Set.of(EveryonePrincipal.getInstance()), testPrincipals()), result); + assertIterator(IterableUtils.chainedIterable(Set.of(EveryonePrincipal.getInstance()), testPrincipals()), result); } /** diff --git a/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/privilege/PrivilegeBitsProviderTest.java b/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/privilege/PrivilegeBitsProviderTest.java index f891ad46019..7c122e5725e 100644 --- a/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/privilege/PrivilegeBitsProviderTest.java +++ b/oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/privilege/PrivilegeBitsProviderTest.java @@ -417,7 +417,7 @@ public void testGetAggregatedPrivilegeNamesBuiltInTwice() { @Test public void testGetAggregatedPrivilegeNamesMultipleBuiltIn() { - Iterable expected = SetUtils.toSet(Iterables.concat( + Iterable expected = SetUtils.toSet(IterableUtils.chainedIterable( bitsProvider.getAggregatedPrivilegeNames(JCR_READ), bitsProvider.getAggregatedPrivilegeNames(JCR_WRITE))); @@ -429,7 +429,7 @@ public void testGetAggregatedPrivilegeNamesMultipleBuiltIn() { @Test public void testGetAggregatedPrivilegeNamesMultipleBuiltIn2() { - Iterable expected = SetUtils.toSet(Iterables.concat( + Iterable expected = SetUtils.toSet(IterableUtils.chainedIterable( bitsProvider.getAggregatedPrivilegeNames(JCR_READ), bitsProvider.getAggregatedPrivilegeNames(JCR_WRITE))); @@ -440,7 +440,7 @@ public void testGetAggregatedPrivilegeNamesMultipleBuiltIn2() { @Test public void testGetAggregatedPrivilegeNamesMixedBuiltIn() { - Iterable expected = SetUtils.toSet(Iterables.concat( + Iterable expected = SetUtils.toSet(IterableUtils.chainedIterable( Set.of(JCR_LOCK_MANAGEMENT), bitsProvider.getAggregatedPrivilegeNames(JCR_WRITE))); @@ -498,7 +498,7 @@ public void testGetAggregatedPrivilegeNamesNestedWithCache() { when(privTree.getChild(KNOWN_PRIV_NAME)).thenReturn(pTree); Iterable result = bitsProvider.getAggregatedPrivilegeNames(KNOWN_PRIV_NAME); - Set expected = SetUtils.toSet(Iterables.concat( + Set expected = SetUtils.toSet(IterableUtils.chainedIterable( Set.of(JCR_ADD_CHILD_NODES), bitsProvider.getAggregatedPrivilegeNames(JCR_READ))); diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeDocumentTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeDocumentTest.java index 5535bb97157..db2c29e6151 100644 --- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeDocumentTest.java +++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/NodeDocumentTest.java @@ -1068,7 +1068,7 @@ public T find(Collection collection, // do not yet merge, but create more test data int numMoreChanges = 50; List moreRevs = ListUtils.reverse(createTestData(nodeStores, random, numMoreChanges, numChanges)); - headRevisions = ListUtils.toList(Iterables.concat(moreRevs, headRevisions)); + headRevisions = ListUtils.toList(IterableUtils.chainedIterable(moreRevs, headRevisions)); numChanges += numMoreChanges; // now merge the branch and update 'q'. this will split @@ -1081,7 +1081,7 @@ public T find(Collection collection, // and create yet more test data numMoreChanges = 50; moreRevs = ListUtils.reverse(createTestData(nodeStores, random, numMoreChanges, numChanges)); - headRevisions = ListUtils.toList(Iterables.concat(moreRevs, headRevisions)); + headRevisions = ListUtils.toList(IterableUtils.chainedIterable(moreRevs, headRevisions)); numChanges += numMoreChanges; NodeDocument doc = getRootDocument(store);