@Test public final void testPerformAction() { final List<Person> people = new ArrayList<Person>(); context.checking(new Expectations() { { allowing(actionContext).getParams(); will(returnValue(params)); allowing(params).getQueryString(); will(returnValue(QUERY_STRING)); allowing(params).getMaxResults(); will(returnValue(MAX_RESULTS)); oneOf(lookupStrategy).getPeople(QUERY_STRING, MAX_RESULTS); will(returnValue(people)); } }); assertEquals(people, sut.execute(actionContext)); context.assertIsSatisfied(); }
@Override public Serializable execute(final ActionContext inActionContext) throws ExecutionException { PersonLookupRequest params = (PersonLookupRequest) inActionContext.getParams(); ArrayList<PersonModelView> people = new ArrayList<PersonModelView>(); for (Person person : lookupStrategy.getPeople(params.getQueryString(), params.getMaxResults())) { people.add(person.toPersonModelView()); } return people; }
PersonLookupExecution implements ExecutionStrategy<ActionContext> { @Override public Serializable execute(final ActionContext inActionContext) throws ExecutionException { PersonLookupRequest params = (PersonLookupRequest) inActionContext.getParams(); ArrayList<PersonModelView> people = new ArrayList<PersonModelView>(); for (Person person : lookupStrategy.getPeople(params.getQueryString(), params.getMaxResults())) { people.add(person.toPersonModelView()); } return people; } }
PersonLookupExecution implements ExecutionStrategy<ActionContext> { @Override public Serializable execute(final ActionContext inActionContext) throws ExecutionException { PersonLookupRequest params = (PersonLookupRequest) inActionContext.getParams(); ArrayList<PersonModelView> people = new ArrayList<PersonModelView>(); for (Person person : lookupStrategy.getPeople(params.getQueryString(), params.getMaxResults())) { people.add(person.toPersonModelView()); } return people; } PersonLookupExecution(final PersonLookupUtilityStrategy inLookupStrategy); }
PersonLookupExecution implements ExecutionStrategy<ActionContext> { @Override public Serializable execute(final ActionContext inActionContext) throws ExecutionException { PersonLookupRequest params = (PersonLookupRequest) inActionContext.getParams(); ArrayList<PersonModelView> people = new ArrayList<PersonModelView>(); for (Person person : lookupStrategy.getPeople(params.getQueryString(), params.getMaxResults())) { people.add(person.toPersonModelView()); } return people; } PersonLookupExecution(final PersonLookupUtilityStrategy inLookupStrategy); @Override Serializable execute(final ActionContext inActionContext); }
PersonLookupExecution implements ExecutionStrategy<ActionContext> { @Override public Serializable execute(final ActionContext inActionContext) throws ExecutionException { PersonLookupRequest params = (PersonLookupRequest) inActionContext.getParams(); ArrayList<PersonModelView> people = new ArrayList<PersonModelView>(); for (Person person : lookupStrategy.getPeople(params.getQueryString(), params.getMaxResults())) { people.add(person.toPersonModelView()); } return people; } PersonLookupExecution(final PersonLookupUtilityStrategy inLookupStrategy); @Override Serializable execute(final ActionContext inActionContext);  }