test_class.declarator: scoreDirector
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ScoreDirector<VehicleRoutingSolution> scoreDirector;
test_class.type: ScoreDirector<VehicleRoutingSolution>
test_class.var_name: scoreDirector
test_class.file: optaweb-vehicle-routing-backend/src/test/java/org/optaweb/vehiclerouting/plugin/planner/change/ChangeVehicleCapacityTest.java
test_class.identifier: ChangeVehicleCapacityTest
test_case.body: @Test
      void change_vehicle_capacity() {
          int oldCapacity = 100;
          int newCapacity = 50;
  
          PlanningVehicle workingVehicle = PlanningVehicleFactory.testVehicle(1, oldCapacity);
          PlanningVehicle changeVehicle = PlanningVehicleFactory.testVehicle(2, newCapacity);
  
          when(scoreDirector.lookUpWorkingObject(changeVehicle)).thenReturn(workingVehicle);
  
          // do change
          ChangeVehicleCapacity changeVehicleCapacity = new ChangeVehicleCapacity(changeVehicle);
          changeVehicleCapacity.doChange(scoreDirector);
  
          assertThat(workingVehicle.getCapacity()).isEqualTo(newCapacity);
  
          verify(scoreDirector).beforeProblemPropertyChanged(workingVehicle);
          verify(scoreDirector).afterProblemPropertyChanged(workingVehicle);
          verify(scoreDirector).triggerVariableListeners();
      }
test_case.class_method_signature: ChangeVehicleCapacityTest.change_vehicle_capacity()
test_case.full_signature: @Test void change_vehicle_capacity()
test_case.identifier: change_vehicle_capacity
test_case.invocations: testVehicle testVehicle thenReturn when lookUpWorkingObject doChange isEqualTo assertThat getCapacity beforeProblemPropertyChanged verify afterProblemPropertyChanged verify triggerVariableListeners verify
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void change_vehicle_capacity()
focal_class.declarator: vehicle
focal_class.modifier: private final
focal_class.original_string: private final PlanningVehicle vehicle;
focal_class.type: PlanningVehicle
focal_class.var_name: vehicle
focal_class.file: optaweb-vehicle-routing-backend/src/main/java/org/optaweb/vehiclerouting/plugin/planner/change/ChangeVehicleCapacity.java
focal_class.identifier: ChangeVehicleCapacity
focal_class.interfaces: implements ProblemFactChange<VehicleRoutingSolution>
focal_class.class_method_signature: ChangeVehicleCapacity.ChangeVehicleCapacity(PlanningVehicle vehicle)
focal_class.full_signature: public  ChangeVehicleCapacity(PlanningVehicle vehicle)
focal_class.identifier: ChangeVehicleCapacity
focal_class.modifiers: public
focal_class.parameters: (PlanningVehicle vehicle)
focal_class.signature:  ChangeVehicleCapacity(PlanningVehicle vehicle)
focal_class.class_method_signature: ChangeVehicleCapacity.doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_class.full_signature: @Override public void doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_class.identifier: doChange
focal_class.modifiers: @Override public
focal_class.parameters: (ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_class.return: void
focal_class.signature: void doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_method.body: @Override
      public void doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector) {
          PlanningVehicle workingVehicle = scoreDirector.lookUpWorkingObject(vehicle);
          if (workingVehicle == null) {
              throw new IllegalStateException("Can't look up a working copy of " + vehicle);
          }
  
          // No need to clone the workingVehicle because it is a planning entity, so it is already planning-cloned.
          // To learn more about problem fact changes, see:
          // https://docs.jboss.org/optaplanner/release/latest/optaplanner-docs/html_single/#problemFactChangeExample
  
          scoreDirector.beforeProblemPropertyChanged(workingVehicle);
          workingVehicle.setCapacity(vehicle.getCapacity());
          scoreDirector.afterProblemPropertyChanged(workingVehicle);
  
          scoreDirector.triggerVariableListeners();
      }
focal_method.class_method_signature: ChangeVehicleCapacity.doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_method.full_signature: @Override public void doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_method.identifier: doChange
focal_method.invocations: lookUpWorkingObject beforeProblemPropertyChanged setCapacity getCapacity afterProblemPropertyChanged triggerVariableListeners
focal_method.modifiers: @Override public
focal_method.parameters: (ScoreDirector<VehicleRoutingSolution> scoreDirector)
focal_method.return: void
focal_method.signature: void doChange(ScoreDirector<VehicleRoutingSolution> scoreDirector)