@Test public void performActionWithSuccess() throws Exception { context.checking(new Expectations() { { allowing(actionContext).getParams(); will(returnValue(GALLERY_ITEM_ID)); oneOf(galleryItemMapperMock).findById(GALLERY_ITEM_ID); will(returnValue(galleryItem)); oneOf(galleryItemMapperMock).delete(galleryItem); } }); sut.execute(actionContext); context.assertIsSatisfied(); }
@Override public Boolean execute(final ActionContext inActionContext) { Long galleryItemId = (Long) inActionContext.getParams(); T galleryItem = galleryItemMapper.findById(galleryItemId); galleryItemMapper.delete(galleryItem); return true; }
DeleteGalleryItemExecution implements ExecutionStrategy<ActionContext> { @Override public Boolean execute(final ActionContext inActionContext) { Long galleryItemId = (Long) inActionContext.getParams(); T galleryItem = galleryItemMapper.findById(galleryItemId); galleryItemMapper.delete(galleryItem); return true; } }
DeleteGalleryItemExecution implements ExecutionStrategy<ActionContext> { @Override public Boolean execute(final ActionContext inActionContext) { Long galleryItemId = (Long) inActionContext.getParams(); T galleryItem = galleryItemMapper.findById(galleryItemId); galleryItemMapper.delete(galleryItem); return true; } DeleteGalleryItemExecution(final GalleryItemMapper<T> inGalleryItemMapper); }
DeleteGalleryItemExecution implements ExecutionStrategy<ActionContext> { @Override public Boolean execute(final ActionContext inActionContext) { Long galleryItemId = (Long) inActionContext.getParams(); T galleryItem = galleryItemMapper.findById(galleryItemId); galleryItemMapper.delete(galleryItem); return true; } DeleteGalleryItemExecution(final GalleryItemMapper<T> inGalleryItemMapper); @Override Boolean execute(final ActionContext inActionContext); }
DeleteGalleryItemExecution implements ExecutionStrategy<ActionContext> { @Override public Boolean execute(final ActionContext inActionContext) { Long galleryItemId = (Long) inActionContext.getParams(); T galleryItem = galleryItemMapper.findById(galleryItemId); galleryItemMapper.delete(galleryItem); return true; } DeleteGalleryItemExecution(final GalleryItemMapper<T> inGalleryItemMapper); @Override Boolean execute(final ActionContext inActionContext);  }