Skip to content

Commit

Permalink
Merge pull request #42 from WE-ARE-RACCOONS/RAC-146
Browse files Browse the repository at this point in the history
RAC-146 fix : λ¦¬νŒ©ν† λ§μ— μ˜ν•œ ν…ŒμŠ€νŠΈμ½”λ“œ μˆ˜μ •
  • Loading branch information
ywj9811 authored Nov 12, 2023
2 parents ff5a776 + 8febd69 commit d6c8ff4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.postgraduate.domain.mentoring.domain.entity.Mentoring;
import com.postgraduate.domain.mentoring.domain.service.MentoringGetService;
import com.postgraduate.domain.user.domain.entity.Hope;
import com.postgraduate.domain.user.domain.entity.User;
import com.postgraduate.domain.user.domain.entity.constant.Role;
import com.postgraduate.global.exception.ApplicationException;
Expand Down Expand Up @@ -29,9 +30,11 @@ class CheckIsMyMentoringUseCaseTest {
User user;
@BeforeEach
void setUser() {
Hope hope = new Hope("computer","ai", true);
user = new User(100000000L, 12345L, "test.com",
"test", "test.png", 0, Role.USER,
LocalDate.now(), LocalDate.now());
"test", "test.png", "01012341234", 0, Role.USER, hope,
LocalDate.now(), LocalDate.now());

}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.postgraduate.domain.senior.domain.entity.Senior;
import com.postgraduate.domain.senior.domain.entity.constant.Status;
import com.postgraduate.domain.senior.domain.service.SeniorGetService;
import com.postgraduate.domain.user.domain.entity.Hope;
import com.postgraduate.domain.user.domain.entity.User;
import com.postgraduate.domain.user.domain.entity.constant.Role;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -34,11 +35,12 @@ public class SeniorMyPageUseCaseTest {
private User testUser;
@BeforeEach
void setSenior() {
Hope hope = new Hope("computer","ai", true);
testUser = new User(100000000L, 12345L, "test.com",
"test", "test.png", 0, Role.USER,
"test", "test.png", "01012341234", 0, Role.USER, hope,
LocalDate.now(), LocalDate.now());
Account account = new Account("account", "bank", "123");
Profile profile = new Profile("info", "you", "abc", "1000", 10);
Profile profile = new Profile("info", "hello", "keyword", "you", "abc", "1000", 10);
Info info = new Info("c", "m", "p", "p", "a", "f");
testSenior = Senior.builder()
.seniorId(100000000L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import com.postgraduate.domain.senior.domain.entity.Profile;
import com.postgraduate.domain.senior.domain.entity.Senior;
import com.postgraduate.domain.senior.domain.entity.constant.Status;
import com.postgraduate.domain.user.domain.entity.Hope;
import com.postgraduate.domain.user.domain.entity.User;
import com.postgraduate.domain.user.domain.entity.constant.Role;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -57,19 +59,12 @@ class SeniorControllerTest {

@BeforeEach
public void setUp(final WebApplicationContext context) throws Exception {
testUser = User.builder()
.userId(1000000000L)
.socialId(1000000000L)
.email("test.com")
.role(USER)
.nickName("test")
.profile("test")
.point(0)
.createdAt(LocalDate.now())
.updatedAt(LocalDate.now())
.build();
Hope hope = new Hope("computer","ai", true);
testUser = new User(100000000L, 12345L, "test.com",
"test", "test.png", "01012341234", 0, Role.USER, hope,
LocalDate.now(), LocalDate.now());
Account account = new Account("account", "bank", "123");
Profile profile = new Profile("info", "you", "abc", "1000", 10);
Profile profile = new Profile("info", "hello", "keyword", "you", "abc", "1000", 10);
Info info = new Info("c", "m", "p", "p", "a", "f");
testSenior = Senior.builder()
.seniorId(100000000L)
Expand Down Expand Up @@ -114,7 +109,7 @@ void signUpSenior() throws Exception {
@DisplayName("λŒ€ν•™μ›μƒ ν”„λ‘œν•„ 등둝")
void signUpSeniorWithProfile() throws Exception {
//given
SeniorProfileRequest seniorProfileRequest = new SeniorProfileRequest("test", "test", "test", "test");
SeniorProfileRequest seniorProfileRequest = new SeniorProfileRequest("test", "test", "test", "test","test","test");
String body = objectMapper.writeValueAsString(seniorProfileRequest);

//when
Expand Down Expand Up @@ -202,7 +197,7 @@ void getInfo() throws Exception {
@DisplayName("λŒ€ν•™μ›μƒ ν”„λ‘œν•„ 정보")
void getProfile() throws Exception {
//given
Profile profile = new Profile("test", "test", "test", "test", 10);
Profile profile = new Profile("test", "test", "test", "test","test","test", 10);
SeniorProfileResponse seniorProfileResponse = new SeniorProfileResponse(profile, "ac", "ba");
given(seniorMyPageUseCase.getSeniorProfile(any()))
.willReturn(seniorProfileResponse);
Expand Down Expand Up @@ -232,7 +227,7 @@ void getProfile() throws Exception {
void updateProfile() throws Exception {
//given
SeniorProfileAndAccountRequest request = new SeniorProfileAndAccountRequest(
"test","test","test","test","test","test","test"
"test","test","test","test","test","test","test","test"
);
String body = objectMapper.writeValueAsString(request);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.postgraduate.domain.user.application.usecase;

import com.postgraduate.domain.user.application.dto.res.UserInfoResponse;
import com.postgraduate.domain.user.domain.entity.Hope;
import com.postgraduate.domain.user.domain.entity.User;
import com.postgraduate.domain.user.domain.entity.constant.Role;
import com.postgraduate.domain.user.domain.service.UserGetService;
Expand Down Expand Up @@ -28,8 +29,9 @@ public class UserMyPageUseCaseTest {
private User testUser;
@BeforeEach
void setTestUser() {
Hope hope = new Hope("computer","ai", true);
testUser = new User(100000000L, 12345L, "test.com",
"test", "test.png", 0, Role.USER,
"test", "test.png", "01012341234", 0, Role.USER, hope,
LocalDate.now(), LocalDate.now());
}

Expand Down

0 comments on commit d6c8ff4

Please sign in to comment.