From 52da6fc8b1f2880af1e26b5827ed6ce0eb527b84 Mon Sep 17 00:00:00 2001 From: dong_yxxn Date: Thu, 14 Nov 2024 22:03:33 +0900 Subject: [PATCH] =?UTF-8?q?[refactor]:=20=EB=8B=A4=EB=A5=B8=20repository?= =?UTF-8?q?=20=EC=9D=98=EC=A1=B4=EC=84=B1=EC=9D=84=20=EC=A0=9C=EA=B1=B0?= =?UTF-8?q?=ED=96=88=EC=8A=B5=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 관련 이슈: #172 --- .../review/persistence/ReviewRepositoryTest.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/test/java/team7/inplace/review/persistence/ReviewRepositoryTest.java b/src/test/java/team7/inplace/review/persistence/ReviewRepositoryTest.java index 2f59fd24..6b8ce3fe 100644 --- a/src/test/java/team7/inplace/review/persistence/ReviewRepositoryTest.java +++ b/src/test/java/team7/inplace/review/persistence/ReviewRepositoryTest.java @@ -15,12 +15,10 @@ import org.springframework.transaction.annotation.Transactional; import team7.inplace.config.annotation.CustomRepositoryTest; import team7.inplace.place.domain.Place; -import team7.inplace.place.persistence.PlaceRepository; import team7.inplace.review.domain.Review; import team7.inplace.user.domain.Role; import team7.inplace.user.domain.User; import team7.inplace.user.domain.UserType; -import team7.inplace.user.persistence.UserRepository; @CustomRepositoryTest @Transactional @@ -32,11 +30,6 @@ class ReviewRepositoryTest { @Autowired private ReviewRepository reviewRepository; - @Autowired - private PlaceRepository placeRepository; - - @Autowired - private UserRepository userRepository; @BeforeEach void init() { @@ -82,15 +75,15 @@ void init() { @Test @DirtiesContext @DisplayName("like true false test") - void checkLikedDisliked() { + public void checkLikedDisliked() { //given // init() //when int likes = reviewRepository.countByPlaceIdAndIsLikedTrue( - placeRepository.findById(1L).get().getId()); + 1L); int dislikes = reviewRepository.countByPlaceIdAndIsLikedFalse( - placeRepository.findById(1L).get().getId()); + 1L); //then assertThat(likes).isEqualTo(3);