Skip to content

Commit

Permalink
OAK-11317 : removed conversion to set twice for ExternalGroupPrincipa…
Browse files Browse the repository at this point in the history
…lProviderTest
  • Loading branch information
Rishabh Kumar committed Dec 20, 2024
1 parent 412cad0 commit b02f36f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ void sync(@NotNull ExternalUser externalUser) throws Exception {
@NotNull
Set<Principal> getExpectedGroupPrincipals(@NotNull String userId) throws Exception {
if (syncConfig.user().getMembershipNestingDepth() == 1) {
return CollectionUtils.toSet(idp.getUser(userId).getDeclaredGroups()).stream().map(externalIdentityRef -> {
return CollectionUtils.toStream(idp.getUser(userId).getDeclaredGroups()).map(externalIdentityRef -> {
try {
return new PrincipalImpl(idp.getIdentity(externalIdentityRef).getPrincipalName());
} catch (ExternalIdentityException e) {
throw new RuntimeException(e);
}
}).collect(Collectors.toUnmodifiableSet());
}).collect(Collectors.toSet());
} else {
Set<Principal> set = new HashSet<>();
collectExpectedPrincipals(set, idp.getUser(userId).getDeclaredGroups(), syncConfig.user().getMembershipNestingDepth());
Expand Down

0 comments on commit b02f36f

Please sign in to comment.