@Test(expected = NotFoundException.class) public void findByIdGivenIdNullThenThrowException() { openHoursService.findById(null); }
@Override public OpeningHours findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return hoursRepo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.OPEN_HOURS_NOT_FOUND_BY_ID + id)); }
OpenHoursServiceImpl implements OpenHoursService { @Override public OpeningHours findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return hoursRepo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.OPEN_HOURS_NOT_FOUND_BY_ID + id)); } }
OpenHoursServiceImpl implements OpenHoursService { @Override public OpeningHours findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return hoursRepo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.OPEN_HOURS_NOT_FOUND_BY_ID + id)); }  }
OpenHoursServiceImpl implements OpenHoursService { @Override public OpeningHours findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return hoursRepo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.OPEN_HOURS_NOT_FOUND_BY_ID + id)); }  List<OpeningHours> getOpenHoursByPlace(Place place); @Override OpeningHours save(OpeningHours hours); @Override List<OpeningHours> findAll(); @Override OpeningHours findById(Long id); @Override OpeningHours update(Long id, OpeningHours updatedHours); @Override Long deleteById(Long id); @Override Set<OpeningHours> findAllByPlaceId(Long placeId); @Override void deleteAllByPlaceId(Long placeId); }
OpenHoursServiceImpl implements OpenHoursService { @Override public OpeningHours findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return hoursRepo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.OPEN_HOURS_NOT_FOUND_BY_ID + id)); }  List<OpeningHours> getOpenHoursByPlace(Place place); @Override OpeningHours save(OpeningHours hours); @Override List<OpeningHours> findAll(); @Override OpeningHours findById(Long id); @Override OpeningHours update(Long id, OpeningHours updatedHours); @Override Long deleteById(Long id); @Override Set<OpeningHours> findAllByPlaceId(Long placeId); @Override void deleteAllByPlaceId(Long placeId);  }