Skip to content

Commit

Permalink
RAC-403 fix : 변경 사항에 따른 테스트 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ywj9811 committed Jul 2, 2024
1 parent 6243e41 commit 27748a8
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void setting() {
1, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), FALSE);
wish = new Wish(1L, "major", "field", TRUE, user, Status.WAITING);
senior = new Senior(1L, user, "a",
APPROVE, 1, info, profile,
APPROVE,1, 1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.postgraduate.domain.senior.domain.entity.Info;
import com.postgraduate.domain.senior.domain.entity.Profile;
import com.postgraduate.domain.senior.domain.entity.Senior;
import com.postgraduate.domain.senior.domain.service.SeniorUpdateService;
import com.postgraduate.domain.user.domain.entity.User;
import com.postgraduate.global.bizppurio.application.usecase.BizppurioJuniorMessage;
import com.postgraduate.global.bizppurio.application.usecase.BizppurioSeniorMessage;
Expand Down Expand Up @@ -54,6 +55,8 @@ class MentoringApplyingUseTypeTest {
@Mock
private AccountGetService accountGetService;
@Mock
private SeniorUpdateService seniorUpdateService;
@Mock
private BizppurioSeniorMessage bizppurioSeniorMessage;
@Mock
private BizppurioJuniorMessage bizppurioJuniorMessage;
Expand All @@ -80,7 +83,7 @@ void setting() {
"a", "123", "a",
0, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE);
senior = new Senior(-1L, user, "a",
APPROVE, 1, info, profile,
APPROVE,1, 1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
salary = new Salary(-1L, FALSE, senior, 10000, LocalDate.now(), LocalDateTime.now(), null);
account = new Account(-1L, "1", "은행", "유저", senior);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.postgraduate.domain.senior.domain.entity.Profile;
import com.postgraduate.domain.senior.domain.entity.Senior;
import com.postgraduate.domain.senior.domain.service.SeniorGetService;
import com.postgraduate.domain.senior.domain.service.SeniorUpdateService;
import com.postgraduate.domain.user.domain.entity.User;
import com.postgraduate.global.bizppurio.application.usecase.BizppurioJuniorMessage;
import com.postgraduate.global.bizppurio.application.usecase.BizppurioSeniorMessage;
Expand Down Expand Up @@ -65,6 +66,8 @@ class MentoringManageUseTypeTest {
@Mock
private SeniorGetService seniorGetService;
@Mock
private SeniorUpdateService seniorUpdateService;
@Mock
private SalaryGetService salaryGetService;
@Mock
private SalaryUpdateService salaryUpdateService;
Expand Down Expand Up @@ -103,7 +106,7 @@ void setting() {
"a", "123", "a",
0, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE);
senior = new Senior(-1L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1, 1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
salary = new Salary(-1L, FALSE, senior, 10000, LocalDate.now(), LocalDateTime.now(), null);
account = new Account(-1L, "1", "은행", "유저", senior);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void setting() {
"a", "123", "a",
0, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE);
senior = new Senior(-1L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1, 1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
salary = new Salary(-1L, FALSE, senior, 10000, LocalDate.now(), LocalDateTime.now(), null);
payment = new Payment(-1L, mentoringUser, senior, 20000, "a", "a", "a", LocalDateTime.now(), null, Status.DONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void setting() {
"a", "123", "a",
0, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE);
senior = new Senior(-1L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1,1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
salary = new Salary(-1L, FALSE, senior, 10000, LocalDate.now(), LocalDateTime.now(), null);
payment = new Payment(-1L, mentoringUser, senior, 20000, "a", "a", "a", LocalDateTime.now(), null, Status.DONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void setting() {
"a", "123", "a",
0, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE);
senior = new Senior(-1L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1,1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void setting() {
"a", "12345", "a",
1, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE);
senior = new Senior(1L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1, 1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
}

Expand Down Expand Up @@ -92,7 +92,7 @@ void getSeniorDetail() {
@DisplayName("검색어 기본 페이지 조회")
void getSearchSeniorWithNull() {
Senior otherSenior = new Senior(-2L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1, 1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
List<Senior> seniors = List.of(senior, otherSenior);
Page<Senior> seniorPage = new PageImpl<>(seniors);
Expand All @@ -110,7 +110,7 @@ void getSearchSeniorWithNull() {
@DisplayName("검색어 페이지 조회")
void getSearchSeniorWithPage() {
Senior senior1 = new Senior(1L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1, 1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
List<Senior> seniors = List.of(senior, senior1);
Page<Senior> seniorPage = new PageImpl<>(seniors);
Expand All @@ -128,7 +128,7 @@ void getSearchSeniorWithPage() {
@DisplayName("필터 기본 페이지 조회")
void getFieldSeniorWithNull() {
Senior senior1 = new Senior(1L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1, 1,info, profile,
LocalDateTime.now(), LocalDateTime.now());
List<Senior> seniors = List.of(senior, senior1);
Page<Senior> seniorPage = new PageImpl<>(seniors);
Expand All @@ -146,7 +146,7 @@ void getFieldSeniorWithNull() {
@DisplayName("필터 페이지 조회")
void getFieldSeniorWithPage() {
Senior senior1 = new Senior(1L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1, 1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
List<Senior> seniors = List.of(senior, senior1);
Page<Senior> seniorPage = new PageImpl<>(seniors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void setting() {
"a", "123", "a",
1, SENIOR, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE);
senior = new Senior(1L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1, 1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ void setting() {
"a", "123", "a",
1, USER, TRUE, LocalDateTime.now(), LocalDateTime.now(), TRUE);
senior = new Senior(1L, user, "a",
APPROVE, 1, info, profile,
APPROVE, 1, 1, info, profile,
LocalDateTime.now(), LocalDateTime.now());
}

@Test
@DisplayName("Profile Null 선배 자신의 정보 조회")
void getSeniorInfoWithNullProfile() {
senior = new Senior(1L, user, "a", WAITING, 1, info, null, LocalDateTime.now(), LocalDateTime.now());
senior = new Senior(1L, user, "a", WAITING, 1, 1, info, null, LocalDateTime.now(), LocalDateTime.now());

given(seniorGetService.byUser(user))
.willReturn(senior);
Expand Down Expand Up @@ -121,7 +121,7 @@ void getSeniorMyPageProfile() {
@Test
@DisplayName("선배 자신의 마이페이지 프로필 작성 이전 Info조회 테스트")
void getSeniorMyPageProfileWithNull() {
Senior nullSenior = new Senior(-2L, user, "asd", APPROVE, 1, info, null, LocalDateTime.now(), null);
Senior nullSenior = new Senior(-2L, user, "asd", APPROVE, 1, 1, info, null, LocalDateTime.now(), null);
given(seniorGetService.byUser(user))
.willReturn(nullSenior);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SeniorUpdateServiceTest {
private Senior senior;
@BeforeEach
void setting() {
senior = new Senior(1L, user, "a", Status.WAITING, 100, new Info(), new Profile(), now(), now());
senior = new Senior(1L, user, "a", Status.WAITING, 1, 100, new Info(), new Profile(), now(), now());
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/postgraduate/support/Resource.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class Resource {
private User userOfSenior = new User(-2L, -2L, "mail", "선배", "012", "profile", 0, SENIOR, true, now(), now(), false);
private Info info = new Info("major", "서울대학교", "교수님", "키워드1,키워드2", "랩실", "인공지능", false, false, "인공지능,키워드1,키워드2", "chatLink", 30);
private Profile profile = new Profile("저는요", "한줄소개", "대상");
private Senior senior = new Senior(-1L, userOfSenior, "certification", com.postgraduate.domain.senior.domain.entity.constant.Status.WAITING, 0, info, profile, now(), now());
private Senior otherSenior = new Senior(-3L, otherUser, "certification", com.postgraduate.domain.senior.domain.entity.constant.Status.WAITING, 0, info, null, now(), now());
private Senior senior = new Senior(-1L, userOfSenior, "certification", com.postgraduate.domain.senior.domain.entity.constant.Status.WAITING, 0, 0, info, profile, now(), now());
private Senior otherSenior = new Senior(-3L, otherUser, "certification", com.postgraduate.domain.senior.domain.entity.constant.Status.WAITING, 0, 0, info, null, now(), now());
private SalaryAccount salaryAccount = new SalaryAccount("bank", "1234", "holder");
private Salary salary = new Salary(-1L, false, senior, 20000, getSalaryDate(), LocalDateTime.now(), salaryAccount);
private Payment payment = new Payment(-1L, user, senior, 20000, "1", "123", "123", LocalDateTime.now(), LocalDateTime.now(), DONE);
Expand Down

0 comments on commit 27748a8

Please sign in to comment.