@Test public void testExecuteNoState() { context.checking(new Expectations() { { allowing(personIdMapper).execute(RECIPIENT_ACCOUNT_ID); will(returnValue(RECIPIENT_ID)); } }); runTest(Collections.EMPTY_MAP); }
@Override public Serializable execute(final TaskHandlerActionContext<ClientPrincipalActionContext> inWrapperContext) { final ClientPrincipalActionContext actionContext = inWrapperContext.getActionContext(); String clientId = actionContext.getClientUniqueId(); SendPrebuiltNotificationRequest params = (SendPrebuiltNotificationRequest) actionContext.getParams(); PersonModelView recipient = (PersonModelView) actionContext.getState().get("recipient"); long recipientId = recipient != null ? recipient.getId() : personIdMapper.execute(params .getRecipientAccountId()); PrebuiltNotificationsRequest notifRequest = new PrebuiltNotificationsRequest(RequestType.EXTERNAL_PRE_BUILT, params.isHighPriority(), clientId, recipientId, params.getMessage(), params.getUrl()); inWrapperContext.getUserActionRequests().add( new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null, notifRequest)); return null; }
SendPrebuiltNotificationExecution implements TaskHandlerExecutionStrategy<ClientPrincipalActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ClientPrincipalActionContext> inWrapperContext) { final ClientPrincipalActionContext actionContext = inWrapperContext.getActionContext(); String clientId = actionContext.getClientUniqueId(); SendPrebuiltNotificationRequest params = (SendPrebuiltNotificationRequest) actionContext.getParams(); PersonModelView recipient = (PersonModelView) actionContext.getState().get("recipient"); long recipientId = recipient != null ? recipient.getId() : personIdMapper.execute(params .getRecipientAccountId()); PrebuiltNotificationsRequest notifRequest = new PrebuiltNotificationsRequest(RequestType.EXTERNAL_PRE_BUILT, params.isHighPriority(), clientId, recipientId, params.getMessage(), params.getUrl()); inWrapperContext.getUserActionRequests().add( new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null, notifRequest)); return null; } }
SendPrebuiltNotificationExecution implements TaskHandlerExecutionStrategy<ClientPrincipalActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ClientPrincipalActionContext> inWrapperContext) { final ClientPrincipalActionContext actionContext = inWrapperContext.getActionContext(); String clientId = actionContext.getClientUniqueId(); SendPrebuiltNotificationRequest params = (SendPrebuiltNotificationRequest) actionContext.getParams(); PersonModelView recipient = (PersonModelView) actionContext.getState().get("recipient"); long recipientId = recipient != null ? recipient.getId() : personIdMapper.execute(params .getRecipientAccountId()); PrebuiltNotificationsRequest notifRequest = new PrebuiltNotificationsRequest(RequestType.EXTERNAL_PRE_BUILT, params.isHighPriority(), clientId, recipientId, params.getMessage(), params.getUrl()); inWrapperContext.getUserActionRequests().add( new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null, notifRequest)); return null; } SendPrebuiltNotificationExecution(final DomainMapper<String, Long> inPersonIdMapper); }
SendPrebuiltNotificationExecution implements TaskHandlerExecutionStrategy<ClientPrincipalActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ClientPrincipalActionContext> inWrapperContext) { final ClientPrincipalActionContext actionContext = inWrapperContext.getActionContext(); String clientId = actionContext.getClientUniqueId(); SendPrebuiltNotificationRequest params = (SendPrebuiltNotificationRequest) actionContext.getParams(); PersonModelView recipient = (PersonModelView) actionContext.getState().get("recipient"); long recipientId = recipient != null ? recipient.getId() : personIdMapper.execute(params .getRecipientAccountId()); PrebuiltNotificationsRequest notifRequest = new PrebuiltNotificationsRequest(RequestType.EXTERNAL_PRE_BUILT, params.isHighPriority(), clientId, recipientId, params.getMessage(), params.getUrl()); inWrapperContext.getUserActionRequests().add( new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null, notifRequest)); return null; } SendPrebuiltNotificationExecution(final DomainMapper<String, Long> inPersonIdMapper); @Override Serializable execute(final TaskHandlerActionContext<ClientPrincipalActionContext> inWrapperContext); }
SendPrebuiltNotificationExecution implements TaskHandlerExecutionStrategy<ClientPrincipalActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ClientPrincipalActionContext> inWrapperContext) { final ClientPrincipalActionContext actionContext = inWrapperContext.getActionContext(); String clientId = actionContext.getClientUniqueId(); SendPrebuiltNotificationRequest params = (SendPrebuiltNotificationRequest) actionContext.getParams(); PersonModelView recipient = (PersonModelView) actionContext.getState().get("recipient"); long recipientId = recipient != null ? recipient.getId() : personIdMapper.execute(params .getRecipientAccountId()); PrebuiltNotificationsRequest notifRequest = new PrebuiltNotificationsRequest(RequestType.EXTERNAL_PRE_BUILT, params.isHighPriority(), clientId, recipientId, params.getMessage(), params.getUrl()); inWrapperContext.getUserActionRequests().add( new UserActionRequest(CreateNotificationsRequest.ACTION_NAME, null, notifRequest)); return null; } SendPrebuiltNotificationExecution(final DomainMapper<String, Long> inPersonIdMapper); @Override Serializable execute(final TaskHandlerActionContext<ClientPrincipalActionContext> inWrapperContext);  }