Skip to content

Commit

Permalink
ci: 브랜치 최신화 과정에서 누락된 사항 추가 및 충돌 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonyj1022 committed Oct 14, 2023
1 parent 1de428f commit 9f1d791
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import com.ddang.ddang.image.domain.ProfileImage;
import com.ddang.ddang.user.domain.Reliability;
import com.ddang.ddang.user.domain.User;
import com.ddang.ddang.user.domain.repository.UserRepository;
import com.ddang.ddang.user.infrastructure.persistence.JpaUserRepository;
import com.ddang.ddang.user.infrastructure.persistence.UserRepositoryImpl;
import com.querydsl.jpa.impl.JPAQueryFactory;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -31,17 +33,12 @@
@SuppressWarnings("NonAsciiCharacters")
public class ChatRoomAndImageRepositoryImplFixture {

@Autowired
private JPAQueryFactory queryFactory;

@Autowired
private JpaAuctionRepository jpaAuctionRepository;
private AuctionRepository auctionRepository;

@Autowired
private JpaCategoryRepository categoryRepository;

@Autowired
private JpaUserRepository userRepository;
private UserRepository userRepository;

@Autowired
private JpaBidRepository bidRepository;
Expand All @@ -52,7 +49,13 @@ public class ChatRoomAndImageRepositoryImplFixture {
protected ChatRoom 채팅방;

@BeforeEach
void fixtureSetUp(@Autowired final JpaChatRoomRepository jpaChatRoomRepository) {
void fixtureSetUp(
@Autowired final JPAQueryFactory jpaQueryFactory,
@Autowired final JpaAuctionRepository jpaAuctionRepository,
@Autowired final JpaUserRepository jpaUserRepository,
@Autowired final JpaChatRoomRepository jpaChatRoomRepository) {
auctionRepository = new AuctionRepositoryImpl(jpaAuctionRepository, new QuerydslAuctionRepository(jpaQueryFactory));
userRepository = new UserRepositoryImpl(jpaUserRepository);
chatRoomRepository = new ChatRoomRepositoryImpl(jpaChatRoomRepository);

final Category 전자기기_카테고리 = new Category("전자기기");
Expand Down Expand Up @@ -85,16 +88,14 @@ void fixtureSetUp(@Autowired final JpaChatRoomRepository jpaChatRoomRepository)

경매_대표_이미지 = new AuctionImage("경매_대표_이미지.png", "경매_대표_이미지.png");
채팅방 = new ChatRoom(경매, 구매자);

final AuctionRepository auctionRepository = new AuctionRepositoryImpl(
jpaAuctionRepository,
new QuerydslAuctionRepository(queryFactory)
);
auctionRepository.save(경매);

전자기기_카테고리.addSubCategory(전자기기_서브_노트북_카테고리);
categoryRepository.save(전자기기_카테고리);
userRepository.saveAll(List.of(판매자, 구매자));

userRepository.save(판매자);
userRepository.save(구매자);

경매.addAuctionImages(List.of(경매_대표_이미지, 대표_이미지가_아닌_경매_이미지));
bidRepository.save(입찰);
경매.updateLastBid(입찰);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import com.ddang.ddang.image.domain.ProfileImage;
import com.ddang.ddang.user.domain.Reliability;
import com.ddang.ddang.user.domain.User;
import com.ddang.ddang.user.domain.repository.UserRepository;
import com.ddang.ddang.user.infrastructure.persistence.JpaUserRepository;
import com.ddang.ddang.user.infrastructure.persistence.UserRepositoryImpl;
import com.querydsl.jpa.impl.JPAQueryFactory;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -33,17 +35,12 @@
@SuppressWarnings("NonAsciiCharacters")
public class ChatRoomAndMessageAndImageRepositoryImplFixture {

@Autowired
private JPAQueryFactory queryFactory;

@Autowired
private JpaAuctionRepository jpaAuctionRepository;
private AuctionRepository auctionRepository;

@Autowired
private JpaCategoryRepository categoryRepository;

@Autowired
private JpaUserRepository userRepository;
private UserRepository userRepository;

@Autowired
private JpaBidRepository bidRepository;
Expand All @@ -65,7 +62,14 @@ public class ChatRoomAndMessageAndImageRepositoryImplFixture {
protected Message 엔초가_지토에게_5시에_보낸_쪽지;

@BeforeEach
void fixtureSetUp(@Autowired final JpaChatRoomRepository jpaChatRoomRepository) {
void fixtureSetUp(
@Autowired final JPAQueryFactory jpaQueryFactory,
@Autowired final JpaAuctionRepository jpaAuctionRepository,
@Autowired final JpaUserRepository jpaUserRepository,
@Autowired final JpaChatRoomRepository jpaChatRoomRepository
) {
auctionRepository = new AuctionRepositoryImpl(jpaAuctionRepository, new QuerydslAuctionRepository(jpaQueryFactory));
userRepository = new UserRepositoryImpl(jpaUserRepository);
chatRoomRepository = new ChatRoomRepositoryImpl(jpaChatRoomRepository);

final Category 전자기기_카테고리 = new Category("전자기기");
Expand Down Expand Up @@ -178,17 +182,15 @@ void fixtureSetUp(@Autowired final JpaChatRoomRepository jpaChatRoomRepository)
전자기기_카테고리.addSubCategory(전자기기_서브_노트북_카테고리);
categoryRepository.save(전자기기_카테고리);

userRepository.saveAll(List.of(메리, 엔초, 제이미, 지토));
userRepository.save(메리);
userRepository.save(엔초);
userRepository.save(제이미);
userRepository.save(지토);

메리의_경매.addAuctionImages(List.of(메리의_경매_대표_이미지, 메리의_대표_이미지가_아닌_경매_이미지));
엔초의_경매.addAuctionImages(List.of(엔초의_경매_대표_이미지, 엔초의_대표_이미지가_아닌_경매_이미지));
제이미의_경매.addAuctionImages(List.of(제이미의_경매_대표_이미지, 제이미의_대표_이미지가_아닌_경매_이미지));

final AuctionRepository auctionRepository = new AuctionRepositoryImpl(
jpaAuctionRepository,
new QuerydslAuctionRepository(queryFactory)
);

auctionRepository.save(메리의_경매);
auctionRepository.save(엔초의_경매);
auctionRepository.save(제이미의_경매);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import com.ddang.ddang.image.domain.ProfileImage;
import com.ddang.ddang.user.domain.Reliability;
import com.ddang.ddang.user.domain.User;
import com.ddang.ddang.user.domain.repository.UserRepository;
import com.ddang.ddang.user.infrastructure.persistence.JpaUserRepository;
import com.ddang.ddang.user.infrastructure.persistence.UserRepositoryImpl;
import com.querydsl.jpa.impl.JPAQueryFactory;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -34,8 +36,7 @@ public class ChatRoomRepositoryImplFixture {
@Autowired
private JpaCategoryRepository categoryRepository;

@Autowired
private JpaUserRepository userRepository;
private UserRepository userRepository;

private AuctionRepository auctionRepository;

Expand All @@ -55,9 +56,11 @@ public class ChatRoomRepositoryImplFixture {
void fixtureSetUp(
@Autowired final JPAQueryFactory queryFactory,
@Autowired final JpaAuctionRepository jpaAuctionRepository,
@Autowired final JpaUserRepository jpaUserRepository,
@Autowired final JpaChatRoomRepository jpaChatRoomRepository
) {
auctionRepository = new AuctionRepositoryImpl(jpaAuctionRepository, new QuerydslAuctionRepository(queryFactory));
userRepository = new UserRepositoryImpl(jpaUserRepository);
chatRoomRepository = new ChatRoomRepositoryImpl(jpaChatRoomRepository);

final Category 전자기기_카테고리 = new Category("전자기기");
Expand Down Expand Up @@ -95,7 +98,8 @@ void fixtureSetUp(
전자기기_카테고리.addSubCategory(전자기기_서브_노트북_카테고리);
categoryRepository.save(전자기기_카테고리);

userRepository.saveAll(List.of(판매자, 구매자));
userRepository.save(판매자);
userRepository.save(구매자);

경매.addAuctionImages(List.of(경매이미지1, 경매이미지2));
auctionRepository.save(경매);
Expand Down

0 comments on commit 9f1d791

Please sign in to comment.