From b1756b775f8f7bd44e3a6d1ac460ed9fa7fba5b4 Mon Sep 17 00:00:00 2001
From: Jonghyeon Moon <109948801+MoonJongHyeon1095@users.noreply.github.com>
Date: Fri, 22 Sep 2023 14:21:46 +0900
Subject: [PATCH 01/10] =?UTF-8?q?docs:=20=EB=A6=AC=EB=93=9C=EB=AF=B8=20?=
=?UTF-8?q?=EA=B8=B0=EC=88=A0=EB=B1=83=EC=A7=80=20=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/README.md b/README.md
index 2d08eab..b00dddb 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,15 @@
# BE
+
+
tech stack
+
+
+
+
+
+
+
+
+
+
+
+
From c6009c66ac7b1bc2a6b99fb2f5c9153b6e76474c Mon Sep 17 00:00:00 2001
From: MoonJongHyeon1095 <109948801+MoonJongHyeon1095@users.noreply.github.com>
Date: Tue, 26 Sep 2023 21:16:27 +0900
Subject: [PATCH 02/10] =?UTF-8?q?refactor:=20=EC=9E=84=EC=8B=9C=EB=A1=9C?=
=?UTF-8?q?=20=EA=B5=AC=ED=98=84=ED=96=88=EB=8D=98=20orderTag=20=EC=83=81?=
=?UTF-8?q?=ED=83=9C=EA=B4=80=EB=A6=AC=20=EC=84=9C=EB=B2=84=EC=97=90?=
=?UTF-8?q?=EC=84=9C=20=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20?=
=?UTF-8?q?test:=20cartService=20=EC=BB=A4=EB=B2=84=EB=A6=AC=EC=A7=80=2010?=
=?UTF-8?q?0%,=20orderService=20=EC=BB=A4=EB=B2=84=EB=A6=AC=EC=A7=80=2033%?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
build.gradle | 4 +
.../commerce/service/cart/CartService.java | 13 -
.../commerce/service/order/OrderService.java | 29 +--
.../service/order/util/OrderCacheMethod.java | 22 ++
.../web/controller/order/OrderController.java | 90 +++----
.../commerce/CommerceApplicationTests.java | 4 +
.../service/cart/CartServiceTest.java | 240 ++++++++++++++++++
.../service/order/OrderServiceTest.java | 159 ++++++++++++
src/test/resources/application-test.yml | 69 +++++
9 files changed, 557 insertions(+), 73 deletions(-)
create mode 100644 src/main/java/com/github/commerce/service/order/util/OrderCacheMethod.java
create mode 100644 src/test/java/com/github/commerce/service/cart/CartServiceTest.java
create mode 100644 src/test/java/com/github/commerce/service/order/OrderServiceTest.java
create mode 100644 src/test/resources/application-test.yml
diff --git a/build.gradle b/build.gradle
index c78b6e4..544c347 100644
--- a/build.gradle
+++ b/build.gradle
@@ -58,6 +58,10 @@ dependencies {
// Spring Batch
implementation 'org.springframework.boot:spring-boot-starter-batch'
testImplementation 'org.springframework.batch:spring-batch-test'
+
+ //h2
+ testImplementation 'com.h2database:h2'
+
}
tasks.named('test') {
diff --git a/src/main/java/com/github/commerce/service/cart/CartService.java b/src/main/java/com/github/commerce/service/cart/CartService.java
index ff5adbb..6b289bf 100644
--- a/src/main/java/com/github/commerce/service/cart/CartService.java
+++ b/src/main/java/com/github/commerce/service/cart/CartService.java
@@ -4,7 +4,6 @@
import com.github.commerce.entity.Product;
import com.github.commerce.entity.User;
import com.github.commerce.repository.cart.CartRepository;
-import com.github.commerce.repository.product.ProductRepository;
import com.github.commerce.service.cart.util.ValidatCartMethod;
import com.github.commerce.web.dto.cart.CartDto;
import com.github.commerce.web.dto.cart.CartRmqDto;
@@ -21,9 +20,6 @@
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -36,7 +32,6 @@ public class CartService {
private final CartRepository cartRepository;
private final ValidatCartMethod validatCartMethod;
private final RabbitTemplate rabbitTemplate;
- private final ProductRepository productRepository;
@Transactional(readOnly = true)
public List