diff --git a/src/test/java/com/example/demo/AccountTest.java b/src/test/java/com/example/demo/AccountTest.java index 22070337..87d8ad4a 100644 --- a/src/test/java/com/example/demo/AccountTest.java +++ b/src/test/java/com/example/demo/AccountTest.java @@ -1,6 +1,7 @@ package com.example.demo; import com.example.demo.config.errors.exception.Exception404; +import com.example.demo.user.Role; import com.example.demo.user.User; import com.example.demo.user.UserJPARepository; import org.assertj.core.api.Assertions; @@ -10,6 +11,8 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; +import java.time.LocalDate; + @SpringBootTest @ActiveProfiles("test") public class AccountTest { @@ -27,7 +30,7 @@ void test() { .firstName("Jin") .lastName("Seung") .country("Korea") - .age(21) + .birthDate(LocalDate.of(1990, 1, 1)) .role(Role.MENTOR) .phone("010-0000-0000") .build(); diff --git a/src/test/java/com/example/demo/VideoTest.java b/src/test/java/com/example/demo/VideoTest.java index 2cd79abd..5a61ab9d 100644 --- a/src/test/java/com/example/demo/VideoTest.java +++ b/src/test/java/com/example/demo/VideoTest.java @@ -2,6 +2,7 @@ import com.example.demo.interest.Interest; import com.example.demo.interest.InterestJPARepository; +import com.example.demo.user.Role; import com.example.demo.user.User; import com.example.demo.user.UserJPARepository; import com.example.demo.user.userInterest.UserInterest; @@ -14,6 +15,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; +import java.time.LocalDate; import java.util.ArrayList; import java.util.List; @@ -53,7 +55,7 @@ void save() { .firstName("Jin") .lastName("Seung") .country("Korea") - .age(21) + .birthDate(LocalDate.of(1990, 1, 1)) .role(Role.MENTOR) .phone("010-0000-0000") .build(); @@ -296,7 +298,7 @@ void HistoryTest() throws Exception{ .firstName("Jin") .lastName("Seung") .country("Korea") - .age(21) + .birthDate(LocalDate.of(1990, 1, 1)) .role(Role.MENTOR) .phone("010-0000-0000") .build(); @@ -328,7 +330,7 @@ void videoPostTest() throws Exception{ .firstName("Jin") .lastName("Seung") .country("Korea") - .age(21) + .birthDate(LocalDate.of(1990, 1, 1)) .role(Role.ADMIN) .phone("010-0000-0000") .build(); diff --git a/src/test/java/com/example/demo/mentoringtest/MentoringTest2.java b/src/test/java/com/example/demo/mentoringtest/MentoringTest2.java index d9f13e2e..2bfdf0dd 100644 --- a/src/test/java/com/example/demo/mentoringtest/MentoringTest2.java +++ b/src/test/java/com/example/demo/mentoringtest/MentoringTest2.java @@ -1,6 +1,7 @@ package com.example.demo.mentoringtest; import com.example.demo.RestDoc; +import com.example.demo.config.errors.exception.Exception400; import com.example.demo.mentoring.*; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.DisplayName; @@ -156,7 +157,7 @@ void MentoringTestDetails() throws Exception { // pid 에 해당하는 게시글 조회 MentorPost mentorPost = mentorPostJPARepostiory.findById(pid).orElseThrow( - () -> new Exception400("해당 게시글이 없습니다.")); + () -> new Exception400(null, "해당 게시글이 없습니다.")); // 데이터 확인 System.out.println(mentorPost.getTitle()); @@ -218,7 +219,7 @@ void MentoringTestDone() throws Exception { // pid 에 해당하는 게시글 조회 MentorPost mentorPost = mentorPostJPARepostiory.findById(pid).orElseThrow( - () -> new Exception400("해당 게시글이 없습니다.")); + () -> new Exception400(null, "해당 게시글이 없습니다.")); System.out.println(mentorPost.getState()); @@ -255,7 +256,7 @@ void MentoringTest2() throws Exception { // pid 에 해당하는 게시글 조회 MentorPost mentorPost = mentorPostJPARepostiory.findById(pid).orElseThrow( - () -> new Exception400("해당 게시글이 없습니다.")); + () -> new Exception400(null, "해당 게시글이 없습니다.")); // 데이터 확인 System.out.println(mentorPost.getTitle());