@Test public void execute() throws Exception { final List<Feed> feeds = new LinkedList<Feed>(); feeds.add(new Feed()); final List<ActionRequest> requests = new LinkedList<ActionRequest>(); context.checking(new Expectations() { { oneOf(getFeedsMapper).execute(with(any(CurrentDateInMinutesRequest.class))); will(returnValue(feeds)); oneOf(setFeedsAsPendingMapper).execute(with(any(CurrentDateInMinutesRequest.class))); oneOf(actionContext).getUserActionRequests(); will(returnValue(requests)); } }); sut.execute(actionContext); context.assertIsSatisfied(); }
@Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { CurrentDateInMinutesRequest request = new CurrentDateInMinutesRequest(new Date().getTime() / (MILLISECONDSINMINUTE)); List<Feed> feeds = getFeedsMapper.execute(request); List<Long> feedIds = new ArrayList<Long>(); for (Feed feed : feeds) { feedIds.add(feed.getId()); } setFeedsAsPendingMapper.execute(request); for (Long id : feedIds) { inActionContext.getUserActionRequests().add( new UserActionRequest("refreshFeedAction", null, new RefreshFeedRequest(id))); } return null; }
RefreshFeedsExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { CurrentDateInMinutesRequest request = new CurrentDateInMinutesRequest(new Date().getTime() / (MILLISECONDSINMINUTE)); List<Feed> feeds = getFeedsMapper.execute(request); List<Long> feedIds = new ArrayList<Long>(); for (Feed feed : feeds) { feedIds.add(feed.getId()); } setFeedsAsPendingMapper.execute(request); for (Long id : feedIds) { inActionContext.getUserActionRequests().add( new UserActionRequest("refreshFeedAction", null, new RefreshFeedRequest(id))); } return null; } }
RefreshFeedsExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { CurrentDateInMinutesRequest request = new CurrentDateInMinutesRequest(new Date().getTime() / (MILLISECONDSINMINUTE)); List<Feed> feeds = getFeedsMapper.execute(request); List<Long> feedIds = new ArrayList<Long>(); for (Feed feed : feeds) { feedIds.add(feed.getId()); } setFeedsAsPendingMapper.execute(request); for (Long id : feedIds) { inActionContext.getUserActionRequests().add( new UserActionRequest("refreshFeedAction", null, new RefreshFeedRequest(id))); } return null; } RefreshFeedsExecution();  RefreshFeedsExecution(final GetRefreshableFeedsMapper inGetFeedsMapper,
            final SetRefreshableFeedsAsPending inSetFeedsAsPendingMapper); }
RefreshFeedsExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { CurrentDateInMinutesRequest request = new CurrentDateInMinutesRequest(new Date().getTime() / (MILLISECONDSINMINUTE)); List<Feed> feeds = getFeedsMapper.execute(request); List<Long> feedIds = new ArrayList<Long>(); for (Feed feed : feeds) { feedIds.add(feed.getId()); } setFeedsAsPendingMapper.execute(request); for (Long id : feedIds) { inActionContext.getUserActionRequests().add( new UserActionRequest("refreshFeedAction", null, new RefreshFeedRequest(id))); } return null; } RefreshFeedsExecution();  RefreshFeedsExecution(final GetRefreshableFeedsMapper inGetFeedsMapper,
            final SetRefreshableFeedsAsPending inSetFeedsAsPendingMapper); @Override Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext); }
RefreshFeedsExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { CurrentDateInMinutesRequest request = new CurrentDateInMinutesRequest(new Date().getTime() / (MILLISECONDSINMINUTE)); List<Feed> feeds = getFeedsMapper.execute(request); List<Long> feedIds = new ArrayList<Long>(); for (Feed feed : feeds) { feedIds.add(feed.getId()); } setFeedsAsPendingMapper.execute(request); for (Long id : feedIds) { inActionContext.getUserActionRequests().add( new UserActionRequest("refreshFeedAction", null, new RefreshFeedRequest(id))); } return null; } RefreshFeedsExecution();  RefreshFeedsExecution(final GetRefreshableFeedsMapper inGetFeedsMapper,
            final SetRefreshableFeedsAsPending inSetFeedsAsPendingMapper); @Override Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext);  }