You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by bd...@apache.org on 2023/03/13 14:56:36 UTC

[directory-scimple] branch develop updated: Fix copypasta for existingGroupFound

This is an automated email from the ASF dual-hosted git repository.

bdemers pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/directory-scimple.git


The following commit(s) were added to refs/heads/develop by this push:
     new 6c30d12c Fix copypasta for existingGroupFound
     new 58c1f624 Merge pull request #270 from kjthorpe18/group-found-typo
6c30d12c is described below

commit 6c30d12cb8c699377ef2939d396ef9b42f3f6399
Author: Kyle Thorpe <kt...@proofpoint.com>
AuthorDate: Sat Mar 11 13:08:56 2023 -0500

    Fix copypasta for existingGroupFound
    
    GroupService classes had existingUserFound, when it should be existingGroupFound. This fixes the typo.
---
 .../directory/scim/example/jersey/service/InMemoryGroupService.java   | 4 ++--
 .../directory/scim/example/memory/service/InMemoryGroupService.java   | 4 ++--
 .../directory/scim/example/spring/service/InMemoryGroupService.java   | 4 ++--
 .../apache/directory/scim/server/it/testapp/InMemoryGroupService.java | 4 ++--
 .../org/apache/directory/scim/spring/it/app/InMemoryGroupService.java | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java
index 3dc64d28..575e2add 100644
--- a/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java
+++ b/scim-server-examples/scim-server-jersey/src/main/java/org/apache/directory/scim/example/jersey/service/InMemoryGroupService.java
@@ -85,9 +85,9 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
     }
 
     // check to make sure the group doesn't already exist
-    boolean existingUserFound = groups.values().stream()
+    boolean existingGroupFound = groups.values().stream()
       .anyMatch(group -> resource.getExternalId().equals(group.getExternalId()));
-    if (existingUserFound) {
+    if (existingGroupFound) {
       // HTTP leaking into data layer
       throw new UnableToCreateResourceException(Response.Status.CONFLICT, "Group '" + resource.getExternalId() + "' already exists.");
     }
diff --git a/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemoryGroupService.java b/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemoryGroupService.java
index 22bfe2bf..599de035 100644
--- a/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemoryGroupService.java
+++ b/scim-server-examples/scim-server-memory/src/main/java/org/apache/directory/scim/example/memory/service/InMemoryGroupService.java
@@ -85,9 +85,9 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
     }
 
     // check to make sure the group doesn't already exist
-    boolean existingUserFound = groups.values().stream()
+    boolean existingGroupFound = groups.values().stream()
       .anyMatch(group -> resource.getExternalId().equals(group.getExternalId()));
-    if (existingUserFound) {
+    if (existingGroupFound) {
       // HTTP leaking into data layer
       throw new UnableToCreateResourceException(Response.Status.CONFLICT, "Group '" + resource.getExternalId() + "' already exists.");
     }
diff --git a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java
index 388a599a..5498f6fd 100644
--- a/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java
+++ b/scim-server-examples/scim-server-spring-boot/src/main/java/org/apache/directory/scim/example/spring/service/InMemoryGroupService.java
@@ -75,9 +75,9 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
     }
 
     // check to make sure the group doesn't already exist
-    boolean existingUserFound = groups.values().stream()
+    boolean existingGroupFound = groups.values().stream()
       .anyMatch(group -> resource.getExternalId().equals(group.getExternalId()));
-    if (existingUserFound) {
+    if (existingGroupFound) {
       // HTTP leaking into data layer
       throw new UnableToCreateResourceException(Response.Status.CONFLICT, "Group '" + resource.getExternalId() + "' already exists.");
     }
diff --git a/scim-server/src/test/java/org/apache/directory/scim/server/it/testapp/InMemoryGroupService.java b/scim-server/src/test/java/org/apache/directory/scim/server/it/testapp/InMemoryGroupService.java
index 9b7155b2..b4de6ee0 100644
--- a/scim-server/src/test/java/org/apache/directory/scim/server/it/testapp/InMemoryGroupService.java
+++ b/scim-server/src/test/java/org/apache/directory/scim/server/it/testapp/InMemoryGroupService.java
@@ -84,9 +84,9 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
     }
 
     // check to make sure the group doesn't already exist
-    boolean existingUserFound = groups.values().stream()
+    boolean existingGroupFound = groups.values().stream()
       .anyMatch(group -> resource.getExternalId().equals(group.getExternalId()));
-    if (existingUserFound) {
+    if (existingGroupFound) {
       // HTTP leaking into data layer
       throw new UnableToCreateResourceException(Response.Status.CONFLICT, "Group '" + resource.getExternalId() + "' already exists.");
     }
diff --git a/support/spring-boot/src/test/java/org/apache/directory/scim/spring/it/app/InMemoryGroupService.java b/support/spring-boot/src/test/java/org/apache/directory/scim/spring/it/app/InMemoryGroupService.java
index 5df9feb6..688367f1 100644
--- a/support/spring-boot/src/test/java/org/apache/directory/scim/spring/it/app/InMemoryGroupService.java
+++ b/support/spring-boot/src/test/java/org/apache/directory/scim/spring/it/app/InMemoryGroupService.java
@@ -74,9 +74,9 @@ public class InMemoryGroupService implements Repository<ScimGroup> {
     }
 
     // check to make sure the group doesn't already exist
-    boolean existingUserFound = groups.values().stream()
+    boolean existingGroupFound = groups.values().stream()
       .anyMatch(group -> resource.getExternalId().equals(group.getExternalId()));
-    if (existingUserFound) {
+    if (existingGroupFound) {
       // HTTP leaking into data layer
       throw new UnableToCreateResourceException(Response.Status.CONFLICT, "Group '" + resource.getExternalId() + "' already exists.");
     }