@Test public void test() { QueueKeyBasedTasksExecution sut = new QueueKeyBasedTasksExecution(new ArrayList<String>(Arrays .asList("actionkey")), objectKeyMapper); final List<UserActionRequest> list = new ArrayList<UserActionRequest>(); context.checking(new Expectations() { { allowing(objectKeyMapper).execute(null); will(returnValue(objectKeyResults)); allowing(actionContext).getUserActionRequests(); will(returnValue(list)); } }); sut.execute(actionContext); assertEquals(1, list.size()); assertEquals(5L, (list.get(0)).getParams()); assertEquals("actionkey", (list.get(0)).getActionKey()); context.assertIsSatisfied(); }
@Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { List<Serializable> objectKeys = objectKeyMapper.execute(null); List<UserActionRequest> tasks = inActionContext.getUserActionRequests(); for (Serializable objectKey : objectKeys) { for (String actionKey : actionKeys) { tasks.add(new UserActionRequest(actionKey, null, objectKey)); } } return null; }
QueueKeyBasedTasksExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { List<Serializable> objectKeys = objectKeyMapper.execute(null); List<UserActionRequest> tasks = inActionContext.getUserActionRequests(); for (Serializable objectKey : objectKeys) { for (String actionKey : actionKeys) { tasks.add(new UserActionRequest(actionKey, null, objectKey)); } } return null; } }
QueueKeyBasedTasksExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { List<Serializable> objectKeys = objectKeyMapper.execute(null); List<UserActionRequest> tasks = inActionContext.getUserActionRequests(); for (Serializable objectKey : objectKeys) { for (String actionKey : actionKeys) { tasks.add(new UserActionRequest(actionKey, null, objectKey)); } } return null; } QueueKeyBasedTasksExecution(final List<String> inActionKeys,
            final DomainMapper<Serializable, List<Serializable>> inOjectKeyMapper); }
QueueKeyBasedTasksExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { List<Serializable> objectKeys = objectKeyMapper.execute(null); List<UserActionRequest> tasks = inActionContext.getUserActionRequests(); for (Serializable objectKey : objectKeys) { for (String actionKey : actionKeys) { tasks.add(new UserActionRequest(actionKey, null, objectKey)); } } return null; } QueueKeyBasedTasksExecution(final List<String> inActionKeys,
            final DomainMapper<Serializable, List<Serializable>> inOjectKeyMapper); @Override Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext); }
QueueKeyBasedTasksExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { List<Serializable> objectKeys = objectKeyMapper.execute(null); List<UserActionRequest> tasks = inActionContext.getUserActionRequests(); for (Serializable objectKey : objectKeys) { for (String actionKey : actionKeys) { tasks.add(new UserActionRequest(actionKey, null, objectKey)); } } return null; } QueueKeyBasedTasksExecution(final List<String> inActionKeys,
            final DomainMapper<Serializable, List<Serializable>> inOjectKeyMapper); @Override Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext);  }