|
3 | 3 | import com.clubber.ClubberServer.domain.recruit.domain.RecruitType; |
4 | 4 | import com.clubber.ClubberServer.domain.recruit.dto.PostRecruitRequest; |
5 | 5 | import com.clubber.ClubberServer.domain.recruit.dto.UpdateRecruitRequest; |
| 6 | +import java.time.LocalDateTime; |
| 7 | +import java.time.format.DateTimeFormatter; |
6 | 8 | import java.util.List; |
7 | 9 |
|
8 | 10 | public class RecruitFixture { |
9 | 11 |
|
| 12 | + private static final LocalDateTime startAt = LocalDateTime.parse("2025-07-10 00:00", |
| 13 | + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| 14 | + |
| 15 | + private static final LocalDateTime endAt1 = LocalDateTime.parse("2025-07-25 23:59", |
| 16 | + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| 17 | + |
| 18 | + private static final LocalDateTime endAt2 = LocalDateTime.parse("2025-07-01 23:59", |
| 19 | + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")); |
| 20 | + |
10 | 21 | // 모집글 작성 테스트 데이터 |
11 | 22 | public static final PostRecruitRequest VALID_RECRUIT_POST_REQUEST = new PostRecruitRequest( |
12 | | - "title", RecruitType.REGULAR, "content", "linkedUrl", |
| 23 | + "title", RecruitType.REGULAR, startAt, endAt1, "content", |
| 24 | + "applyLink", |
13 | 25 | List.of("imagekey1", "imagekey2"), false); |
14 | 26 |
|
15 | 27 | // 모집글 title 유효성 검사 |
16 | 28 | public static final PostRecruitRequest NULL_TITLE_RECRUIT_POST_REQUEST = new PostRecruitRequest( |
17 | | - null, RecruitType.REGULAR, "content", "linkedUrl", |
| 29 | + null, RecruitType.REGULAR, startAt, endAt1, "content", |
| 30 | + "applyLink", |
18 | 31 | List.of("imagekey1", "imagekey2"), false); |
19 | 32 |
|
20 | 33 | public static final PostRecruitRequest EMPTY_TITLE_RECRUIT_POST_REQUEST = new PostRecruitRequest( |
21 | | - "", RecruitType.REGULAR, "content", "linkedUrl", |
22 | | - List.of("imagekey1", "imagekey2"),false); |
| 34 | + "", RecruitType.REGULAR, startAt, endAt1, "content", |
| 35 | + "applyLink", |
| 36 | + List.of("imagekey1", "imagekey2"), false); |
23 | 37 |
|
24 | 38 | public static final PostRecruitRequest SPACE_TITLE_RECRUIT_POST_REQUEST = new PostRecruitRequest( |
25 | | - " ", RecruitType.REGULAR, "content", "linkedUrl", |
26 | | - List.of("imagekey1", "imagekey2"),false); |
| 39 | + " ", RecruitType.REGULAR, startAt, endAt1, "content", |
| 40 | + "applyLink", |
| 41 | + List.of("imagekey1", "imagekey2"), false); |
27 | 42 |
|
28 | 43 | // 모집글 content 유효성 검사 |
29 | 44 | public static final PostRecruitRequest NULL_CONTENT_RECRUIT_POST_REQUEST = new PostRecruitRequest( |
30 | | - "title", RecruitType.REGULAR, null, "linkedUrl", |
31 | | - List.of("imagekey1", "imagekey2"),false); |
| 45 | + "", RecruitType.REGULAR, startAt, endAt1, null, |
| 46 | + "applyLink", |
| 47 | + List.of("imagekey1", "imagekey2"), false); |
32 | 48 |
|
33 | 49 | public static final PostRecruitRequest EMPTY_CONTENT_RECRUIT_POST_REQUEST = new PostRecruitRequest( |
34 | | - "title", RecruitType.REGULAR, "", "linkedUrl", |
35 | | - List.of("imagekey1", "imagekey2"),false); |
| 50 | + "", RecruitType.REGULAR, startAt, endAt1, "", |
| 51 | + "applyLink", |
| 52 | + List.of("imagekey1", "imagekey2"), false); |
36 | 53 |
|
37 | 54 | public static final PostRecruitRequest SPACE_CONTENT_RECRUIT_POST_REQUEST = new PostRecruitRequest( |
38 | | - "title", RecruitType.REGULAR, " ", "linkedUrl", |
39 | | - List.of("imagekey1", "imagekey2"),false); |
40 | | - |
| 55 | + "", RecruitType.REGULAR, startAt, endAt1, " ", |
| 56 | + "applyLink", |
| 57 | + List.of("imagekey1", "imagekey2"), false); |
41 | 58 | // 모집글 수정 테이스 데이터 |
42 | 59 |
|
43 | 60 | // 성공 데이터 |
44 | 61 | public static final UpdateRecruitRequest VALID_UPDATE_RECRUIT_REQUEST = new UpdateRecruitRequest( |
45 | | - "newTitle", RecruitType.REGULAR, "newContent", "newLinkedUrl", false, List.of("https://image.ssuclubber.com/image2"), |
| 62 | + "newTitle", RecruitType.REGULAR, startAt, endAt1, "newContent", "newApplyLink", false, |
| 63 | + List.of("https://image.ssuclubber.com/image2"), |
46 | 64 | List.of("newImage1", "newImage2"), List.of("https://image.ssuclubber.com/image1"), |
47 | 65 | List.of("newImage2", "https://image.ssuclubber.com/image1", "newImage1")); |
48 | 66 |
|
49 | 67 | public static final UpdateRecruitRequest UPDATE_NO_IMAGE_RECRUIT_REQUEST = new UpdateRecruitRequest( |
50 | | - "newTitle", RecruitType.REGULAR, "newContent", "newLinkedUrl", false, List.of(), |
| 68 | + "newTitle", RecruitType.REGULAR, startAt, endAt1, "newContent", "newLinkedUrl", false, |
| 69 | + List.of(), |
51 | 70 | List.of("newImage1", "newImage2"), List.of(), |
52 | 71 | List.of("newImage2", "newImage1")); |
53 | 72 |
|
54 | 73 | // 실패 데이터 |
55 | 74 |
|
56 | 75 | // 존재하지 않는 이미지 삭제 처리 |
57 | 76 | public static final UpdateRecruitRequest INVALID_DELETE_IMAGE_RECRUIT_REQUEST = new UpdateRecruitRequest( |
58 | | - "newTitle", RecruitType.REGULAR, "newContent","newLinkedUrl", false, |
| 77 | + "newTitle", RecruitType.REGULAR, startAt, endAt1, "newContent", "newLinkedUrl", false, |
59 | 78 | List.of("https://image.ssuclubber.com/image1", "https://image.ssuclubber.com/image3"), |
60 | 79 | List.of("newImage1", "newImage2"), List.of("https://image.ssuclubber.com/image1"), |
61 | 80 | List.of("newImage2", "https://image.ssuclubber.com/image1", "newImage1")); |
62 | 81 |
|
63 | 82 | // 존재하지 않는 이미지에 대해 유지 처리 |
64 | 83 | public static final UpdateRecruitRequest REMAIN_NOT_EXIST_RECRUIT_REQUEST = new UpdateRecruitRequest( |
65 | | - "newTitle", RecruitType.REGULAR, "newContent", "newEverytimeUrl", false, |
| 84 | + "newTitle", RecruitType.REGULAR, startAt, endAt1, "newContent", "newEverytimeUrl", false, |
66 | 85 | List.of("https://image.ssuclubber.com/image2"), |
67 | 86 | List.of("newImage1", "newImage2"), |
68 | 87 | List.of("https://image.ssuclubber.com/image1", "https://image.ssuclubber.com/image3"), |
69 | 88 | List.of("newImage2", "https://image.ssuclubber.com/image1", "newImage1")); |
70 | 89 |
|
71 | 90 | // 삭제할 이미지와 유지할 이미지 중복 지정 |
72 | 91 | public static final UpdateRecruitRequest REMAIN_DELETE_DUPLICATED_RECRUIT_REQUEST = new UpdateRecruitRequest( |
73 | | - "newTitle", RecruitType.REGULAR, "newContent","newEverytimeUrl", false, |
| 92 | + "newTitle", RecruitType.REGULAR, startAt, endAt1, "newContent", "newEverytimeUrl", false, |
74 | 93 | List.of("https://image.ssuclubber.com/image1"), |
75 | 94 | List.of("newImage1", "newImage2"), List.of("https://image.ssuclubber.com/image1"), |
76 | 95 | List.of("newImage2", "https://image.ssuclubber.com/image1", "newImage1")); |
77 | 96 |
|
78 | 97 | // 추가 데이터와 최종 데이터 불일치 |
79 | 98 | public static final UpdateRecruitRequest NEW_FINAL_IMAGE_DIFFERENT_RECRUIT_REQUEST = new UpdateRecruitRequest( |
80 | | - "newTitle", RecruitType.REGULAR,"newContent","newEverytimeUrl", false, |
| 99 | + "newTitle", RecruitType.REGULAR, startAt, endAt1, "newContent", "newEverytimeUrl", false, |
81 | 100 | List.of(), |
82 | 101 | List.of("newImage1", "newImage2"), List.of(), |
83 | 102 | List.of("newImage2", "newImage3")); |
84 | 103 |
|
85 | 104 | public static final UpdateRecruitRequest NEW_NOT_IN_FINAL_IMAGE_RECRUIT_REQUEST = new UpdateRecruitRequest( |
86 | | - "newTitle", RecruitType.REGULAR,"newContent","newEverytimeUrl",false, |
| 105 | + "newTitle", RecruitType.REGULAR, startAt, endAt1, "newContent", "newEverytimeUrl", false, |
87 | 106 | List.of(), |
88 | 107 | List.of("newImage1", "newImage2", "newImage3"), List.of(), |
89 | 108 | List.of("newImage2", "newImage1")); |
90 | 109 |
|
| 110 | + // 마감일이 시작일보다 앞서는 경우 |
| 111 | + public static final UpdateRecruitRequest ENDAT_EARLIER_THAN_STARTAT_RECRUIT_REQUEST = new UpdateRecruitRequest( |
| 112 | + "newTitle", RecruitType.REGULAR, startAt, endAt2, "newContent", "newApplyLink", false, |
| 113 | + List.of("https://image.ssuclubber.com/image2"), |
| 114 | + List.of("newImage1", "newImage2"), List.of("https://image.ssuclubber.com/image1"), |
| 115 | + List.of("newImage2", "https://image.ssuclubber.com/image1", "newImage1")); |
| 116 | + |
91 | 117 |
|
92 | 118 | } |
0 commit comments