diff --git a/src/main/java/sh/libre/scim/core/GroupAdapter.java b/src/main/java/sh/libre/scim/core/GroupAdapter.java index aa42531bc2..31b25b5769 100644 --- a/src/main/java/sh/libre/scim/core/GroupAdapter.java +++ b/src/main/java/sh/libre/scim/core/GroupAdapter.java @@ -121,8 +121,9 @@ public class GroupAdapter extends Adapter { @Override public Boolean tryToMap() { - Optional group = session.groups().getGroupsStream(realm).filter( - x -> StringUtils.equals(x.getName(), externalId) || StringUtils.equals(x.getName(), displayName)) + Set names = Set.of(externalId, displayName); + Optional group = session.groups().getGroupsStream(realm) + .filter(groupModel -> names.contains(groupModel.getName())) .findFirst(); if (group.isPresent()) { setId(group.get().getId()); diff --git a/src/main/java/sh/libre/scim/core/ScimDispatcher.java b/src/main/java/sh/libre/scim/core/ScimDispatcher.java index 3858c1bd39..4b2beedf2c 100644 --- a/src/main/java/sh/libre/scim/core/ScimDispatcher.java +++ b/src/main/java/sh/libre/scim/core/ScimDispatcher.java @@ -25,7 +25,7 @@ public class ScimDispatcher { public void run(String scope, Consumer f) { session.getContext().getRealm().getComponentsStream() .filter((m) -> { - return StringUtils.equals(ScimStorageProviderFactory.ID, m.getProviderId()) + return ScimStorageProviderFactory.ID.equals(m.getProviderId()) && m.get("enabled", true) && m.get("propagation-" + scope, false); }) diff --git a/src/main/java/sh/libre/scim/core/UserAdapter.java b/src/main/java/sh/libre/scim/core/UserAdapter.java index 6f8677113d..8d527f8def 100644 --- a/src/main/java/sh/libre/scim/core/UserAdapter.java +++ b/src/main/java/sh/libre/scim/core/UserAdapter.java @@ -235,6 +235,6 @@ public class UserAdapter extends Adapter { @Override public Boolean skipRefresh() { - return StringUtils.equals(getUsername(), "admin"); + return "admin".equals(getUsername()); } }