@Test(expected = ExecutionException.class) public final void testExecuteFail() throws Exception { context.checking(new Expectations() { { allowing(actionContext).getParams(); will(returnValue(tabId)); allowing(actionContext).getPrincipal(); will(returnValue(principal)); allowing(principal).getId(); will(returnValue(1L)); allowing(deleteCacheKeysMapper).execute(with(any(Set.class))); oneOf(tabGroupMapper).undeleteTab(with(tabId.longValue())); will(throwException(new TabUndeletionException("string", tabId))); } }); sut.execute(actionContext); context.assertIsSatisfied(); }
@Override public Tab execute(final PrincipalActionContext inActionContext) { try { Long tabId = (Long) inActionContext.getParams(); logger.debug("Undelete tabId = " + tabId); deleteKeysMapper.execute(Collections.singleton(CacheKeys.PERSON_PAGE_PROPERTIES_BY_ID + inActionContext.getPrincipal().getId())); return tabGroupMapper.undeleteTab(tabId); } catch (TabUndeletionException tue) { throw new ExecutionException(tue); } }
UndeleteTabExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public Tab execute(final PrincipalActionContext inActionContext) { try { Long tabId = (Long) inActionContext.getParams(); logger.debug("Undelete tabId = " + tabId); deleteKeysMapper.execute(Collections.singleton(CacheKeys.PERSON_PAGE_PROPERTIES_BY_ID + inActionContext.getPrincipal().getId())); return tabGroupMapper.undeleteTab(tabId); } catch (TabUndeletionException tue) { throw new ExecutionException(tue); } } }
UndeleteTabExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public Tab execute(final PrincipalActionContext inActionContext) { try { Long tabId = (Long) inActionContext.getParams(); logger.debug("Undelete tabId = " + tabId); deleteKeysMapper.execute(Collections.singleton(CacheKeys.PERSON_PAGE_PROPERTIES_BY_ID + inActionContext.getPrincipal().getId())); return tabGroupMapper.undeleteTab(tabId); } catch (TabUndeletionException tue) { throw new ExecutionException(tue); } } UndeleteTabExecution(final TabGroupMapper inTabGroupMapper,
            final DomainMapper<Set<String>, Boolean> inDeleteKeysMapper); }
UndeleteTabExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public Tab execute(final PrincipalActionContext inActionContext) { try { Long tabId = (Long) inActionContext.getParams(); logger.debug("Undelete tabId = " + tabId); deleteKeysMapper.execute(Collections.singleton(CacheKeys.PERSON_PAGE_PROPERTIES_BY_ID + inActionContext.getPrincipal().getId())); return tabGroupMapper.undeleteTab(tabId); } catch (TabUndeletionException tue) { throw new ExecutionException(tue); } } UndeleteTabExecution(final TabGroupMapper inTabGroupMapper,
            final DomainMapper<Set<String>, Boolean> inDeleteKeysMapper); @Override Tab execute(final PrincipalActionContext inActionContext); }
UndeleteTabExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public Tab execute(final PrincipalActionContext inActionContext) { try { Long tabId = (Long) inActionContext.getParams(); logger.debug("Undelete tabId = " + tabId); deleteKeysMapper.execute(Collections.singleton(CacheKeys.PERSON_PAGE_PROPERTIES_BY_ID + inActionContext.getPrincipal().getId())); return tabGroupMapper.undeleteTab(tabId); } catch (TabUndeletionException tue) { throw new ExecutionException(tue); } } UndeleteTabExecution(final TabGroupMapper inTabGroupMapper,
            final DomainMapper<Set<String>, Boolean> inDeleteKeysMapper); @Override Tab execute(final PrincipalActionContext inActionContext);  }