Skip to content

Commit

Permalink
refactor: 레포지토리 테스트 커스텀 어노테이션 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
wonslee authored and K-Diger committed Feb 13, 2024
1 parent a441350 commit 268dd85
Showing 1 changed file with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase.Replace;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.context.annotation.Import;
import org.springframework.data.domain.Slice;
import usw.suwiki.domain.evaluatepost.domain.EvaluatePost;
import usw.suwiki.domain.evaluatepost.fixture.EvaluatePostFixture;
Expand All @@ -28,14 +22,9 @@
import usw.suwiki.domain.user.fixture.UserFixture;
import usw.suwiki.domain.user.user.User;
import usw.suwiki.domain.user.user.repository.UserRepository;
import usw.suwiki.global.config.TestJpaConfig;

// TODO: RepositoryTest 슈퍼 클래스로 공통 설정 상속
// TODO refactor: 테스트 독립성 보장. TRUNCATE 실행
@DataJpaTest
@Import(TestJpaConfig.class)
@TestMethodOrder(MethodOrderer.DisplayName.class)
@AutoConfigureTestDatabase(replace = Replace.NONE)
import usw.suwiki.global.annotation.SuwikiJpaTest;

@SuwikiJpaTest
public class LectureRepositoryTest { // TODO: https://7357.tistory.com/339 보면서 동시성 테스트하는 방법 공부
@Autowired
private LectureRepository lectureRepository;
Expand Down

0 comments on commit 268dd85

Please sign in to comment.