File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/test/java/com/back/domain/file Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public class S3MockConfig {
2121
2222 @ Bean
2323 public S3Mock s3Mock () {
24- return new S3Mock .Builder ().withPort (0 ).withInMemoryBackend ().build ();
24+ return new S3Mock .Builder ().withPort (8001 ).withInMemoryBackend ().build ();
2525 }
2626
2727 @ Bean
Original file line number Diff line number Diff line change 88import com .back .domain .user .entity .UserStatus ;
99import com .back .domain .user .repository .UserRepository ;
1010import com .back .fixture .TestJwtTokenProvider ;
11+ import io .findify .s3mock .S3Mock ;
12+ import org .junit .jupiter .api .AfterEach ;
1113import org .junit .jupiter .api .DisplayName ;
1214import org .junit .jupiter .api .Test ;
1315import org .springframework .beans .factory .annotation .Autowired ;
@@ -37,6 +39,9 @@ class FileControllerTest {
3739 @ Autowired
3840 private MockMvc mvc ;
3941
42+ @ Autowired
43+ private S3Mock s3Mock ;
44+
4045 @ Autowired
4146 private UserRepository userRepository ;
4247
@@ -57,6 +62,11 @@ private String generateAccessToken(User user) {
5762 );
5863 }
5964
65+ @ AfterEach
66+ public void tearDown () {
67+ s3Mock .stop ();
68+ }
69+
6070 @ Test
6171 @ DisplayName ("파일 업로드 성공" )
6272 void uploadFile_success () throws Exception {
You can’t perform that action at this time.
0 commit comments