Skip to content

Commit 440d9d3

Browse files
committed
add: PG 테스트 케이스 수정 및 주문 API http 테스트 추가
1 parent 24ffdcc commit 440d9d3

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

apps/commerce-api/src/test/java/com/loopers/infrastructure/pg/LoopersPgExecutorTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@
2020
class LoopersPgExecutorTest {
2121

2222
@Mock
23-
private PgClient pgClient; // 가짜 PG 클라이언트
23+
private PgClient pgClient;
2424

2525
@InjectMocks
26-
private LoopersPgExecutor loopersPgExecutor; // 테스트 대상
26+
private LoopersPgExecutor loopersPgExecutor;
2727

2828
@Test
2929
@DisplayName("PG 승인 요청이 성공하면 트랜잭션 키를 반환한다")
3030
void execute_success() {
3131
// given
32-
// 1. 테스트용 결제 정보 가짜 생성 (필요한 필드만 Mocking하거나 객체 생성)
3332
Payment mockPayment = org.mockito.Mockito.mock(Payment.class);
3433
given(mockPayment.getTransactionId()).willReturn("ORDER-123");
3534
given(mockPayment.getCardType()).willReturn(com.loopers.domain.payment.CardType.SAMSUNG);

http/commerce-api/order-v1.http

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### 주문 생성 및 결제 요청
2+
POST {{commerce-api}}/api/v1/orders
3+
Content-Type: application/json
4+
X-USER-ID: 1
5+
6+
{
7+
"orderItems": [
8+
{
9+
"productId": 1,
10+
"quantity": 2
11+
},
12+
{
13+
"productId": 2,
14+
"quantity": 1
15+
}
16+
],
17+
"cardType": "KB",
18+
"cardNo": "1234-1234-1234-1234"
19+
}

0 commit comments

Comments
 (0)