Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixture 관련 쿼리를 테스트 메서드 실행 전 호출할 수 있도록 로직 변경 #748

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import com.ddang.ddang.user.domain.Reliability;
import com.ddang.ddang.user.domain.User;
import com.ddang.ddang.user.domain.repository.UserRepository;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;

Expand All @@ -32,6 +34,9 @@ public class BidServiceFixture {
@Autowired
private BidRepository bidRepository;

@PersistenceContext
private EntityManager em;

protected NotificationStatus 알림_성공 = NotificationStatus.SUCCESS;
protected String 이미지_절대_url = "https://3-ddang.store/auctions/images";
protected Long 존재하지_않는_경매_아이디 = -999L;
Expand Down Expand Up @@ -166,5 +171,7 @@ void setUp() {
최소_입찰단위를_더한_금액보다_낮은_입찰액으로_입찰_요청_dto = new CreateBidDto(입찰_내역이_하나_있던_경매.getId(), 1_500, 입찰자2.getId());
범위_밖의_금액으로_입찰_요청_dto1 = new CreateBidDto(경매3.getId(), -1, 입찰자2.getId());
범위_밖의_금액으로_입찰_요청_dto2 = new CreateBidDto(경매3.getId(), 2_100_000_001, 입찰자2.getId());

em.flush();
}
}
Loading