private AuthorizationQuery setUpMockQuery(IList <Authorization> list) { AuthorizationQuery query = mock(typeof(AuthorizationQuery)); when(query.list()).thenReturn(list); when(query.count()).thenReturn((long)list.Count); when(processEngine.AuthorizationService.createAuthorizationQuery()).thenReturn(query); return(query); }
public virtual IList <AuthorizationDto> queryAuthorizations(AuthorizationQueryDto queryDto, int?firstResult, int?maxResults) { queryDto.ObjectMapper = ObjectMapper; AuthorizationQuery query = queryDto.toQuery(ProcessEngine); IList <Authorization> resultList; if (firstResult != null || maxResults != null) { resultList = executePaginatedQuery(query, firstResult, maxResults); } else { resultList = query.list(); } return(AuthorizationDto.fromAuthorizationList(resultList, processEngine.ProcessEngineConfiguration)); }