Skip to content

Commit

Permalink
✅ [STMT-146] 파일 업로드 서비스 통합 테스트 케이스 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
05AM committed Apr 3, 2024
1 parent 8b98981 commit 15d1018
Showing 1 changed file with 36 additions and 0 deletions.
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();
}
}
}

0 comments on commit 15d1018

Please sign in to comment.