test_class.declarator: routingProblems
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private RoutingProblemList routingProblems;
test_class.type: RoutingProblemList
test_class.var_name: routingProblems
test_class.declarator: locationService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private LocationService locationService;
test_class.type: LocationService
test_class.var_name: locationService
test_class.declarator: locationRepository
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private LocationRepository locationRepository;
test_class.type: LocationRepository
test_class.var_name: locationRepository
test_class.declarator: vehicleService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private VehicleService vehicleService;
test_class.type: VehicleService
test_class.var_name: vehicleService
test_class.declarator: vehicleRepository
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private VehicleRepository vehicleRepository;
test_class.type: VehicleRepository
test_class.var_name: vehicleRepository
test_class.declarator: dataSetMarshaller
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private DataSetMarshaller dataSetMarshaller;
test_class.type: DataSetMarshaller
test_class.var_name: dataSetMarshaller
test_class.declarator: demoService
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private DemoService demoService;
test_class.type: DemoService
test_class.var_name: demoService
test_class.declarator: routingProblemCaptor
test_class.modifier: @Captor
      private
test_class.original_string: @Captor
      private ArgumentCaptor<RoutingProblem> routingProblemCaptor;
test_class.type: ArgumentCaptor<RoutingProblem>
test_class.var_name: routingProblemCaptor
test_class.declarator: problemName = "Testing problem"
test_class.modifier: private final
test_class.original_string: private final String problemName = "Testing problem";
test_class.type: String
test_class.var_name: problemName
test_class.declarator: vehicles = Arrays.asList(
              VehicleFactory.vehicleData("v1", 10),
              VehicleFactory.vehicleData("v2", 10))
test_class.modifier: private final
test_class.original_string: private final List<VehicleData> vehicles = Arrays.asList(
              VehicleFactory.vehicleData("v1", 10),
              VehicleFactory.vehicleData("v2", 10));
test_class.type: List<VehicleData>
test_class.var_name: vehicles
test_class.declarator: depot = new Location(1, Coordinates.valueOf(1.0, 7), "Depot")
test_class.modifier: private final
test_class.original_string: private final Location depot = new Location(1, Coordinates.valueOf(1.0, 7), "Depot");
test_class.type: Location
test_class.var_name: depot
test_class.declarator: visits = Arrays.asList(new Location(2, Coordinates.valueOf(2.0, 9), "Visit"))
test_class.modifier: private final
test_class.original_string: private final List<Location> visits = Arrays.asList(new Location(2, Coordinates.valueOf(2.0, 9), "Visit"));
test_class.type: List<Location>
test_class.var_name: visits
test_class.declarator: routingProblem = new RoutingProblem(problemName, vehicles, depot, visits)
test_class.modifier: private final
test_class.original_string: private final RoutingProblem routingProblem = new RoutingProblem(problemName, vehicles, depot, visits);
test_class.type: RoutingProblem
test_class.var_name: routingProblem
test_class.file: optaweb-vehicle-routing-backend/src/test/java/org/optaweb/vehiclerouting/service/demo/DemoServiceTest.java
test_class.identifier: DemoServiceTest
test_case.body: @Test
      void loadDemo() {
          // arrange
          when(routingProblems.byName(problemName)).thenReturn(routingProblem);
          when(locationService.createLocation(any(Coordinates.class), anyString())).thenReturn(true);
          // act
          demoService.loadDemo(problemName);
          // assert
          verify(locationService, times(routingProblem.visits().size() + 1))
                  .createLocation(any(Coordinates.class), anyString());
          verify(vehicleService, times(routingProblem.vehicles().size()))
                  .createVehicle(any(VehicleData.class));
      }
