File tree Expand file tree Collapse file tree
main/java/org/clokey/domain
test/java/org/clokey/domain/history/controller
clokey-infrastructure/src/main/java/org/clokey/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -244,4 +244,4 @@ private void validateChildCategory(Category category) {
244244 throw new BaseCustomException (ClothErrorCode .PARENT_CATEGORY_CLOTH );
245245 }
246246 }
247- }
247+ }
Original file line number Diff line number Diff line change 99@ Schema (description = "기록 생성 요청" )
1010public record HistoryCreateRequest (
1111 @ Size (max = 120 , message = "기록의 내용은 최대 120자까지 가능합니다." )
12- @ NotBlank (message = "기록의 내용은 비워둘 수 없습니다." )
1312 @ Schema (
1413 description = "기록의 내용" ,
1514 example = "안녕 오늘 오지게 덥다 ㄷㄷ;; 근데 한달 뒤면 가을임 벌써 가을 기대 만발ㅋ" )
Original file line number Diff line number Diff line change @@ -82,37 +82,6 @@ class 기록_생성_요청_시 {
8282 .andExpect (jsonPath ("$.result.historyId" ).value (1L ));
8383 }
8484
85- @ ParameterizedTest
86- @ NullSource
87- @ EmptySource
88- @ ValueSource (strings = {" " })
89- void 내용이_null_또는_공백이면_예외가_발생한다 (String content ) throws Exception {
90- HistoryCreateRequest request =
91- new HistoryCreateRequest (
92- content ,
93- 1L ,
94- List .of (1L , 2L ),
95- List .of ("testHashtag1" , "testHashtag2" ),
96- List .of (
97- new HistoryCreateRequest .Payload (
98- "testUrl" ,
99- List .of (
100- new HistoryCreateRequest .ClothTag (
101- 1L , 0.42 , 0.73 )))));
102-
103- ResultActions perform =
104- mockMvc .perform (
105- post ("/histories" )
106- .contentType (MediaType .APPLICATION_JSON )
107- .content (objectMapper .writeValueAsString (request )));
108-
109- perform .andExpect (status ().isBadRequest ())
110- .andExpect (jsonPath ("$.isSuccess" ).value (false ))
111- .andExpect (jsonPath ("$.code" ).value ("COMMON400" ))
112- .andExpect (jsonPath ("$.message" ).value ("잘못된 요청입니다." ))
113- .andExpect (jsonPath ("$.result.content" ).value ("기록의 내용은 비워둘 수 없습니다." ));
114- }
115-
11685 @ Test
11786 void 내용이_120자를_초과하면_예외가_발생한다 () throws Exception {
11887 String longContent = "a" .repeat (121 );
Original file line number Diff line number Diff line change 33import com .amazonaws .HttpMethod ;
44import com .amazonaws .SdkClientException ;
55import com .amazonaws .services .s3 .AmazonS3 ;
6- import com .amazonaws .services .s3 .Headers ;
76import com .amazonaws .services .s3 .model .*;
87import java .util .Date ;
98import java .util .List ;
You can’t perform that action at this time.
0 commit comments