@Test(expected = NotFoundException.class) public void findByIdGivenIdNullThenThrowException() { discountService.findById(null); }
@Override public DiscountValue findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return repo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.DISCOUNT_NOT_FOUND_BY_ID + id)); }
DiscountServiceImpl implements DiscountService { @Override public DiscountValue findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return repo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.DISCOUNT_NOT_FOUND_BY_ID + id)); } }
DiscountServiceImpl implements DiscountService { @Override public DiscountValue findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return repo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.DISCOUNT_NOT_FOUND_BY_ID + id)); }  }
DiscountServiceImpl implements DiscountService { @Override public DiscountValue findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return repo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.DISCOUNT_NOT_FOUND_BY_ID + id)); }  @Override DiscountValue save(DiscountValue discountValue); @Override DiscountValue findById(Long id); @Override Set<DiscountValue> findAllByPlaceId(Long placeId); @Override void deleteAllByPlaceId(Long placeId); }
DiscountServiceImpl implements DiscountService { @Override public DiscountValue findById(Long id) { log.info(LogMessage.IN_FIND_BY_ID, id); return repo .findById(id) .orElseThrow( () -> new NotFoundException(ErrorMessage.DISCOUNT_NOT_FOUND_BY_ID + id)); }  @Override DiscountValue save(DiscountValue discountValue); @Override DiscountValue findById(Long id); @Override Set<DiscountValue> findAllByPlaceId(Long placeId); @Override void deleteAllByPlaceId(Long placeId);  }