예제 #1
0
        private HistoricIdentityLinkLogQuery setUpMockHistoricIdentityLinkQuery(IList <HistoricIdentityLinkLog> mockedHistoricIdentityLinks)
        {
            HistoricIdentityLinkLogQuery mockedHistoricIdentityLinkQuery = mock(typeof(HistoricIdentityLinkLogQuery));

            when(mockedHistoricIdentityLinkQuery.list()).thenReturn(mockedHistoricIdentityLinks);
            when(mockedHistoricIdentityLinkQuery.count()).thenReturn((long)mockedHistoricIdentityLinks.Count);

            when(processEngine.HistoryService.createHistoricIdentityLinkLogQuery()).thenReturn(mockedHistoricIdentityLinkQuery);

            return(mockedHistoricIdentityLinkQuery);
        }
예제 #2
0
        public virtual IList <HistoricIdentityLinkLogDto> getHistoricIdentityLinks(UriInfo uriInfo, int?firstResult, int?maxResults)
        {
            HistoricIdentityLinkLogQueryDto queryDto = new HistoricIdentityLinkLogQueryDto(objectMapper, uriInfo.QueryParameters);
            HistoricIdentityLinkLogQuery    query    = queryDto.toQuery(processEngine);

            IList <HistoricIdentityLinkLog> queryResult;

            if (firstResult != null || maxResults != null)
            {
                queryResult = executePaginatedQuery(query, firstResult, maxResults);
            }
            else
            {
                queryResult = query.list();
            }
            IList <HistoricIdentityLinkLogDto> result = new List <HistoricIdentityLinkLogDto>();

            foreach (HistoricIdentityLinkLog historicIdentityLink in queryResult)
            {
                HistoricIdentityLinkLogDto dto = HistoricIdentityLinkLogDto.fromHistoricIdentityLink(historicIdentityLink);
                result.Add(dto);
            }
            return(result);
        }