@Test public void testExecute() { final List<StreamFilter> filters = new ArrayList<StreamFilter>(); CONTEXT.checking(new Expectations() { { allowing(actionContext).getPrincipal(); will(returnValue(principal)); allowing(principal).getId(); will(returnValue(USER_ID)); oneOf(getUserStreamsMapper).execute(USER_ID); will(returnValue(filters)); } }); GetCurrentUserStreamFiltersResponse response = (GetCurrentUserStreamFiltersResponse) sut.execute(actionContext); Assert.assertEquals(filters, response.getStreamFilters()); CONTEXT.assertIsSatisfied(); }
public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException { final List<StreamFilter> streams = getUserStreamsMapper.execute(inActionContext.getPrincipal().getId()); return new GetCurrentUserStreamFiltersResponse(streams.size(), streams); }
GetCurrentUsersStreamsExecution implements ExecutionStrategy<PrincipalActionContext> { public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException { final List<StreamFilter> streams = getUserStreamsMapper.execute(inActionContext.getPrincipal().getId()); return new GetCurrentUserStreamFiltersResponse(streams.size(), streams); } }
GetCurrentUsersStreamsExecution implements ExecutionStrategy<PrincipalActionContext> { public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException { final List<StreamFilter> streams = getUserStreamsMapper.execute(inActionContext.getPrincipal().getId()); return new GetCurrentUserStreamFiltersResponse(streams.size(), streams); } GetCurrentUsersStreamsExecution(final DomainMapper<Long, List<StreamFilter>> inGetUserStreamsMapper); }
GetCurrentUsersStreamsExecution implements ExecutionStrategy<PrincipalActionContext> { public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException { final List<StreamFilter> streams = getUserStreamsMapper.execute(inActionContext.getPrincipal().getId()); return new GetCurrentUserStreamFiltersResponse(streams.size(), streams); } GetCurrentUsersStreamsExecution(final DomainMapper<Long, List<StreamFilter>> inGetUserStreamsMapper); Serializable execute(final PrincipalActionContext inActionContext); }
GetCurrentUsersStreamsExecution implements ExecutionStrategy<PrincipalActionContext> { public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException { final List<StreamFilter> streams = getUserStreamsMapper.execute(inActionContext.getPrincipal().getId()); return new GetCurrentUserStreamFiltersResponse(streams.size(), streams); } GetCurrentUsersStreamsExecution(final DomainMapper<Long, List<StreamFilter>> inGetUserStreamsMapper); Serializable execute(final PrincipalActionContext inActionContext);  }