use of com.epam.ta.reportportal.ws.model.ActivityResource in project commons-dao by reportportal.
the class WidgetContentRepositoryTest method activityStatistics.
@Test
void activityStatistics() {
Filter filter = buildDefaultActivityFilter(1L);
Sort sort = Sort.by(Lists.newArrayList(new Sort.Order(Sort.Direction.DESC, CRITERIA_CREATION_DATE)));
List<String> contentFields = buildActivityContentFields();
filter.withCondition(new FilterCondition(Condition.EQUALS, false, "superadmin", CRITERIA_USER)).withCondition(new FilterCondition(Condition.IN, false, String.join(",", contentFields), CRITERIA_ACTION));
List<ActivityResource> activityContentList = widgetContentRepository.activityStatistics(filter, sort, 4);
assertNotNull(activityContentList);
assertEquals(4, activityContentList.size());
}
use of com.epam.ta.reportportal.ws.model.ActivityResource in project commons-dao by reportportal.
the class WidgetContentRepositoryTest method activityStatisticsSorting.
@Test
void activityStatisticsSorting() {
Filter filter = buildDefaultActivityFilter(1L);
List<Sort.Order> orders = filter.getTarget().getCriteriaHolders().stream().map(ch -> new Sort.Order(Sort.Direction.ASC, ch.getFilterCriteria())).collect(Collectors.toList());
Sort sort = Sort.by(orders);
List<String> contentFields = buildActivityContentFields();
filter.withCondition(new FilterCondition(Condition.EQUALS, false, "superadmin", CRITERIA_USER)).withCondition(new FilterCondition(Condition.IN, false, String.join(",", contentFields), CRITERIA_ACTION));
List<ActivityResource> activityContentList = widgetContentRepository.activityStatistics(filter, sort, 4);
assertNotNull(activityContentList);
assertEquals(4, activityContentList.size());
}
Aggregations