use of org.kie.kogito.taskassigning.core.model.solver.realtime.RemoveUserProblemFactChange in project kogito-apps by kiegroup.
the class SolutionChangesBuilderTest method assertChange.
private static void assertChange(List<ProblemFactChange<TaskAssigningSolution>> result, int index, RemoveUserProblemFactChange expected) {
assertThat(result.get(index)).isInstanceOf(RemoveUserProblemFactChange.class);
RemoveUserProblemFactChange change = (RemoveUserProblemFactChange) result.get(index);
assertUserEquals(change.getUser(), expected.getUser());
}
use of org.kie.kogito.taskassigning.core.model.solver.realtime.RemoveUserProblemFactChange in project kogito-apps by kiegroup.
the class SolutionChangesBuilderTest method addRemoveUserChange.
@Test
void addRemoveUserChange() {
User user = mockUser(USER_1);
user.setEnabled(false);
TaskAssigningSolution solution = mockSolution(Collections.singletonList(user), Collections.emptyList());
List<ProblemFactChange<TaskAssigningSolution>> result = SolutionChangesBuilder.create().withContext(context).withUserServiceConnector(userServiceConnector).withProcessors(processorRegistry).fromTasksData(Collections.emptyList()).forSolution(solution).build();
RemoveUserProblemFactChange expected = new RemoveUserProblemFactChange(user);
assertChangeIsTheChangeSetId(result, 0);
assertChange(result, 1, expected);
assertThatUserProcessorsWereNotApplied();
}
Aggregations