Search in sources :

Example 1 with RemoveUserProblemFactChange

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());
}
Also used : RemoveUserProblemFactChange(org.kie.kogito.taskassigning.core.model.solver.realtime.RemoveUserProblemFactChange)

Example 2 with RemoveUserProblemFactChange

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();
}
Also used : User(org.kie.kogito.taskassigning.core.model.User) TaskAssigningSolution(org.kie.kogito.taskassigning.core.model.TaskAssigningSolution) RemoveUserProblemFactChange(org.kie.kogito.taskassigning.core.model.solver.realtime.RemoveUserProblemFactChange) RemoveUserProblemFactChange(org.kie.kogito.taskassigning.core.model.solver.realtime.RemoveUserProblemFactChange) ProblemFactChange(org.optaplanner.core.api.solver.ProblemFactChange) AssignTaskProblemFactChange(org.kie.kogito.taskassigning.core.model.solver.realtime.AssignTaskProblemFactChange) DisableUserProblemFactChange(org.kie.kogito.taskassigning.core.model.solver.realtime.DisableUserProblemFactChange) UserPropertyChangeProblemFactChange(org.kie.kogito.taskassigning.core.model.solver.realtime.UserPropertyChangeProblemFactChange) AddUserProblemFactChange(org.kie.kogito.taskassigning.core.model.solver.realtime.AddUserProblemFactChange) RemoveTaskProblemFactChange(org.kie.kogito.taskassigning.core.model.solver.realtime.RemoveTaskProblemFactChange) AddTaskProblemFactChange(org.kie.kogito.taskassigning.core.model.solver.realtime.AddTaskProblemFactChange) ReleaseTaskProblemFactChange(org.kie.kogito.taskassigning.core.model.solver.realtime.ReleaseTaskProblemFactChange) Test(org.junit.jupiter.api.Test)

Aggregations

RemoveUserProblemFactChange (org.kie.kogito.taskassigning.core.model.solver.realtime.RemoveUserProblemFactChange)2 Test (org.junit.jupiter.api.Test)1 TaskAssigningSolution (org.kie.kogito.taskassigning.core.model.TaskAssigningSolution)1 User (org.kie.kogito.taskassigning.core.model.User)1 AddTaskProblemFactChange (org.kie.kogito.taskassigning.core.model.solver.realtime.AddTaskProblemFactChange)1 AddUserProblemFactChange (org.kie.kogito.taskassigning.core.model.solver.realtime.AddUserProblemFactChange)1 AssignTaskProblemFactChange (org.kie.kogito.taskassigning.core.model.solver.realtime.AssignTaskProblemFactChange)1 DisableUserProblemFactChange (org.kie.kogito.taskassigning.core.model.solver.realtime.DisableUserProblemFactChange)1 ReleaseTaskProblemFactChange (org.kie.kogito.taskassigning.core.model.solver.realtime.ReleaseTaskProblemFactChange)1 RemoveTaskProblemFactChange (org.kie.kogito.taskassigning.core.model.solver.realtime.RemoveTaskProblemFactChange)1 UserPropertyChangeProblemFactChange (org.kie.kogito.taskassigning.core.model.solver.realtime.UserPropertyChangeProblemFactChange)1 ProblemFactChange (org.optaplanner.core.api.solver.ProblemFactChange)1