@Test public void testExecute() { context.checking(new Expectations() { { oneOf(mapper).execute(with(equalInternally(request))); will(returnValue(Boolean.TRUE)); } }); TaskHandlerActionContext<PrincipalActionContext> actionCtx = TestContextCreator .createTaskHandlerContextWithPrincipal(request, null, USER_ID); sut.execute(actionCtx); context.assertIsSatisfied(); assertEquals(1, actionCtx.getUserActionRequests().size()); GroupMembershipResponseNotificationsRequest notifRqst = (GroupMembershipResponseNotificationsRequest) (actionCtx .getUserActionRequests().get(0).getParams()); assertEquals(RequestType.REQUEST_GROUP_ACCESS_DENIED, notifRqst.getType()); assertEquals(USER_ID, notifRqst.getActorId()); assertEquals(GROUP_ID, notifRqst.getTargetEntityId()); assertEquals(PERSON_ID, notifRqst.getRequestorId()); }
@Override public Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext) { RequestForGroupMembershipRequest request = (RequestForGroupMembershipRequest) inActionContext .getActionContext().getParams(); mapper.execute(request); inActionContext.getUserActionRequests().add( new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null, new GroupMembershipResponseNotificationsRequest(RequestType.REQUEST_GROUP_ACCESS_DENIED, inActionContext.getActionContext().getPrincipal().getId(), request.getGroupId(), request.getPersonId()))); return null; }
DeleteRequestForGroupMembershipExecution implements TaskHandlerExecutionStrategy<PrincipalActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext) { RequestForGroupMembershipRequest request = (RequestForGroupMembershipRequest) inActionContext .getActionContext().getParams(); mapper.execute(request); inActionContext.getUserActionRequests().add( new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null, new GroupMembershipResponseNotificationsRequest(RequestType.REQUEST_GROUP_ACCESS_DENIED, inActionContext.getActionContext().getPrincipal().getId(), request.getGroupId(), request.getPersonId()))); return null; } }
DeleteRequestForGroupMembershipExecution implements TaskHandlerExecutionStrategy<PrincipalActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext) { RequestForGroupMembershipRequest request = (RequestForGroupMembershipRequest) inActionContext .getActionContext().getParams(); mapper.execute(request); inActionContext.getUserActionRequests().add( new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null, new GroupMembershipResponseNotificationsRequest(RequestType.REQUEST_GROUP_ACCESS_DENIED, inActionContext.getActionContext().getPrincipal().getId(), request.getGroupId(), request.getPersonId()))); return null; } DeleteRequestForGroupMembershipExecution(final DeleteRequestForGroupMembership inMapper); }
DeleteRequestForGroupMembershipExecution implements TaskHandlerExecutionStrategy<PrincipalActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext) { RequestForGroupMembershipRequest request = (RequestForGroupMembershipRequest) inActionContext .getActionContext().getParams(); mapper.execute(request); inActionContext.getUserActionRequests().add( new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null, new GroupMembershipResponseNotificationsRequest(RequestType.REQUEST_GROUP_ACCESS_DENIED, inActionContext.getActionContext().getPrincipal().getId(), request.getGroupId(), request.getPersonId()))); return null; } DeleteRequestForGroupMembershipExecution(final DeleteRequestForGroupMembership inMapper); @Override Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext); }
DeleteRequestForGroupMembershipExecution implements TaskHandlerExecutionStrategy<PrincipalActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext) { RequestForGroupMembershipRequest request = (RequestForGroupMembershipRequest) inActionContext .getActionContext().getParams(); mapper.execute(request); inActionContext.getUserActionRequests().add( new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null, new GroupMembershipResponseNotificationsRequest(RequestType.REQUEST_GROUP_ACCESS_DENIED, inActionContext.getActionContext().getPrincipal().getId(), request.getGroupId(), request.getPersonId()))); return null; } DeleteRequestForGroupMembershipExecution(final DeleteRequestForGroupMembership inMapper); @Override Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext);  }