@Test void get_all_locations() { LocationEntity locationEntity = locationEntity(testLocation); when(crudRepository.findAll()).thenReturn(Collections.singletonList(locationEntity)); assertThat(repository.locations()).containsExactly(testLocation); }
@Override public List<Location> locations() { return StreamSupport.stream(repository.findAll().spliterator(), false) .map(LocationRepositoryImpl::toDomain) .collect(toList()); }
LocationRepositoryImpl implements LocationRepository { @Override public List<Location> locations() { return StreamSupport.stream(repository.findAll().spliterator(), false) .map(LocationRepositoryImpl::toDomain) .collect(toList()); } }
LocationRepositoryImpl implements LocationRepository { @Override public List<Location> locations() { return StreamSupport.stream(repository.findAll().spliterator(), false) .map(LocationRepositoryImpl::toDomain) .collect(toList()); } @Autowired  LocationRepositoryImpl(LocationCrudRepository repository); }
LocationRepositoryImpl implements LocationRepository { @Override public List<Location> locations() { return StreamSupport.stream(repository.findAll().spliterator(), false) .map(LocationRepositoryImpl::toDomain) .collect(toList()); } @Autowired  LocationRepositoryImpl(LocationCrudRepository repository); @Override Location createLocation(Coordinates coordinates, String description); @Override List<Location> locations(); @Override Location removeLocation(long id); @Override void removeAll(); @Override Optional<Location> find(long locationId); }
LocationRepositoryImpl implements LocationRepository { @Override public List<Location> locations() { return StreamSupport.stream(repository.findAll().spliterator(), false) .map(LocationRepositoryImpl::toDomain) .collect(toList()); } @Autowired  LocationRepositoryImpl(LocationCrudRepository repository); @Override Location createLocation(Coordinates coordinates, String description); @Override List<Location> locations(); @Override Location removeLocation(long id); @Override void removeAll(); @Override Optional<Location> find(long locationId);  }