@Test public void testExecute() { HideGalleryItemThenQueueTaskExecution sut = new HideGalleryItemThenQueueTaskExecution(mapper, ACTION); context.checking(new Expectations() { { allowing(mapper).findById(9L); will(returnValue(galleryItem)); oneOf(galleryItem).setShowInGallery(false); } }); TaskHandlerActionContext<ActionContext> wrapperContext = TestContextCreator.createTaskHandlerAsyncContext(9L); sut.execute(wrapperContext); context.assertIsSatisfied(); assertEquals(1, wrapperContext.getUserActionRequests().size()); UserActionRequest asyncRqst = wrapperContext.getUserActionRequests().get(0); assertEquals(9L, asyncRqst.getParams()); assertEquals(ACTION, asyncRqst.getActionKey()); }
@Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { Long galleryItemId = (Long) inActionContext.getActionContext().getParams(); GalleryItem galleryItem = galleryItemMapper.findById(galleryItemId); galleryItem.setShowInGallery(false); inActionContext.getUserActionRequests().add(new UserActionRequest(nextAction, null, galleryItemId)); return null; }
HideGalleryItemThenQueueTaskExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { Long galleryItemId = (Long) inActionContext.getActionContext().getParams(); GalleryItem galleryItem = galleryItemMapper.findById(galleryItemId); galleryItem.setShowInGallery(false); inActionContext.getUserActionRequests().add(new UserActionRequest(nextAction, null, galleryItemId)); return null; } }
HideGalleryItemThenQueueTaskExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { Long galleryItemId = (Long) inActionContext.getActionContext().getParams(); GalleryItem galleryItem = galleryItemMapper.findById(galleryItemId); galleryItem.setShowInGallery(false); inActionContext.getUserActionRequests().add(new UserActionRequest(nextAction, null, galleryItemId)); return null; } HideGalleryItemThenQueueTaskExecution(final GalleryItemMapper<GalleryItem> inGalleryItemMapper,
            final String inNextAction); }
HideGalleryItemThenQueueTaskExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { Long galleryItemId = (Long) inActionContext.getActionContext().getParams(); GalleryItem galleryItem = galleryItemMapper.findById(galleryItemId); galleryItem.setShowInGallery(false); inActionContext.getUserActionRequests().add(new UserActionRequest(nextAction, null, galleryItemId)); return null; } HideGalleryItemThenQueueTaskExecution(final GalleryItemMapper<GalleryItem> inGalleryItemMapper,
            final String inNextAction); @Override Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext); }
HideGalleryItemThenQueueTaskExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { Long galleryItemId = (Long) inActionContext.getActionContext().getParams(); GalleryItem galleryItem = galleryItemMapper.findById(galleryItemId); galleryItem.setShowInGallery(false); inActionContext.getUserActionRequests().add(new UserActionRequest(nextAction, null, galleryItemId)); return null; } HideGalleryItemThenQueueTaskExecution(final GalleryItemMapper<GalleryItem> inGalleryItemMapper,
            final String inNextAction); @Override Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext);  }