use of io.serverlessworkflow.api.defaultdef.DefaultConditionDefinition in project kogito-runtimes by kiegroup.
the class SwitchValidatorTest method validateDefaultConditionWithoutTransitionAndEndIsNullError.
@Test
void validateDefaultConditionWithoutTransitionAndEndIsNullError() {
DefaultConditionDefinition defaultCondition = mock(DefaultConditionDefinition.class);
Assertions.assertThatThrownBy(() -> SwitchValidator.validateDefaultCondition(defaultCondition, switchState, workflow, parserContext)).isInstanceOf(IllegalArgumentException.class).hasMessage(String.format(TRANSITION_OR_END_MUST_BE_CONFIGURED_FOR_DEFAULT_CONDITION_ERROR, SWITCH_STATE_NAME, WORKFLOW_NAME));
}
use of io.serverlessworkflow.api.defaultdef.DefaultConditionDefinition in project kogito-runtimes by kiegroup.
the class SwitchValidatorTest method validateDefaultConditionWithEventConditionsEndButTimeoutNotSetError.
@Test
void validateDefaultConditionWithEventConditionsEndButTimeoutNotSetError() {
switchState.getEventConditions().add(mock(EventCondition.class));
DefaultConditionDefinition defaultCondition = mock(DefaultConditionDefinition.class);
End end = mock(End.class);
doReturn(end).when(defaultCondition).getEnd();
Assertions.assertThatThrownBy(() -> SwitchValidator.validateDefaultCondition(defaultCondition, switchState, workflow, parserContext)).isInstanceOf(IllegalArgumentException.class).hasMessage(String.format(EVENT_TIMEOUT_REQUIRED_ERROR, SWITCH_STATE_NAME, WORKFLOW_NAME));
}
use of io.serverlessworkflow.api.defaultdef.DefaultConditionDefinition in project kogito-runtimes by kiegroup.
the class SwitchValidatorTest method mockDefaultConditionWithTransition.
private static DefaultConditionDefinition mockDefaultConditionWithTransition() {
DefaultConditionDefinition defaultCondition = mock(DefaultConditionDefinition.class);
Transition transition = mock(Transition.class);
doReturn(transition).when(defaultCondition).getTransition();
return defaultCondition;
}
Aggregations