@Test void checkLocationValues() { Location location = ModelUtils.getLocation(); LocationAddressAndGeoDto address = ModelUtils.getLocationAddressAndGeoDto(); when(locationService.findByLatAndLng(12.12d, 12.12d)).thenReturn(Optional.of(location)); assertThrows(BadRequestException.class, () -> proposePlaceService.checkLocationValues(address)); }
@Override public void checkLocationValues(LocationAddressAndGeoDto dto) { if (locationService.findByLatAndLng(dto.getLat(), dto.getLng()).isPresent()) { throw new BadRequestException(ErrorMessage.LOCATION_IS_PRESENT); } }
ProposePlaceServiceImpl implements ProposePlaceService { @Override public void checkLocationValues(LocationAddressAndGeoDto dto) { if (locationService.findByLatAndLng(dto.getLat(), dto.getLng()).isPresent()) { throw new BadRequestException(ErrorMessage.LOCATION_IS_PRESENT); } } }
ProposePlaceServiceImpl implements ProposePlaceService { @Override public void checkLocationValues(LocationAddressAndGeoDto dto) { if (locationService.findByLatAndLng(dto.getLat(), dto.getLng()).isPresent()) { throw new BadRequestException(ErrorMessage.LOCATION_IS_PRESENT); } }  }
ProposePlaceServiceImpl implements ProposePlaceService { @Override public void checkLocationValues(LocationAddressAndGeoDto dto) { if (locationService.findByLatAndLng(dto.getLat(), dto.getLng()).isPresent()) { throw new BadRequestException(ErrorMessage.LOCATION_IS_PRESENT); } }  @Override void checkLocationValues(LocationAddressAndGeoDto dto); @Override void checkInputTime(Set<OpeningHoursDto> dto); @Override void savePhotosWithPlace(List<Photo> photos, Place place); @Override void saveDiscountValuesWithPlace(Set<DiscountValue> discountValues, Place place); }
ProposePlaceServiceImpl implements ProposePlaceService { @Override public void checkLocationValues(LocationAddressAndGeoDto dto) { if (locationService.findByLatAndLng(dto.getLat(), dto.getLng()).isPresent()) { throw new BadRequestException(ErrorMessage.LOCATION_IS_PRESENT); } }  @Override void checkLocationValues(LocationAddressAndGeoDto dto); @Override void checkInputTime(Set<OpeningHoursDto> dto); @Override void savePhotosWithPlace(List<Photo> photos, Place place); @Override void saveDiscountValuesWithPlace(Set<DiscountValue> discountValues, Place place);  }