DistanceRepositoryImpl implements DistanceRepository { @Override public void deleteDistances(Location location) { distanceRepository.deleteByFromIdOrToId(location.id()); } @Autowired  DistanceRepositoryImpl(DistanceCrudRepository distanceRepository); @Override void saveDistance(Location from, Location to, long distance); @Override long getDistance(Location from, Location to); @Override void deleteDistances(Location location); @Override void deleteAll();  }
@Test void should_delete_distance_by_location_id() { repository.deleteDistances(from); verify(crudRepository).deleteByFromIdOrToId(from.id()); }