@Test public void doChangeUserDontExists() { when(scoreDirector.lookUpWorkingObjectOrReturnNull(user)).thenReturn(null); change.doChange(scoreDirector); verify(scoreDirector, never()).beforeProblemPropertyChanged(any()); verify(scoreDirector, never()).afterProblemPropertyChanged(any()); verify(scoreDirector, never()).triggerVariableListeners(); }
@Override public void doChange(ScoreDirector<TaskAssigningSolution> scoreDirector) { final User workingUser = scoreDirector.lookUpWorkingObjectOrReturnNull(user); if (workingUser == null) { return; } scoreDirector.beforeProblemPropertyChanged(workingUser); workingUser.setEnabled(enabled); workingUser.setAllLabelValues(labelValues); workingUser.setAttributes(attributes); workingUser.setGroups(groups); scoreDirector.afterProblemPropertyChanged(workingUser); releaseNonPinnedTasks(workingUser, scoreDirector); scoreDirector.triggerVariableListeners(); }
UserPropertyChangeProblemFactChange implements ProblemFactChange<TaskAssigningSolution> { @Override public void doChange(ScoreDirector<TaskAssigningSolution> scoreDirector) { final User workingUser = scoreDirector.lookUpWorkingObjectOrReturnNull(user); if (workingUser == null) { return; } scoreDirector.beforeProblemPropertyChanged(workingUser); workingUser.setEnabled(enabled); workingUser.setAllLabelValues(labelValues); workingUser.setAttributes(attributes); workingUser.setGroups(groups); scoreDirector.afterProblemPropertyChanged(workingUser); releaseNonPinnedTasks(workingUser, scoreDirector); scoreDirector.triggerVariableListeners(); } }
UserPropertyChangeProblemFactChange implements ProblemFactChange<TaskAssigningSolution> { @Override public void doChange(ScoreDirector<TaskAssigningSolution> scoreDirector) { final User workingUser = scoreDirector.lookUpWorkingObjectOrReturnNull(user); if (workingUser == null) { return; } scoreDirector.beforeProblemPropertyChanged(workingUser); workingUser.setEnabled(enabled); workingUser.setAllLabelValues(labelValues); workingUser.setAttributes(attributes); workingUser.setGroups(groups); scoreDirector.afterProblemPropertyChanged(workingUser); releaseNonPinnedTasks(workingUser, scoreDirector); scoreDirector.triggerVariableListeners(); } UserPropertyChangeProblemFactChange(User user, boolean enabled, Map<String, Object> attributes,
                                               Map<String, Set<Object>> labelValues, Set<Group> groups); }
UserPropertyChangeProblemFactChange implements ProblemFactChange<TaskAssigningSolution> { @Override public void doChange(ScoreDirector<TaskAssigningSolution> scoreDirector) { final User workingUser = scoreDirector.lookUpWorkingObjectOrReturnNull(user); if (workingUser == null) { return; } scoreDirector.beforeProblemPropertyChanged(workingUser); workingUser.setEnabled(enabled); workingUser.setAllLabelValues(labelValues); workingUser.setAttributes(attributes); workingUser.setGroups(groups); scoreDirector.afterProblemPropertyChanged(workingUser); releaseNonPinnedTasks(workingUser, scoreDirector); scoreDirector.triggerVariableListeners(); } UserPropertyChangeProblemFactChange(User user, boolean enabled, Map<String, Object> attributes,
                                               Map<String, Set<Object>> labelValues, Set<Group> groups); User getUser(); boolean isEnabled(); Map<String, Object> getAttributes(); Map<String, Set<Object>> getLabelValues(); Set<Group> getGroups(); @Override void doChange(ScoreDirector<TaskAssigningSolution> scoreDirector); }
UserPropertyChangeProblemFactChange implements ProblemFactChange<TaskAssigningSolution> { @Override public void doChange(ScoreDirector<TaskAssigningSolution> scoreDirector) { final User workingUser = scoreDirector.lookUpWorkingObjectOrReturnNull(user); if (workingUser == null) { return; } scoreDirector.beforeProblemPropertyChanged(workingUser); workingUser.setEnabled(enabled); workingUser.setAllLabelValues(labelValues); workingUser.setAttributes(attributes); workingUser.setGroups(groups); scoreDirector.afterProblemPropertyChanged(workingUser); releaseNonPinnedTasks(workingUser, scoreDirector); scoreDirector.triggerVariableListeners(); } UserPropertyChangeProblemFactChange(User user, boolean enabled, Map<String, Object> attributes,
                                               Map<String, Set<Object>> labelValues, Set<Group> groups); User getUser(); boolean isEnabled(); Map<String, Object> getAttributes(); Map<String, Set<Object>> getLabelValues(); Set<Group> getGroups(); @Override void doChange(ScoreDirector<TaskAssigningSolution> scoreDirector);  }