Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,4 @@ private void validateChildCategory(Category category) {
throw new BaseCustomException(ClothErrorCode.PARENT_CATEGORY_CLOTH);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
@Schema(description = "기록 생성 요청")
public record HistoryCreateRequest(
@Size(max = 120, message = "기록의 내용은 최대 120자까지 가능합니다.")
@NotBlank(message = "기록의 내용은 비워둘 수 없습니다.")
@Schema(
description = "기록의 내용",
example = "안녕 오늘 오지게 덥다 ㄷㄷ;; 근데 한달 뒤면 가을임 벌써 가을 기대 만발ㅋ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,37 +82,6 @@ class 기록_생성_요청_시 {
.andExpect(jsonPath("$.result.historyId").value(1L));
}

@ParameterizedTest
@NullSource
@EmptySource
@ValueSource(strings = {" "})
void 내용이_null_또는_공백이면_예외가_발생한다(String content) throws Exception {
HistoryCreateRequest request =
new HistoryCreateRequest(
content,
1L,
List.of(1L, 2L),
List.of("testHashtag1", "testHashtag2"),
List.of(
new HistoryCreateRequest.Payload(
"testUrl",
List.of(
new HistoryCreateRequest.ClothTag(
1L, 0.42, 0.73)))));

ResultActions perform =
mockMvc.perform(
post("/histories")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)));

perform.andExpect(status().isBadRequest())
.andExpect(jsonPath("$.isSuccess").value(false))
.andExpect(jsonPath("$.code").value("COMMON400"))
.andExpect(jsonPath("$.message").value("잘못된 요청입니다."))
.andExpect(jsonPath("$.result.content").value("기록의 내용은 비워둘 수 없습니다."));
}

@Test
void 내용이_120자를_초과하면_예외가_발생한다() throws Exception {
String longContent = "a".repeat(121);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.amazonaws.HttpMethod;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.Headers;
import com.amazonaws.services.s3.model.*;
import java.util.Date;
import java.util.List;
Expand Down