@Test public final void testExecuteWithUrl() throws Exception { final String name = "Foo Bar"; final String email = "foo.bar@blah.com"; final String themeName = "Las Vegas"; final String themeDesc = "Las Vegas sky line"; final String themeUrl = "src/main/webapp/themes/vegas.xml"; final Theme theme = new Theme(themeUrl, themeName, themeDesc, null, null, null, name, email); final HashMap<String, Serializable> formData = new HashMap<String, Serializable>(); formData.put("id", "1"); context.checking(new Expectations() { { oneOf(themeMapper).findById(1L); will(returnValue(theme)); } }); Theme actual = sut.provide(actionContext, formData); context.assertIsSatisfied(); assertSame(theme, actual); assertEquals("property should be gotten", themeName, theme.getName()); assertEquals("property should be gotten", themeDesc, theme.getDescription()); assertEquals("property should be gotten", name, theme.getAuthorName()); assertEquals("property should be gotten", email, theme.getAuthorEmail()); assertEquals("property should be gotten", themeUrl, theme.getUrl()); }
public T provide(final PrincipalActionContext inContext, final Map<String, Serializable> inParams) { Long galleryItemId = Long.valueOf((String) inParams.get(ID_KEY)); log.debug("Finding gallery item with id: " + galleryItemId); T outGalleryItem = galleryItemMapper.findById(galleryItemId); return outGalleryItem; }
GalleryItemFinder implements GalleryItemProvider<T> { public T provide(final PrincipalActionContext inContext, final Map<String, Serializable> inParams) { Long galleryItemId = Long.valueOf((String) inParams.get(ID_KEY)); log.debug("Finding gallery item with id: " + galleryItemId); T outGalleryItem = galleryItemMapper.findById(galleryItemId); return outGalleryItem; } }
GalleryItemFinder implements GalleryItemProvider<T> { public T provide(final PrincipalActionContext inContext, final Map<String, Serializable> inParams) { Long galleryItemId = Long.valueOf((String) inParams.get(ID_KEY)); log.debug("Finding gallery item with id: " + galleryItemId); T outGalleryItem = galleryItemMapper.findById(galleryItemId); return outGalleryItem; } GalleryItemFinder(final GalleryItemMapper<T> inGalleryItemMapper); }
GalleryItemFinder implements GalleryItemProvider<T> { public T provide(final PrincipalActionContext inContext, final Map<String, Serializable> inParams) { Long galleryItemId = Long.valueOf((String) inParams.get(ID_KEY)); log.debug("Finding gallery item with id: " + galleryItemId); T outGalleryItem = galleryItemMapper.findById(galleryItemId); return outGalleryItem; } GalleryItemFinder(final GalleryItemMapper<T> inGalleryItemMapper); T provide(final PrincipalActionContext inContext, final Map<String, Serializable> inParams); }
GalleryItemFinder implements GalleryItemProvider<T> { public T provide(final PrincipalActionContext inContext, final Map<String, Serializable> inParams) { Long galleryItemId = Long.valueOf((String) inParams.get(ID_KEY)); log.debug("Finding gallery item with id: " + galleryItemId); T outGalleryItem = galleryItemMapper.findById(galleryItemId); return outGalleryItem; } GalleryItemFinder(final GalleryItemMapper<T> inGalleryItemMapper); T provide(final PrincipalActionContext inContext, final Map<String, Serializable> inParams);  }