-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ [STMT-146] 파일 업로드 서비스 통합 테스트 케이스 작성
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/test/java/com/stumeet/server/file/application/service/FileUploadServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.stumeet.server.file.application.service; | ||
|
||
import static org.assertj.core.api.Assertions.*; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Nested; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
import com.stumeet.server.stub.MockMultipartFileStub; | ||
import com.stumeet.server.template.IntegrationTest; | ||
|
||
class FileUploadServiceTest extends IntegrationTest { | ||
|
||
@Autowired | ||
private FileUploadService fileUploadService; | ||
|
||
|
||
@Nested | ||
@DisplayName("[통합 테스트] 유저 프로필 이미지 파일 업로드") | ||
class UploadUserProfileImageFile { | ||
|
||
@Test | ||
@DisplayName("[성공] 유효한 파일이 주어졌을 때 파일 업로드에 성공한다.") | ||
void uploadUserProfileImage_success() { | ||
assertThatCode(() -> fileUploadService.uploadUserProfileImage(1L, MockMultipartFileStub.getJpegFile())) | ||
.doesNotThrowAnyException(); | ||
|
||
assertThatCode(() -> fileUploadService.uploadUserProfileImage(1L, MockMultipartFileStub.getJpgFile())) | ||
.doesNotThrowAnyException(); | ||
|
||
assertThatCode(() -> fileUploadService.uploadUserProfileImage(1L, MockMultipartFileStub.getPngFile())) | ||
.doesNotThrowAnyException(); | ||
} | ||
} | ||
} |