use of com.epam.ta.reportportal.entity.widget.WidgetState in project service-api by reportportal.
the class MaterializedWidgetProviderHandlerImpl method validateState.
private void validateState(WidgetOptions widgetOptions) {
WidgetState widgetState = ofNullable(WidgetOptionUtil.getValueByKey(STATE, widgetOptions)).flatMap(WidgetState::findByName).orElseThrow(() -> new ReportPortalException(ErrorType.BAD_UPDATE_WIDGET_REQUEST, "Widget state not provided"));
BusinessRule.expect(widgetState, it -> !WidgetState.RENDERING.equals(it)).verify(ErrorType.BAD_UPDATE_WIDGET_REQUEST, "Unable to remove widget in 'rendering' state");
}
use of com.epam.ta.reportportal.entity.widget.WidgetState in project service-api by reportportal.
the class MaterializedViewContentRemover method validateState.
private void validateState(WidgetOptions widgetOptions) {
WidgetState widgetState = ofNullable(WidgetOptionUtil.getValueByKey(STATE, widgetOptions)).flatMap(WidgetState::findByName).orElseThrow(() -> new ReportPortalException(ErrorType.BAD_UPDATE_WIDGET_REQUEST, "Widget state not provided"));
BusinessRule.expect(widgetState, it -> !WidgetState.RENDERING.equals(it)).verify(ErrorType.BAD_UPDATE_WIDGET_REQUEST, "Unable to remove widget in 'rendering' state");
}
Aggregations