@SuppressWarnings("unchecked") @Test public final void testExecute() throws Exception { String message = "mapper should return correct list of gadget definitions"; final ArrayList<GalleryItemCategory> list = new ArrayList<GalleryItemCategory>(); for (int i = 0; i < 8; i++) { GalleryItemCategory gadgetCategory = new GalleryItemCategory("somecategory"); list.add(gadgetCategory); } context.checking(new Expectations() { { oneOf(mapper).findGalleryItemCategories(GalleryItemType.GADGET); will(returnValue(list)); } }); ServiceActionContext currentContext = new ServiceActionContext(null, principalMock); LinkedList results = (LinkedList) sut.execute(currentContext); for (Object obj : results) { assertEquals(message, "somecategory", obj.toString()); } assertEquals(list.size(), results.size()); context.assertIsSatisfied(); }
@Override public Serializable execute(final ServiceActionContext inActionContext) throws ExecutionException { List<GalleryItemCategory> galleryItemCategories = galleryItemMapper.findGalleryItemCategories(galleryItemType); LinkedList outList = new LinkedList(); for (GalleryItemCategory galleryItemCategory : galleryItemCategories) { outList.add(galleryItemCategory.getName()); } if (log.isDebugEnabled()) { log.debug("Retrieved " + galleryItemCategories.size() + " galleryItem Categories"); } return outList; }
GetGalleryItemCategoriesExecution implements ExecutionStrategy<ServiceActionContext> { @Override public Serializable execute(final ServiceActionContext inActionContext) throws ExecutionException { List<GalleryItemCategory> galleryItemCategories = galleryItemMapper.findGalleryItemCategories(galleryItemType); LinkedList outList = new LinkedList(); for (GalleryItemCategory galleryItemCategory : galleryItemCategories) { outList.add(galleryItemCategory.getName()); } if (log.isDebugEnabled()) { log.debug("Retrieved " + galleryItemCategories.size() + " galleryItem Categories"); } return outList; } }
GetGalleryItemCategoriesExecution implements ExecutionStrategy<ServiceActionContext> { @Override public Serializable execute(final ServiceActionContext inActionContext) throws ExecutionException { List<GalleryItemCategory> galleryItemCategories = galleryItemMapper.findGalleryItemCategories(galleryItemType); LinkedList outList = new LinkedList(); for (GalleryItemCategory galleryItemCategory : galleryItemCategories) { outList.add(galleryItemCategory.getName()); } if (log.isDebugEnabled()) { log.debug("Retrieved " + galleryItemCategories.size() + " galleryItem Categories"); } return outList; } GetGalleryItemCategoriesExecution(final GalleryItemCategoryMapper inGalleryItemMapper,
            final GalleryItemType inGalleryItemType); }
GetGalleryItemCategoriesExecution implements ExecutionStrategy<ServiceActionContext> { @Override public Serializable execute(final ServiceActionContext inActionContext) throws ExecutionException { List<GalleryItemCategory> galleryItemCategories = galleryItemMapper.findGalleryItemCategories(galleryItemType); LinkedList outList = new LinkedList(); for (GalleryItemCategory galleryItemCategory : galleryItemCategories) { outList.add(galleryItemCategory.getName()); } if (log.isDebugEnabled()) { log.debug("Retrieved " + galleryItemCategories.size() + " galleryItem Categories"); } return outList; } GetGalleryItemCategoriesExecution(final GalleryItemCategoryMapper inGalleryItemMapper,
            final GalleryItemType inGalleryItemType); @Override Serializable execute(final ServiceActionContext inActionContext); }
GetGalleryItemCategoriesExecution implements ExecutionStrategy<ServiceActionContext> { @Override public Serializable execute(final ServiceActionContext inActionContext) throws ExecutionException { List<GalleryItemCategory> galleryItemCategories = galleryItemMapper.findGalleryItemCategories(galleryItemType); LinkedList outList = new LinkedList(); for (GalleryItemCategory galleryItemCategory : galleryItemCategories) { outList.add(galleryItemCategory.getName()); } if (log.isDebugEnabled()) { log.debug("Retrieved " + galleryItemCategories.size() + " galleryItem Categories"); } return outList; } GetGalleryItemCategoriesExecution(final GalleryItemCategoryMapper inGalleryItemMapper,
            final GalleryItemType inGalleryItemType); @Override Serializable execute(final ServiceActionContext inActionContext);  }