test_case.class_method_signature: DemoServiceTest.loadDemo()
test_case.full_signature: @Test void loadDemo()
test_case.identifier: loadDemo
test_case.invocations: thenReturn when byName thenReturn when createLocation any anyString loadDemo createLocation verify times size visits any anyString createVehicle verify times size vehicles any
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void loadDemo()
focal_class.declarator: MAX_TRIES = 10
focal_class.modifier: static final
focal_class.original_string: static final int MAX_TRIES = 10;
focal_class.type: int
focal_class.var_name: MAX_TRIES
focal_class.declarator: routingProblems
focal_class.modifier: private final
focal_class.original_string: private final RoutingProblemList routingProblems;
focal_class.type: RoutingProblemList
focal_class.var_name: routingProblems
focal_class.declarator: locationService
focal_class.modifier: private final
focal_class.original_string: private final LocationService locationService;
focal_class.type: LocationService
focal_class.var_name: locationService
focal_class.declarator: locationRepository
focal_class.modifier: private final
focal_class.original_string: private final LocationRepository locationRepository;
focal_class.type: LocationRepository
focal_class.var_name: locationRepository
focal_class.declarator: vehicleService
focal_class.modifier: private final
focal_class.original_string: private final VehicleService vehicleService;
focal_class.type: VehicleService
focal_class.var_name: vehicleService
focal_class.declarator: vehicleRepository
focal_class.modifier: private final
focal_class.original_string: private final VehicleRepository vehicleRepository;
focal_class.type: VehicleRepository
focal_class.var_name: vehicleRepository
focal_class.declarator: dataSetMarshaller
focal_class.modifier: private final
focal_class.original_string: private final DataSetMarshaller dataSetMarshaller;
focal_class.type: DataSetMarshaller
focal_class.var_name: dataSetMarshaller
focal_class.file: optaweb-vehicle-routing-backend/src/main/java/org/optaweb/vehiclerouting/service/demo/DemoService.java
focal_class.identifier: DemoService
focal_class.class_method_signature: DemoService.DemoService(
              RoutingProblemList routingProblems,
              LocationService locationService,
              LocationRepository locationRepository,
              VehicleService vehicleService,
              VehicleRepository vehicleRepository,
              DataSetMarshaller dataSetMarshaller)
focal_class.full_signature: @Autowired public  DemoService(
              RoutingProblemList routingProblems,
              LocationService locationService,
              LocationRepository locationRepository,
              VehicleService vehicleService,
              VehicleRepository vehicleRepository,
              DataSetMarshaller dataSetMarshaller)
focal_class.identifier: DemoService
focal_class.modifiers: @Autowired public
focal_class.parameters: (
              RoutingProblemList routingProblems,
              LocationService locationService,
              LocationRepository locationRepository,
              VehicleService vehicleService,
              VehicleRepository vehicleRepository,
              DataSetMarshaller dataSetMarshaller)
focal_class.signature:  DemoService(
              RoutingProblemList routingProblems,
              LocationService locationService,
              LocationRepository locationRepository,
              VehicleService vehicleService,
              VehicleRepository vehicleRepository,
              DataSetMarshaller dataSetMarshaller)
focal_class.class_method_signature: DemoService.demos()
focal_class.full_signature: public Collection<RoutingProblem> demos()
focal_class.identifier: demos
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Collection<RoutingProblem>
focal_class.signature: Collection<RoutingProblem> demos()
focal_class.class_method_signature: DemoService.loadDemo(String name)
focal_class.full_signature: @Async public void loadDemo(String name)
focal_class.identifier: loadDemo
focal_class.modifiers: @Async public
focal_class.parameters: (String name)
focal_class.return: void
focal_class.signature: void loadDemo(String name)
focal_class.class_method_signature: DemoService.addWithRetry(Coordinates coordinates, String description)
focal_class.full_signature: private void addWithRetry(Coordinates coordinates, String description)
focal_class.identifier: addWithRetry
focal_class.modifiers: private
focal_class.parameters: (Coordinates coordinates, String description)
focal_class.return: void
focal_class.signature: void addWithRetry(Coordinates coordinates, String description)
focal_class.class_method_signature: DemoService.exportDataSet()
focal_class.full_signature: public String exportDataSet()
focal_class.identifier: exportDataSet
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String exportDataSet()
focal_method.body: @Async
      public void loadDemo(String name) {
          RoutingProblem routingProblem = routingProblems.byName(name);
          // Add depot
          routingProblem.depot().ifPresent(depot -> addWithRetry(depot.coordinates(), depot.description()));
  
          // TODO start randomizing only after using all available cities (=> reproducibility for small demos)
          routingProblem.visits().forEach(visit -> addWithRetry(visit.coordinates(), visit.description()));
          routingProblem.vehicles().forEach(vehicleService::createVehicle);
      }
focal_method.class_method_signature: DemoService.loadDemo(String name)
focal_method.full_signature: @Async public void loadDemo(String name)
focal_method.identifier: loadDemo
focal_method.invocations: byName ifPresent depot addWithRetry coordinates description forEach visits addWithRetry coordinates description forEach vehicles
focal_method.modifiers: @Async public
focal_method.parameters: (String name)
focal_method.return: void
focal_method.signature: void loadDemo(String name)