@Test
void updateProducts(){
List<Long> productIdList = new ArrayList<>();
productIdList.add(1L);
productIdList.add(2L);
productIdList.add(3L);
productIdList.add(4L);
EventRequestDto eventRequestDto = EventRequestDto.builder()
.eventName("테스트 이벤트")
.discountRate(50)
.startedAt("2023-03-22 01:00:00")
.endAt("2023-03-22 02:00:00")
.eventStatus(EventStatus.RESERVED)
.productList(productIdList)
.build();
eventService.createEvent(eventRequestDto);
Products products = productRepository.findById(1L).orElseThrow(
() -> new CustomException(StatusCode.BAD_REQUEST)
);
// products.getEvent().getEventName()
assertThat("테스트 이벤트").isEqualTo(products.getEvent().getEventName());
}
org.hibernate.LazyInitializationException: could not initialize proxy [com.example.showmethemany.domain.Event#8] - no Session