From 9ab22aa690648de5d2fb2e9277e3f86b8856d6dc Mon Sep 17 00:00:00 2001 From: bokyeong Date: Tue, 15 Oct 2024 00:21:51 +0900 Subject: [PATCH] =?UTF-8?q?test:=20[#30]=20=EC=83=81=ED=92=88=20=EC=97=85?= =?UTF-8?q?=EB=A1=9C=EB=93=9C=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/service/ProductImageServiceTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/helpmeCookies/product/service/ProductImageServiceTest.java b/src/test/java/com/helpmeCookies/product/service/ProductImageServiceTest.java index c722d09..b0b3653 100644 --- a/src/test/java/com/helpmeCookies/product/service/ProductImageServiceTest.java +++ b/src/test/java/com/helpmeCookies/product/service/ProductImageServiceTest.java @@ -1,6 +1,7 @@ package com.helpmeCookies.product.service; import com.helpmeCookies.global.utils.AwsS3FileUtils; +import com.helpmeCookies.product.dto.FileUploadResponse; import com.helpmeCookies.product.entity.Category; import com.helpmeCookies.product.entity.Product; import com.helpmeCookies.product.repository.ProductImageRepository; @@ -16,6 +17,7 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Optional; @@ -56,10 +58,12 @@ void uploadMultiFiles() throws IOException { MockMultipartFile file2 = new MockMultipartFile("test2","img2.jpg","image/jpeg","image content".getBytes()); List files = Arrays.asList(file1,file2); - List expected = Arrays.asList("url1","url2"); + List expected = new ArrayList<>(); + expected.add(new FileUploadResponse("url1","1111")); + expected.add(new FileUploadResponse("url2","2222")); when(awsS3FileUtils.uploadMultiImages(files)).thenReturn(expected); - List actual = productImageService.uploadMultiFiles(1L,files); + List actual = productImageService.uploadMultiFiles(1L,files); assertEquals(2,actual.size(), "배열의 크기는 2여야함"); } }