@Test public void testExecute() { DeleteGadgetDefinitionExecution sut = new DeleteGadgetDefinitionExecution(deleteGadgetDefinitionMapper, tabListMapper, ACTION); final Collection<CompressGadgetZoneRequest> tabs = new ArrayList<CompressGadgetZoneRequest>(); CompressGadgetZoneRequest rqst1 = new CompressGadgetZoneRequest(4L, 8, 5L); tabs.add(rqst1); CompressGadgetZoneRequest rqst2 = new CompressGadgetZoneRequest(6L, 9, 7L); tabs.add(rqst2); context.checking(new Expectations() { { allowing(tabListMapper).execute(9L); will(returnValue(tabs)); oneOf(deleteGadgetDefinitionMapper).execute(9L); } }); final TaskHandlerActionContext<ActionContext> wrapperContext = TestContextCreator .createTaskHandlerAsyncContext(9L); sut.execute(wrapperContext); context.assertIsSatisfied(); assertEquals(2, wrapperContext.getUserActionRequests().size()); UserActionRequest asyncRqst = wrapperContext.getUserActionRequests().get(0); assertEquals(ACTION, asyncRqst.getActionKey()); assertTrue(IsEqualInternally.areEqualInternally(rqst1, asyncRqst.getParams())); asyncRqst = wrapperContext.getUserActionRequests().get(1); assertEquals(ACTION, asyncRqst.getActionKey()); assertTrue(IsEqualInternally.areEqualInternally(rqst2, asyncRqst.getParams())); }
@Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { Long gadgetDefinitionId = (Long) inActionContext.getActionContext().getParams(); Collection<CompressGadgetZoneRequest> tabs = tabListMapper.execute(gadgetDefinitionId); for (CompressGadgetZoneRequest tab : tabs) { inActionContext.getUserActionRequests().add(new UserActionRequest(nextAction, null, tab)); } deleteGadgetDefinitionMapper.execute(gadgetDefinitionId); return null; }
DeleteGadgetDefinitionExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { Long gadgetDefinitionId = (Long) inActionContext.getActionContext().getParams(); Collection<CompressGadgetZoneRequest> tabs = tabListMapper.execute(gadgetDefinitionId); for (CompressGadgetZoneRequest tab : tabs) { inActionContext.getUserActionRequests().add(new UserActionRequest(nextAction, null, tab)); } deleteGadgetDefinitionMapper.execute(gadgetDefinitionId); return null; } }
DeleteGadgetDefinitionExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { Long gadgetDefinitionId = (Long) inActionContext.getActionContext().getParams(); Collection<CompressGadgetZoneRequest> tabs = tabListMapper.execute(gadgetDefinitionId); for (CompressGadgetZoneRequest tab : tabs) { inActionContext.getUserActionRequests().add(new UserActionRequest(nextAction, null, tab)); } deleteGadgetDefinitionMapper.execute(gadgetDefinitionId); return null; } DeleteGadgetDefinitionExecution(final DomainMapper<Long, Void> inDeleteGadgetDefinitionMapper,
            final DomainMapper<Long, Collection<CompressGadgetZoneRequest>> inTabListMapper, final String inNextAction); }
DeleteGadgetDefinitionExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { Long gadgetDefinitionId = (Long) inActionContext.getActionContext().getParams(); Collection<CompressGadgetZoneRequest> tabs = tabListMapper.execute(gadgetDefinitionId); for (CompressGadgetZoneRequest tab : tabs) { inActionContext.getUserActionRequests().add(new UserActionRequest(nextAction, null, tab)); } deleteGadgetDefinitionMapper.execute(gadgetDefinitionId); return null; } DeleteGadgetDefinitionExecution(final DomainMapper<Long, Void> inDeleteGadgetDefinitionMapper,
            final DomainMapper<Long, Collection<CompressGadgetZoneRequest>> inTabListMapper, final String inNextAction); @Override Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext); }
DeleteGadgetDefinitionExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { Long gadgetDefinitionId = (Long) inActionContext.getActionContext().getParams(); Collection<CompressGadgetZoneRequest> tabs = tabListMapper.execute(gadgetDefinitionId); for (CompressGadgetZoneRequest tab : tabs) { inActionContext.getUserActionRequests().add(new UserActionRequest(nextAction, null, tab)); } deleteGadgetDefinitionMapper.execute(gadgetDefinitionId); return null; } DeleteGadgetDefinitionExecution(final DomainMapper<Long, Void> inDeleteGadgetDefinitionMapper,
            final DomainMapper<Long, Collection<CompressGadgetZoneRequest>> inTabListMapper, final String inNextAction); @Override Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext);  }