ilgrosso commented on code in PR #958:
URL: https://github.com/apache/syncope/pull/958#discussion_r1922547579


##########
fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java:
##########
@@ -1820,4 +1826,58 @@ void issueSYNCOPE1818() {
             jdbcTemplate.update("DELETE FROM TESTPULL WHERE USERNAME = 
'rossini'");
         }
     }
+
+    @Test
+    void issueSYNCOPE1853() {
+        UserTO bellini = USER_SERVICE.read("bellini");
+        UserTO vivaldi = USER_SERVICE.read("vivaldi");
+        GroupTO cGroupForPropagation = createGroup(
+                new GroupCR.Builder(SyncopeConstants.ROOT_REALM, 
"cGroupForPropagation")
+                        .resource(RESOURCE_NAME_CSV)
+                        .build()).getEntity();
+        GroupTO dGroupForPropagation = createGroup(
+                new GroupCR.Builder(SyncopeConstants.ROOT_REALM, 
"dGroupForPropagation")
+                        .resource(RESOURCE_NAME_CSV)
+                        .build()).getEntity();
+        // 1. assign both groups cGroupForPropagation and dGroupForPropagation 
with resource-csv to bellini
+        updateUser(new UserUR.Builder(bellini.getKey()).memberships(
+                new 
MembershipUR.Builder(cGroupForPropagation.getKey()).build(),
+                new 
MembershipUR.Builder(dGroupForPropagation.getKey()).build()).build());
+        // 2. assign cGroupForPropagation also to vivaldi
+        updateUser(new UserUR.Builder(vivaldi.getKey()).membership(
+                new 
MembershipUR.Builder(dGroupForPropagation.getKey()).build()).build());
+        // 3. propagation tasks cleanup
+        TASK_SERVICE.search(
+                        new TaskQuery.Builder(TaskType.PROPAGATION)
+                                .anyTypeKind(AnyTypeKind.USER)
+                                .resource(RESOURCE_NAME_CSV)
+                                .entityKey(bellini.getKey())
+                                .build()).getResult()
+                .forEach(pt -> TASK_SERVICE.delete(TaskType.PROPAGATION, 
pt.getKey()));
+        TASK_SERVICE.search(
+                        new TaskQuery.Builder(TaskType.PROPAGATION)
+                                .anyTypeKind(AnyTypeKind.USER)
+                                .resource(RESOURCE_NAME_CSV)
+                                .entityKey(vivaldi.getKey())
+                                .build()).getResult()
+                .forEach(pt -> TASK_SERVICE.delete(TaskType.PROPAGATION, 
pt.getKey()));
+        // 4. delete group cGroupForPropagation: no deprovision should be 
fired on bellini, since there is already
+        // bGroupForPropagation, deprovision instead must be fired for vivaldi
+        GROUP_SERVICE.delete(cGroupForPropagation.getKey());
+        Awaitility.await().during(5, TimeUnit.SECONDS).atMost(10, 
TimeUnit.SECONDS).until(() -> TASK_SERVICE.search(

Review Comment:
   import static for `Awaitility` as the rest of the code, please



##########
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/GroupDataBinderImpl.java:
##########
@@ -460,12 +460,18 @@ public GroupTO getGroupTO(final String key) {
         return getGroupTO(groupDAO.authFind(key), true);
     }
 
-    protected static void populateTransitiveResources(
-            final Group group, final Any<?> any, final Map<String, 
PropagationByResource<String>> result) {
+    protected void populateTransitiveResources(

Review Comment:
   any reason to remove `static` here?



##########
fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java:
##########
@@ -1820,4 +1826,58 @@ void issueSYNCOPE1818() {
             jdbcTemplate.update("DELETE FROM TESTPULL WHERE USERNAME = 
'rossini'");
         }
     }
+
+    @Test
+    void issueSYNCOPE1853() {
+        UserTO bellini = USER_SERVICE.read("bellini");

Review Comment:
   Why the need to read `bellini` and `vivaldi` if the following code is just 
using their keys?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@syncope.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to