Skip to content

Commit

Permalink
Fix Sonar: change collect(toList()) to toList()
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianhoelzl-sap committed Jun 7, 2024
1 parent b94a96d commit 0e1683b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.cloudfoundry.identity.uaa.alias;

import static java.util.stream.Collectors.toList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.cloudfoundry.identity.uaa.constants.OriginKeys.OIDC10;
import static org.cloudfoundry.identity.uaa.constants.OriginKeys.UAA;
Expand Down Expand Up @@ -138,7 +137,7 @@ protected static IdentityProvider<?> buildOidcIdpWithAliasProperties(
}

protected static List<String> getScopesForZone(final String zoneId, final String... scopes) {
return Stream.of(scopes).map(scope -> String.format("zones.%s.%s", zoneId, scope)).collect(toList());
return Stream.of(scopes).map(scope -> String.format("zones.%s.%s", zoneId, scope)).toList();
}

protected static IdentityProvider<?> buildUaaIdpWithAliasProperties(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.cloudfoundry.identity.uaa.scim.endpoints;

import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.cloudfoundry.identity.uaa.constants.OriginKeys.OIDC10;
Expand Down Expand Up @@ -1481,7 +1480,7 @@ private static void assertIsCorrectAliasPair(
final List<String> directGroupNamesAliasUser = aliasUser.getGroups().stream()
.filter(group -> group.getType() == DIRECT)
.map(ScimUser.Group::getDisplay)
.collect(toList());
.toList();
assertThat(directGroupNamesAliasUser).hasSameElementsAs(defaultGroupNamesAliasZone);

final ScimMeta originalUserMeta = originalUser.getMeta();
Expand Down

0 comments on commit 0e1683b

Please sign in to comment.