Skip to content

Commit

Permalink
fix : 에러 수정
Browse files Browse the repository at this point in the history
Signed-off-by: Jin_00 <[email protected]>
  • Loading branch information
choboss00 committed Nov 7, 2023
1 parent cae7968 commit 257b4f5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/test/java/com/example/demo/AccountTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {
Expand All @@ -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();
Expand Down
8 changes: 5 additions & 3 deletions src/test/java/com/example/demo/VideoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 257b4f5

Please sign in to comment.