* can throw an exception on bad UUID.
*/
@Test
public final void testExecuteWithUUID() throws Exception
{
final Theme testTheme = new Theme("http://localhost:8080/themes/myTheme.xml", "My Theme",
"My Theme Description", "http://localhost:8080/themes/myTheme.css", "FAKE-UUID-0000-0000-0000",
"My Theme Banner Id", "authorName", "authorEmail");
final String uuid = "FAKE-UUID-0000-0000-0000";
context.checking(new Expectations()
{
{
oneOf(personMapper).findById(userId);
will(returnValue(person));
oneOf(themeMapper).findByUUID(uuid);
will(returnValue(testTheme));
oneOf(person).setTheme(testTheme);
allowing(person).getTheme();
// persist
oneOf(personMapper).flush();
never(themeMapper).findByUrl((with(any(String.class))));
oneOf(deleteCacheKeysMapper).execute(with(any(Set.class)));
}
});
// Make the call
String actual = (String) sut.execute(buildServerActionContext("{" + uuid + "}"));
assertEquals(testTheme.getCssFile(), actual);
context.assertIsSatisfied();
}