@Test public void testExecuteNoResults() { final int total = 20; final PagedSet<Long> idsSet = new PagedSet<Long>(START_INDEX, START_INDEX + 0, total, Collections.EMPTY_LIST); context.checking(new Expectations() { { oneOf(requestMapper).execute(with(equalInternally(request))); will(returnValue(idsSet)); } }); PagedSet<PersonModelView> results = (PagedSet<PersonModelView>) sut.execute(actionCtx); context.assertIsSatisfied(); assertEquals(START_INDEX, results.getFromIndex()); assertEquals(START_INDEX + 0, results.getToIndex()); assertEquals(total, results.getTotal()); assertTrue(results.getPagedSet().isEmpty()); }
@Override public Serializable execute(final ActionContext inActionContext) throws ExecutionException { GetRequestForGroupMembershipRequest request = (GetRequestForGroupMembershipRequest) inActionContext.getParams(); PagedSet<Long> idsPagedSet = requestMapper.execute(request); List<PersonModelView> list; if (idsPagedSet.getPagedSet().isEmpty()) { list = new ArrayList<PersonModelView>(); } else { list = peopleMapper.execute(idsPagedSet.getPagedSet()); } return new PagedSet<PersonModelView>(idsPagedSet.getFromIndex(), idsPagedSet.getToIndex(), idsPagedSet .getTotal(), list); }
GetRequestsForGroupMembershipByGroupExecution implements ExecutionStrategy<ActionContext> { @Override public Serializable execute(final ActionContext inActionContext) throws ExecutionException { GetRequestForGroupMembershipRequest request = (GetRequestForGroupMembershipRequest) inActionContext.getParams(); PagedSet<Long> idsPagedSet = requestMapper.execute(request); List<PersonModelView> list; if (idsPagedSet.getPagedSet().isEmpty()) { list = new ArrayList<PersonModelView>(); } else { list = peopleMapper.execute(idsPagedSet.getPagedSet()); } return new PagedSet<PersonModelView>(idsPagedSet.getFromIndex(), idsPagedSet.getToIndex(), idsPagedSet .getTotal(), list); } }
GetRequestsForGroupMembershipByGroupExecution implements ExecutionStrategy<ActionContext> { @Override public Serializable execute(final ActionContext inActionContext) throws ExecutionException { GetRequestForGroupMembershipRequest request = (GetRequestForGroupMembershipRequest) inActionContext.getParams(); PagedSet<Long> idsPagedSet = requestMapper.execute(request); List<PersonModelView> list; if (idsPagedSet.getPagedSet().isEmpty()) { list = new ArrayList<PersonModelView>(); } else { list = peopleMapper.execute(idsPagedSet.getPagedSet()); } return new PagedSet<PersonModelView>(idsPagedSet.getFromIndex(), idsPagedSet.getToIndex(), idsPagedSet .getTotal(), list); } GetRequestsForGroupMembershipByGroupExecution(final GetRequestsForGroupMembershipByGroup inRequestMapper,
            final DomainMapper<List<Long>, List<PersonModelView>> inPeopleMapper); }
GetRequestsForGroupMembershipByGroupExecution implements ExecutionStrategy<ActionContext> { @Override public Serializable execute(final ActionContext inActionContext) throws ExecutionException { GetRequestForGroupMembershipRequest request = (GetRequestForGroupMembershipRequest) inActionContext.getParams(); PagedSet<Long> idsPagedSet = requestMapper.execute(request); List<PersonModelView> list; if (idsPagedSet.getPagedSet().isEmpty()) { list = new ArrayList<PersonModelView>(); } else { list = peopleMapper.execute(idsPagedSet.getPagedSet()); } return new PagedSet<PersonModelView>(idsPagedSet.getFromIndex(), idsPagedSet.getToIndex(), idsPagedSet .getTotal(), list); } GetRequestsForGroupMembershipByGroupExecution(final GetRequestsForGroupMembershipByGroup inRequestMapper,
            final DomainMapper<List<Long>, List<PersonModelView>> inPeopleMapper); @Override Serializable execute(final ActionContext inActionContext); }
GetRequestsForGroupMembershipByGroupExecution implements ExecutionStrategy<ActionContext> { @Override public Serializable execute(final ActionContext inActionContext) throws ExecutionException { GetRequestForGroupMembershipRequest request = (GetRequestForGroupMembershipRequest) inActionContext.getParams(); PagedSet<Long> idsPagedSet = requestMapper.execute(request); List<PersonModelView> list; if (idsPagedSet.getPagedSet().isEmpty()) { list = new ArrayList<PersonModelView>(); } else { list = peopleMapper.execute(idsPagedSet.getPagedSet()); } return new PagedSet<PersonModelView>(idsPagedSet.getFromIndex(), idsPagedSet.getToIndex(), idsPagedSet .getTotal(), list); } GetRequestsForGroupMembershipByGroupExecution(final GetRequestsForGroupMembershipByGroup inRequestMapper,
            final DomainMapper<List<Long>, List<PersonModelView>> inPeopleMapper); @Override Serializable execute(final ActionContext inActionContext);  }