use of com.epam.ta.reportportal.core.widget.content.constant.ContentLoaderConstants.MIN_PASSING_RATE in project service-api by reportportal.
the class ComponentHealthCheckContentValidator method validateWidgetOptions.
private void validateWidgetOptions(WidgetOptions widgetOptions) {
BusinessRule.expect(widgetOptions, Objects::nonNull).verify(ErrorType.UNABLE_LOAD_WIDGET_CONTENT, "Widgets options not provided");
Integer passingRate = WidgetOptionUtil.getIntegerByKey(MIN_PASSING_RATE, widgetOptions).orElseThrow(() -> new ReportPortalException(ErrorType.UNABLE_LOAD_WIDGET_CONTENT, "Minimum passing rate option was not specified"));
BusinessRule.expect(passingRate, v -> v >= 0 && v <= 100).verify(ErrorType.UNABLE_LOAD_WIDGET_CONTENT, "Minimum passing rate value should be greater or equal to 0 and less or equal to 100");
}
Aggregations