File tree Expand file tree Collapse file tree
apps/commerce-api/src/test/java/com/loopers/infrastructure/pg Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020class 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 );
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments