use of com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME in project service-api by reportportal.
the class MostTimeConsumingContentLoader method loadContent.
@Override
public Map<String, ?> loadContent(List<String> contentFields, Map<Filter, Sort> filterSortMap, WidgetOptions widgetOptions, int limit) {
Filter filter = GROUP_FILTERS.apply(filterSortMap.keySet());
String launchName = WidgetOptionUtil.getValueByKey(LAUNCH_NAME_FIELD, widgetOptions);
return launchRepository.findLatestByFilter(filter.withCondition(FilterCondition.builder().eq(CRITERIA_NAME, launchName).build())).map(l -> loadContent(l, widgetOptions, contentFields)).orElseGet(Collections::emptyMap);
}
use of com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME in project service-api by reportportal.
the class FlakyCasesTableContentLoader method loadContent.
@Override
public Map<String, ?> loadContent(List<String> contentFields, Map<Filter, Sort> filterSortMapping, WidgetOptions widgetOptions, int limit) {
Filter filter = GROUP_FILTERS.apply(filterSortMapping.keySet());
String launchName = WidgetOptionUtil.getValueByKey(LAUNCH_NAME_FIELD, widgetOptions);
filter.withCondition(new FilterCondition(Condition.EQUALS, false, launchName, CRITERIA_NAME));
return launchRepository.findLatestByFilter(filter).map(l -> loadContent(l, filter, widgetOptions, limit)).orElseGet(Collections::emptyMap);
}
use of com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_NAME in project service-api by reportportal.
the class TopTestCasesContentLoader method loadContent.
@Override
public Map<String, ?> loadContent(List<String> contentFields, Map<Filter, Sort> filterSortMapping, WidgetOptions widgetOptions, int limit) {
String criteria = contentFields.get(0);
Filter filter = GROUP_FILTERS.apply(filterSortMapping.keySet()).withCondition(new FilterCondition(Condition.EQUALS, false, WidgetOptionUtil.getValueByKey(LAUNCH_NAME_FIELD, widgetOptions), CRITERIA_NAME));
return launchRepository.findLatestByFilter(filter).map(it -> Pair.of(it, widgetContentRepository.topItemsByCriteria(filter, criteria, limit, ofNullable(widgetOptions.getOptions().get(INCLUDE_METHODS)).map(v -> BooleanUtils.toBoolean(String.valueOf(v))).orElse(false)))).filter(it -> !it.getRight().isEmpty()).map(it -> (Map<String, ?>) ImmutableMap.<String, Object>builder().put(LATEST_LAUNCH, launchConverter.TO_RESOURCE.apply(it.getLeft())).put(RESULT, it.getRight()).build()).orElse(Collections.emptyMap());
}
Aggregations