Skip to content

Commit

Permalink
change post user deletion event to get with id
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuradhaSK committed Jan 25, 2025
1 parent bfc56dc commit 1b6bc50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.Map;

import static org.wso2.carbon.identity.event.IdentityEventConstants.Event.POST_DELETE_ROLE_V2_EVENT;
import static org.wso2.carbon.identity.event.IdentityEventConstants.Event.POST_DELETE_USER;
import static org.wso2.carbon.identity.event.IdentityEventConstants.Event.POST_DELETE_USER_WITH_ID;
import static org.wso2.carbon.identity.event.IdentityEventConstants.EventProperty.ROLE_ID;
import static org.wso2.carbon.identity.event.IdentityEventConstants.EventProperty.USER_ID;

Expand All @@ -49,7 +49,7 @@ public void handleEvent(Event event) throws IdentityEventException {
String deletedRoleId = (String) eventProperties.get(ROLE_ID);
deleteSharedResourceAttributesByRoleId(deletedRoleId);
break;
case POST_DELETE_USER:
case POST_DELETE_USER_WITH_ID:
String deletedUserId = (String) eventProperties.get(USER_ID);
deleteResourceSharingPoliciesOfUser(deletedUserId);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.MockitoAnnotations.openMocks;
import static org.wso2.carbon.identity.event.IdentityEventConstants.Event.POST_DELETE_ROLE_V2_EVENT;
import static org.wso2.carbon.identity.event.IdentityEventConstants.Event.POST_DELETE_USER;
import static org.wso2.carbon.identity.event.IdentityEventConstants.Event.POST_DELETE_USER_WITH_ID;
import static org.wso2.carbon.identity.event.IdentityEventConstants.EventProperty.ROLE_ID;
import static org.wso2.carbon.identity.event.IdentityEventConstants.EventProperty.USER_ID;
import static org.wso2.carbon.identity.organization.resource.sharing.policy.management.constant.SharedAttributeType.ROLE;
Expand Down Expand Up @@ -68,7 +68,7 @@ public void testPosUserDeleteHandleMethod() throws Exception {
// Trigger the event.
Map<String, Object> eventProperties = new HashMap<>();
eventProperties.put(USER_ID, "user-id");
Event event = new Event(POST_DELETE_USER, eventProperties);
Event event = new Event(POST_DELETE_USER_WITH_ID, eventProperties);

SharingPolicyCleanUpHandler sharingPolicyCleanUpHandler = new SharingPolicyCleanUpHandler();
sharingPolicyCleanUpHandler.handleEvent(event);
Expand Down

0 comments on commit 1b6bc50

Please sign in to comment.