test_class.declarator: crudRepository
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private LocationCrudRepository crudRepository;
test_class.type: LocationCrudRepository
test_class.var_name: crudRepository
test_class.declarator: repository
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private LocationRepositoryImpl repository;
test_class.type: LocationRepositoryImpl
test_class.var_name: repository
test_class.declarator: locationEntityCaptor
test_class.modifier: @Captor
      private
test_class.original_string: @Captor
      private ArgumentCaptor<LocationEntity> locationEntityCaptor;
test_class.type: ArgumentCaptor<LocationEntity>
test_class.var_name: locationEntityCaptor
test_class.declarator: testLocation = new Location(76, Coordinates.valueOf(1.2, 3.4), "description")
test_class.modifier: private final
test_class.original_string: private final Location testLocation = new Location(76, Coordinates.valueOf(1.2, 3.4), "description");
test_class.type: Location
test_class.var_name: testLocation
test_class.file: optaweb-vehicle-routing-backend/src/test/java/org/optaweb/vehiclerouting/plugin/persistence/LocationRepositoryImplTest.java
test_class.identifier: LocationRepositoryImplTest
test_case.body: @Test
      void removing_nonexistent_location_should_fail() {
          when(crudRepository.findById(anyLong())).thenReturn(Optional.empty());
  
          // removing nonexistent location should fail and its ID should appear in the exception message
          int uniqueNonexistentId = 7173;
          assertThatIllegalArgumentException()
                  .isThrownBy(() -> repository.removeLocation(uniqueNonexistentId))
                  .withMessageContaining(String.valueOf(uniqueNonexistentId));
      }
test_case.class_method_signature: LocationRepositoryImplTest.removing_nonexistent_location_should_fail()
test_case.full_signature: @Test void removing_nonexistent_location_should_fail()
test_case.identifier: removing_nonexistent_location_should_fail
test_case.invocations: thenReturn when findById anyLong empty withMessageContaining isThrownBy assertThatIllegalArgumentException removeLocation valueOf
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void removing_nonexistent_location_should_fail()
focal_class.declarator: logger = LoggerFactory.getLogger(LocationRepositoryImpl.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(LocationRepositoryImpl.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: repository
focal_class.modifier: private final
focal_class.original_string: private final LocationCrudRepository repository;
focal_class.type: LocationCrudRepository
focal_class.var_name: repository
focal_class.file: optaweb-vehicle-routing-backend/src/main/java/org/optaweb/vehiclerouting/plugin/persistence/LocationRepositoryImpl.java
focal_class.identifier: LocationRepositoryImpl
focal_class.interfaces: implements LocationRepository
focal_class.class_method_signature: LocationRepositoryImpl.LocationRepositoryImpl(LocationCrudRepository repository)
focal_class.full_signature: @Autowired  LocationRepositoryImpl(LocationCrudRepository repository)
focal_class.identifier: LocationRepositoryImpl
focal_class.modifiers: @Autowired
focal_class.parameters: (LocationCrudRepository repository)
focal_class.signature:  LocationRepositoryImpl(LocationCrudRepository repository)
focal_class.class_method_signature: LocationRepositoryImpl.createLocation(Coordinates coordinates, String description)
focal_class.full_signature: @Override public Location createLocation(Coordinates coordinates, String description)
focal_class.identifier: createLocation
focal_class.modifiers: @Override public
focal_class.parameters: (Coordinates coordinates, String description)
focal_class.return: Location
focal_class.signature: Location createLocation(Coordinates coordinates, String description)
focal_class.class_method_signature: LocationRepositoryImpl.locations()
focal_class.full_signature: @Override public List<Location> locations()
focal_class.identifier: locations
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<Location>
focal_class.signature: List<Location> locations()
focal_class.class_method_signature: LocationRepositoryImpl.removeLocation(long id)
focal_class.full_signature: @Override public Location removeLocation(long id)
focal_class.identifier: removeLocation
focal_class.modifiers: @Override public
focal_class.parameters: (long id)
focal_class.return: Location
focal_class.signature: Location removeLocation(long id)
focal_class.class_method_signature: LocationRepositoryImpl.removeAll()
focal_class.full_signature: @Override public void removeAll()
focal_class.identifier: removeAll
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void removeAll()
focal_class.class_method_signature: LocationRepositoryImpl.find(long locationId)
focal_class.full_signature: @Override public Optional<Location> find(long locationId)
focal_class.identifier: find
focal_class.modifiers: @Override public
focal_class.parameters: (long locationId)
focal_class.return: Optional<Location>
focal_class.signature: Optional<Location> find(long locationId)
focal_class.class_method_signature: LocationRepositoryImpl.toDomain(LocationEntity locationEntity)
focal_class.full_signature: private static Location toDomain(LocationEntity locationEntity)
focal_class.identifier: toDomain
focal_class.modifiers: private static
focal_class.parameters: (LocationEntity locationEntity)
focal_class.return: Location
focal_class.signature: Location toDomain(LocationEntity locationEntity)
focal_method.body: @Override
      public Location removeLocation(long id) {
          Optional<LocationEntity> maybeLocation = repository.findById(id);
          maybeLocation.ifPresent(locationEntity -> repository.deleteById(id));
          LocationEntity locationEntity = maybeLocation.orElseThrow(
                  () -> new IllegalArgumentException("Location{id=" + id + "} doesn't exist"));
          Location location = toDomain(locationEntity);
          logger.info("Deleted location {}.", location.fullDescription());
          return location;
      }
focal_method.class_method_signature: LocationRepositoryImpl.removeLocation(long id)
focal_method.full_signature: @Override public Location removeLocation(long id)
focal_method.identifier: removeLocation
focal_method.invocations: findById ifPresent deleteById orElseThrow toDomain info fullDescription
focal_method.modifiers: @Override public
focal_method.parameters: (long id)
focal_method.return: Location
focal_method.signature: Location removeLocation(long id)