Search in sources :

Example 6 with TaskPropertyChangeProblemFactChange

use of org.kie.server.services.taskassigning.core.model.solver.realtime.TaskPropertyChangeProblemFactChange in project droolsjbpm-integration by kiegroup.

the class SolverHandlerTest method onSolutionSynchronizedWithChanges.

@Test
public void onSolutionSynchronizedWithChanges() {
    prepareStart();
    List<ProblemFactChange<TaskAssigningSolution>> changes = new ArrayList<>();
    changes.add(new TaskPropertyChangeProblemFactChange(new Task()));
    SolutionSynchronizer.Result result = SolutionSynchronizer.Result.forChanges(changes);
    doReturn(true).when(solverExecutor).isStarted();
    synchronizerConsumerCaptor.getValue().accept(result);
    verify(solverExecutor).addProblemFactChanges(changes);
    verify(solutionProcessor, never()).process(any(TaskAssigningSolution.class));
    verify(solutionSynchronizer, never()).synchronizeSolution(any(TaskAssigningSolution.class), any(LocalDateTime.class));
}
Also used : LocalDateTime(java.time.LocalDateTime) Task(org.kie.server.services.taskassigning.core.model.Task) ArrayList(java.util.ArrayList) TaskAssigningSolution(org.kie.server.services.taskassigning.core.model.TaskAssigningSolution) TaskPropertyChangeProblemFactChange(org.kie.server.services.taskassigning.core.model.solver.realtime.TaskPropertyChangeProblemFactChange) TaskPropertyChangeProblemFactChange(org.kie.server.services.taskassigning.core.model.solver.realtime.TaskPropertyChangeProblemFactChange) ProblemFactChange(org.optaplanner.core.impl.solver.ProblemFactChange) Test(org.junit.Test)

Aggregations

TaskPropertyChangeProblemFactChange (org.kie.server.services.taskassigning.core.model.solver.realtime.TaskPropertyChangeProblemFactChange)6 Task (org.kie.server.services.taskassigning.core.model.Task)4 ProblemFactChange (org.optaplanner.core.impl.solver.ProblemFactChange)4 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 TaskAssigningSolution (org.kie.server.services.taskassigning.core.model.TaskAssigningSolution)3 User (org.kie.server.services.taskassigning.core.model.User)3 AssignTaskProblemFactChange (org.kie.server.services.taskassigning.core.model.solver.realtime.AssignTaskProblemFactChange)3 ReleaseTaskProblemFactChange (org.kie.server.services.taskassigning.core.model.solver.realtime.ReleaseTaskProblemFactChange)3 UserUtil.fromExternalUser (org.kie.server.services.taskassigning.planning.util.UserUtil.fromExternalUser)3 Status (org.kie.api.task.model.Status)2 TaskData (org.kie.server.api.model.taskassigning.TaskData)2 AddTaskProblemFactChange (org.kie.server.services.taskassigning.core.model.solver.realtime.AddTaskProblemFactChange)2 AddUserProblemFactChange (org.kie.server.services.taskassigning.core.model.solver.realtime.AddUserProblemFactChange)2 DisableUserProblemFactChange (org.kie.server.services.taskassigning.core.model.solver.realtime.DisableUserProblemFactChange)2 RemoveTaskProblemFactChange (org.kie.server.services.taskassigning.core.model.solver.realtime.RemoveTaskProblemFactChange)2 RemoveUserProblemFactChange (org.kie.server.services.taskassigning.core.model.solver.realtime.RemoveUserProblemFactChange)2 UserPropertyChangeProblemFactChange (org.kie.server.services.taskassigning.core.model.solver.realtime.UserPropertyChangeProblemFactChange)2 TaskUtil.fromTaskData (org.kie.server.services.taskassigning.planning.util.TaskUtil.fromTaskData)2 LocalDateTime (java.time.LocalDateTime)1