@Test void checkInputTime() { OpeningHoursDto openingHours = ModelUtils.getOpeningHoursDto(); openingHours.setOpenTime(ModelUtils.getLocalTime().plusHours(1L)); assertThrows(BadRequestException.class, () -> proposePlaceService.checkInputTime(Collections.singleton(openingHours))); }
@Override public void checkInputTime(Set<OpeningHoursDto> dto) { dto.forEach(hours -> { if (hours.getOpenTime().getHour() > hours.getCloseTime().getHour()) { throw new BadRequestException(ErrorMessage.CLOSE_TIME_LATE_THAN_OPEN_TIME); } if (hours.getBreakTime() != null) { if (hours.getBreakTime().getStartTime().getHour() < hours.getOpenTime().getHour() || hours.getBreakTime().getEndTime().getHour() > hours.getCloseTime().getHour()) { throw new BadRequestException(ErrorMessage.WRONG_BREAK_TIME); } } }); }
ProposePlaceServiceImpl implements ProposePlaceService { @Override public void checkInputTime(Set<OpeningHoursDto> dto) { dto.forEach(hours -> { if (hours.getOpenTime().getHour() > hours.getCloseTime().getHour()) { throw new BadRequestException(ErrorMessage.CLOSE_TIME_LATE_THAN_OPEN_TIME); } if (hours.getBreakTime() != null) { if (hours.getBreakTime().getStartTime().getHour() < hours.getOpenTime().getHour() || hours.getBreakTime().getEndTime().getHour() > hours.getCloseTime().getHour()) { throw new BadRequestException(ErrorMessage.WRONG_BREAK_TIME); } } }); } }
ProposePlaceServiceImpl implements ProposePlaceService { @Override public void checkInputTime(Set<OpeningHoursDto> dto) { dto.forEach(hours -> { if (hours.getOpenTime().getHour() > hours.getCloseTime().getHour()) { throw new BadRequestException(ErrorMessage.CLOSE_TIME_LATE_THAN_OPEN_TIME); } if (hours.getBreakTime() != null) { if (hours.getBreakTime().getStartTime().getHour() < hours.getOpenTime().getHour() || hours.getBreakTime().getEndTime().getHour() > hours.getCloseTime().getHour()) { throw new BadRequestException(ErrorMessage.WRONG_BREAK_TIME); } } }); }  }
ProposePlaceServiceImpl implements ProposePlaceService { @Override public void checkInputTime(Set<OpeningHoursDto> dto) { dto.forEach(hours -> { if (hours.getOpenTime().getHour() > hours.getCloseTime().getHour()) { throw new BadRequestException(ErrorMessage.CLOSE_TIME_LATE_THAN_OPEN_TIME); } if (hours.getBreakTime() != null) { if (hours.getBreakTime().getStartTime().getHour() < hours.getOpenTime().getHour() || hours.getBreakTime().getEndTime().getHour() > hours.getCloseTime().getHour()) { throw new BadRequestException(ErrorMessage.WRONG_BREAK_TIME); } } }); }  @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 checkInputTime(Set<OpeningHoursDto> dto) { dto.forEach(hours -> { if (hours.getOpenTime().getHour() > hours.getCloseTime().getHour()) { throw new BadRequestException(ErrorMessage.CLOSE_TIME_LATE_THAN_OPEN_TIME); } if (hours.getBreakTime() != null) { if (hours.getBreakTime().getStartTime().getHour() < hours.getOpenTime().getHour() || hours.getBreakTime().getEndTime().getHour() > hours.getCloseTime().getHour()) { throw new BadRequestException(ErrorMessage.WRONG_BREAK_TIME); } } }); }  @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);  }