-
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.
Merge pull request #178 from TrainingDiary/fix/ffmpeg-video
동영상 업로드 수정
- Loading branch information
Showing
5 changed files
with
73 additions
and
58 deletions.
There are no files selected for viewing
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
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
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
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 |
---|---|---|
|
@@ -34,7 +34,6 @@ spring: | |
static: | ||
s3: | ||
bucket: | ||
temp-bucket: | ||
stack: | ||
auto: false | ||
|
||
|
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 |
---|---|---|
|
@@ -771,8 +771,6 @@ void testUploadWorkoutImageSuccess() throws IOException { | |
); | ||
|
||
List<MultipartFile> capturedFiles = fileCaptor.getAllValues(); | ||
List<String> capturedKeys = keyCaptor.getAllValues(); | ||
List<String> capturedExtensions = extensionCaptor.getAllValues(); | ||
List<Integer> capturedWidths = widthCaptor.getAllValues(); | ||
|
||
assertEquals("test.jpg", capturedFiles.get(0).getOriginalFilename()); | ||
|
@@ -904,8 +902,7 @@ void testUploadWorkoutImageFailInvalidFileType() throws IOException { | |
|
||
@Test | ||
@DisplayName("동영상 업로드 성공") | ||
public void testUploadWorkoutVideoSuccess() | ||
throws IOException, InterruptedException { | ||
public void testUploadWorkoutVideoSuccess() throws IOException, InterruptedException { | ||
Authentication authentication = new TestingAuthenticationToken("[email protected]", null, | ||
Collections.singletonList(new SimpleGrantedAuthority("ROLE_TRAINER"))); | ||
SecurityContextHolder.getContext().setAuthentication(authentication); | ||
|
@@ -923,10 +920,8 @@ public void testUploadWorkoutVideoSuccess() | |
.video(video).build(); | ||
|
||
String originalUrl = "https://test-bucket.s3.amazonaws.com/original"; | ||
String thumbnailUrl = "https://test-bucket.s3.amazonaws.com/thumb"; | ||
|
||
when(s3VideoProvider.uploadVideo(eq(video), anyString())).thenReturn(originalUrl); | ||
when(s3VideoProvider.uploadThumbnail(eq(originalUrl), anyString())).thenReturn(thumbnailUrl); | ||
|
||
WorkoutVideoResponseDto response = workoutSessionService.uploadWorkoutVideo(videoRequestDto); | ||
|
||
|
@@ -937,7 +932,6 @@ public void testUploadWorkoutVideoSuccess() | |
assertEquals("VIDEO", savedMedia.getMediaType().name()); | ||
|
||
verify(s3VideoProvider, times(1)).uploadVideo(eq(video), anyString()); | ||
verify(s3VideoProvider, times(1)).uploadThumbnail(eq(originalUrl), anyString()); | ||
|
||
ArgumentCaptor<WorkoutSessionEntity> sessionCaptor = ArgumentCaptor | ||
.forClass(WorkoutSessionEntity.class); | ||
|