@@ -15,29 +15,35 @@ public class StoreFileReader {
     public static final String PRODUCTS_DATA = "src/main/resources/products.md";
     public static final String PROMOTIONS_DATA = "src/main/resources/promotions.md";
 
-    public Map<String, Product> product(Map<String, Promotion> promotions) {
-        Map<String, Product> products = new LinkedHashMap<>();
-        try (BufferedReader br = new BufferedReader(
-                new InputStreamReader(new FileInputStream(PRODUCTS_DATA)))) {
-            String line = br.readLine();
-            while ((line = br.readLine()) != null) {
-                String[] product = line.split(",");
-                String productName = product[0];
-                if (products.containsKey(productName)) { // 두번째로 들어오는 건 무조건 일반 재고
-                    Product p = products.get(productName);
-                    int quantity = Integer.parseInt(product[2]);
-                    p.add(quantity);
-                }
-                products.computeIfAbsent(productName, (k) -> convertProduct(product, promotions));
-
-            }
+    public static Map<String, Product> product(Map<String, Promotion> promotions) {
+        try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(PRODUCTS_DATA)))) {
+            return getProductMap(promotions, br);
         } catch (IOException e) {
             throw new RuntimeException("Failed to read the file.", e);
         }
+    }
+
+    private static Map<String, Product> getProductMap(Map<String, Promotion> promotions, BufferedReader br)
+            throws IOException {
+        Map<String, Product> products = new LinkedHashMap<>();
+        String line = br.readLine();
+        while ((line = br.readLine()) != null) {
+            String[] product = line.split(",");
+            String productName = product[0];
+            addProduct(products, productName, product);
+            products.computeIfAbsent(productName, (k) -> convertProduct(product, promotions));
+        }
         return products;
     }
 
-    private Product convertProduct(String[] product, Map<String, Promotion> promotions) {
+    private static void addProduct(Map<String, Product> products, String productName, String[] product) {
+        if (products.containsKey(productName)) {
+            Product p = products.get(productName);
+            p.add(Integer.parseInt(product[2]));
+        }
+    }
+
+    private static Product convertProduct(String[] product, Map<String, Promotion> promotions) {
         String name = product[0];
         int price = Integer.parseInt(product[1]);
         int quantity = Integer.parseInt(product[2]);
@@ -52,23 +58,28 @@ private static boolean isPromotion(String[] product) {
         return !product[3].equals("null");
     }
 
-    public Map<String, Promotion> promotions() {
-        Map<String, Promotion> promotions = new LinkedHashMap<>();
+    public static Map<String, Promotion> promotions() {
         try (BufferedReader br = new BufferedReader(
                 new InputStreamReader(new FileInputStream(PROMOTIONS_DATA)))) {
-            String line = br.readLine();
-            while ((line = br.readLine()) != null) {
-                String[] promotion = line.split(",");
-                String promotionName = promotion[0];
-                promotions.put(promotionName, convertPromotion(promotion));
-            }
+            return getPromotionMap(br);
         } catch (IOException e) {
             throw new RuntimeException("Failed to read the file.", e);
         }
+
+    }
+
+    private static Map<String, Promotion> getPromotionMap(BufferedReader br) throws IOException {
+        Map<String, Promotion> promotions = new LinkedHashMap<>();
+        String line = br.readLine();
+        while ((line = br.readLine()) != null) {
+            String[] promotion = line.split(",");
+            String promotionName = promotion[0];
+            promotions.put(promotionName, convertPromotion(promotion));
+        }
         return promotions;
     }
 
-    private Promotion convertPromotion(String[] promotion) {
+    private static Promotion convertPromotion(String[] promotion) {
         return new Promotion(promotion[0], Integer.parseInt(promotion[1]), Integer.parseInt(promotion[2]),
                 LocalDate.parse(promotion[3]), LocalDate.parse(promotion[4]));
     }

리뷰: - 인덱스 번호의 상수화가 이루어지면 좋을 것 같습니다.
- null과 같은 것들을 EMPTY와 같이 의미가 있도록 상수화를 진행하면 더 좋을 것 같습니다.
- Map으로 넣는 과정은 비즈니스 로직이나 데이터 저장 로직을 건드는 것 같습니다. List를 통해 request 데이터 형식으로 만든 후 비즈니스 로직을 담당하는 service나 데이터를 직접 건드는 repository에서 처리하는 것이 더 좋을 것 같습니다.