Skip to content

Commit 400c798

Browse files
committed
feat: presigned url 이미지 업로드 방식 추가
- presigned 이미지 업로드 방식 구현 - 테스트및 검증완료
1 parent 92a2ea5 commit 400c798

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/test/java/com/somemore/global/imageupload/validator/DefaultImageUploadValidatorTest.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,43 @@ void shouldThrowExceptionWhenFileTypeIsNull() {
9393
// then
9494
assertEquals(ImageUploadException.class, exception.getClass());
9595
}
96+
97+
@Test
98+
@DisplayName("파일 이름이 비어있는지 확인할 수 있다.")
99+
void shouldReturnTrueWhenFileNameIsEmpty() {
100+
// given
101+
String emptyFileName = "";
102+
103+
// when
104+
boolean isEmptyFileName = imageUploadValidator.isEmptyFileName(emptyFileName);
105+
106+
// then
107+
assertThat(isEmptyFileName).isTrue();
108+
}
109+
110+
@Test
111+
@DisplayName("파일 이름이 null이면 true를 반환한다.")
112+
void shouldReturnTrueWhenFileNameIsNull() {
113+
// given
114+
String nullFileName = null;
115+
116+
// when
117+
boolean isEmptyFileName = imageUploadValidator.isEmptyFileName(nullFileName);
118+
119+
// then
120+
assertThat(isEmptyFileName).isTrue();
121+
}
122+
123+
@Test
124+
@DisplayName("파일 이름이 비어있지 않으면 false를 반환한다.")
125+
void shouldReturnFalseWhenFileNameIsNotEmpty() {
126+
// given
127+
String validFileName = "testImage.jpg";
128+
129+
// when
130+
boolean isEmptyFileName = imageUploadValidator.isEmptyFileName(validFileName);
131+
132+
// then
133+
assertThat(isEmptyFileName).isFalse();
134+
}
96135
}

0 commit comments

Comments
 (0)