Skip to content

Commit

Permalink
[refactor]: 다른 repository 의존성을 제거했습니다.
Browse files Browse the repository at this point in the history
관련 이슈: #172
  • Loading branch information
dong-yxxn committed Nov 14, 2024
1 parent 8c9fa61 commit 52da6fc
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,11 +30,6 @@ class ReviewRepositoryTest {
@Autowired
private ReviewRepository reviewRepository;

@Autowired
private PlaceRepository placeRepository;

@Autowired
private UserRepository userRepository;

@BeforeEach
void init() {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 52da6fc

Please sign in to comment.