Skip to content

Commit

Permalink
Fix: DB clear 누락 추가
Browse files Browse the repository at this point in the history
- JPQL로 인한 flush 발생
  • Loading branch information
kwonssshyeon committed Nov 25, 2024
1 parent 6e7d6e3 commit 022c48a
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gdsc_knu.official_homepage.comment.repository;

import com.gdsc_knu.official_homepage.ClearDatabase;
import com.gdsc_knu.official_homepage.config.QueryDslConfig;
import com.gdsc_knu.official_homepage.entity.Member;
import com.gdsc_knu.official_homepage.entity.enumeration.Track;
Expand All @@ -22,10 +23,11 @@


@DataJpaTest
@Import({QueryDslConfig.class})
@Import({QueryDslConfig.class, ClearDatabase.class})
public class CommentRepositoryTest {
@Autowired private CommentRepository commentRepository;
@Autowired private TestEntityManager entityManager;
@Autowired private ClearDatabase clearDatabase;

private Member author;
private Post post;
Expand All @@ -45,6 +47,13 @@ void setUp() {
entityManager.persist(post);
}

@AfterEach
void tearDown() {
clearDatabase.each("comment");
clearDatabase.each("post");
clearDatabase.each("member");
}

@Test
@DisplayName("댓글의 순서가 올바르게 조회된다")
void findCommentAndReply() {
Expand Down

0 comments on commit 022c48a

Please sign in to comment.