Skip to content

Commit cb3fca3

Browse files
committed
Fix: 파일 조회/수정 응답메시지 변경
- 기존: imageUrl = "S3 퍼블릭 URL" - 변경: publicURL = "S3 퍼블릭 URL"
1 parent ed1c240 commit cb3fca3

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/main/java/com/back/domain/file/dto/FileReadResponseDto.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
@Data
66
public class FileReadResponseDto {
7-
private String imageUrl;
7+
private String publicURL;
88

9-
public FileReadResponseDto(String imageUrl) {
10-
this.imageUrl = imageUrl;
9+
public FileReadResponseDto(String publicURL) {
10+
this.publicURL = publicURL;
1111
}
1212
}

src/main/java/com/back/domain/file/dto/FileUploadResponseDto.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
@Data
66
public class FileUploadResponseDto {
77
private Long attachmentId;
8-
private String imageUrl;
8+
private String publicURL;
99

10-
public FileUploadResponseDto(Long attachmentId, String imageUrl) {
10+
public FileUploadResponseDto(Long attachmentId, String publicURL) {
1111
this.attachmentId = attachmentId;
12-
this.imageUrl = imageUrl;
12+
this.publicURL = publicURL;
1313
}
1414
}

src/test/java/com/back/domain/file/service/FileServiceTest.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ void uploadFile() {
7373

7474
// then
7575
assertThat(res.getAttachmentId()).isPositive();
76-
assertThat(res.getImageUrl()).contains(path);
77-
assertThat(res.getImageUrl()).contains(dirName);
76+
assertThat(res.getPublicURL()).contains(path);
77+
assertThat(res.getPublicURL()).contains(dirName);
7878
}
7979

8080
@Test
@@ -95,8 +95,8 @@ void readFile() {
9595
FileReadResponseDto res = fileService.getFile(attachmentId);
9696

9797
// then
98-
assertThat(res.getImageUrl()).contains(path);
99-
assertThat(res.getImageUrl()).contains(dirName);
98+
assertThat(res.getPublicURL()).contains(path);
99+
assertThat(res.getPublicURL()).contains(dirName);
100100
}
101101

102102
@Test
@@ -123,8 +123,8 @@ void updateFile() {
123123
FileReadResponseDto res = fileService.getFile(attachmentId);
124124

125125
// then
126-
assertThat(res.getImageUrl()).contains(newPath);
127-
assertThat(res.getImageUrl()).contains(newDirName);
126+
assertThat(res.getPublicURL()).contains(newPath);
127+
assertThat(res.getPublicURL()).contains(newDirName);
128128
}
129129

130130
@Test
@@ -138,7 +138,6 @@ void deleteFile() {
138138
// 기존(삭제할) 파일 정보
139139
String path = "test.png";
140140
String contentType = "image/png";
141-
String dirName = "test";
142141
MockMultipartFile oldFile = new MockMultipartFile("test", path, contentType, "test".getBytes());
143142
Long attachmentId = fileService.uploadFile(oldFile, user.getId()).getAttachmentId();
144143

0 commit comments

Comments
 (0)