diff --git a/src/test/java/com/depromeet/breadmapbackend/domain/admin/feed/controller/FeedAdminControllerTest.java b/src/test/java/com/depromeet/breadmapbackend/domain/admin/feed/controller/FeedAdminControllerTest.java index 0b5a8514..3b62c04e 100644 --- a/src/test/java/com/depromeet/breadmapbackend/domain/admin/feed/controller/FeedAdminControllerTest.java +++ b/src/test/java/com/depromeet/breadmapbackend/domain/admin/feed/controller/FeedAdminControllerTest.java @@ -30,6 +30,8 @@ import org.springframework.test.web.servlet.ResultActions; import com.depromeet.breadmapbackend.domain.admin.Admin; +import com.depromeet.breadmapbackend.domain.admin.carousel.domain.CarouselManager; +import com.depromeet.breadmapbackend.domain.admin.carousel.domain.CarouselType; import com.depromeet.breadmapbackend.domain.admin.category.domain.Category; import com.depromeet.breadmapbackend.domain.admin.feed.domain.CurationBakery; import com.depromeet.breadmapbackend.domain.admin.feed.domain.CurationFeed; @@ -209,6 +211,7 @@ public void setDown() { categoryRepository.deleteAllInBatch(); userRepository.deleteAllInBatch(); adminRepository.deleteAllInBatch(); + carouselRepository.deleteAllInBatch(); } @Test @@ -355,6 +358,15 @@ public void setDown() { void 큐레이션피드_수정_테스트() throws Exception { //given + final CarouselManager carouselManager = CarouselManager.builder() + .targetId(curation.getId()) + .carouseled(true) + .carouselType(CarouselType.CURATION) + .bannerImage(customAWSS3Properties.getCloudFront() + "/" + "productImage.jpg") + .carouselOrder(1) + .build(); + + carouselRepository.save(carouselManager); CommonFeedRequestDto updateCommon = CommonFeedRequestDto.builder() .subTitle("업데이트된 큐레이션 테스트 피드") diff --git a/src/test/java/com/depromeet/breadmapbackend/utils/ControllerTest.java b/src/test/java/com/depromeet/breadmapbackend/utils/ControllerTest.java index c1a21170..e0d5af2a 100644 --- a/src/test/java/com/depromeet/breadmapbackend/utils/ControllerTest.java +++ b/src/test/java/com/depromeet/breadmapbackend/utils/ControllerTest.java @@ -22,6 +22,7 @@ import com.depromeet.breadmapbackend.domain.admin.AdminRepository; import com.depromeet.breadmapbackend.domain.admin.AdminService; +import com.depromeet.breadmapbackend.domain.admin.carousel.repository.CarouselRepository; import com.depromeet.breadmapbackend.domain.admin.category.repository.CategoryRepository; import com.depromeet.breadmapbackend.domain.admin.category.service.CategoryService; import com.depromeet.breadmapbackend.domain.admin.feed.repository.CurationBakeryRepository; @@ -227,6 +228,9 @@ public abstract class ControllerTest { @Autowired DataSource dataSource; + @Autowired + protected CarouselRepository carouselRepository; + @BeforeEach void beforeEach() throws Exception {