@Test public final void execute() { final List<List<Long>> returned = new ArrayList<List<Long>>(); final List<Long> innerList = new ArrayList<Long>(); returned.add(innerList); final List<PersonModelView> peopleList = new ArrayList<PersonModelView>(); sut = new GetPeopleWhoLikedItemExecution(mapper, peopleMapper); context.checking(new Expectations() { { oneOf(actionContext).getParams(); will(returnValue(1L)); oneOf(mapper).execute(with(any(List.class))); will(returnValue(returned)); oneOf(peopleMapper).execute(innerList); will(returnValue(peopleList)); } }); sut.execute(actionContext); }
@Override public ArrayList<PersonModelView> execute(final PrincipalActionContext inActionContext) throws ExecutionException { List<Long> itemIdList = (List) Collections.singletonList(inActionContext.getParams()); List<Long> peopleIdsInterested = mapper.execute(itemIdList).get(0); List<PersonModelView> people = peopleMapper.execute(peopleIdsInterested); return new ArrayList<PersonModelView>(people); }
GetPeopleWhoLikedItemExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public ArrayList<PersonModelView> execute(final PrincipalActionContext inActionContext) throws ExecutionException { List<Long> itemIdList = (List) Collections.singletonList(inActionContext.getParams()); List<Long> peopleIdsInterested = mapper.execute(itemIdList).get(0); List<PersonModelView> people = peopleMapper.execute(peopleIdsInterested); return new ArrayList<PersonModelView>(people); } }
GetPeopleWhoLikedItemExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public ArrayList<PersonModelView> execute(final PrincipalActionContext inActionContext) throws ExecutionException { List<Long> itemIdList = (List) Collections.singletonList(inActionContext.getParams()); List<Long> peopleIdsInterested = mapper.execute(itemIdList).get(0); List<PersonModelView> people = peopleMapper.execute(peopleIdsInterested); return new ArrayList<PersonModelView>(people); } GetPeopleWhoLikedItemExecution(
            final DecoratedPartialResponseDomainMapper<List<Long>, List<List<Long>>> inMapper,
            final DomainMapper<List<Long>, List<PersonModelView>> inPeopleMapper); }
GetPeopleWhoLikedItemExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public ArrayList<PersonModelView> execute(final PrincipalActionContext inActionContext) throws ExecutionException { List<Long> itemIdList = (List) Collections.singletonList(inActionContext.getParams()); List<Long> peopleIdsInterested = mapper.execute(itemIdList).get(0); List<PersonModelView> people = peopleMapper.execute(peopleIdsInterested); return new ArrayList<PersonModelView>(people); } GetPeopleWhoLikedItemExecution(
            final DecoratedPartialResponseDomainMapper<List<Long>, List<List<Long>>> inMapper,
            final DomainMapper<List<Long>, List<PersonModelView>> inPeopleMapper); @Override ArrayList<PersonModelView> execute(final PrincipalActionContext inActionContext); }
GetPeopleWhoLikedItemExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public ArrayList<PersonModelView> execute(final PrincipalActionContext inActionContext) throws ExecutionException { List<Long> itemIdList = (List) Collections.singletonList(inActionContext.getParams()); List<Long> peopleIdsInterested = mapper.execute(itemIdList).get(0); List<PersonModelView> people = peopleMapper.execute(peopleIdsInterested); return new ArrayList<PersonModelView>(people); } GetPeopleWhoLikedItemExecution(
            final DecoratedPartialResponseDomainMapper<List<Long>, List<List<Long>>> inMapper,
            final DomainMapper<List<Long>, List<PersonModelView>> inPeopleMapper); @Override ArrayList<PersonModelView> execute(final PrincipalActionContext inActionContext);  }