File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/test/java/br/com/grupo63/techchallenge/payment Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -30,18 +30,18 @@ class PaymentIntegrationTest {
30
30
31
31
@ Mock
32
32
private PaymentJpaRepository paymentJpaRepository ;
33
-
34
- @ InjectMocks
35
- private PaymentJpaAdapter paymentJpaAdapter ;
36
- @ Mock
37
- private PaymentUseCase paymentUseCase ;
38
33
@ Mock
39
34
private IOrderGateway orderGateway ;
40
35
@ Mock
41
36
private MercadoPagoGateway mercadoPagoGateway ;
37
+
38
+ @ InjectMocks
39
+ private PaymentJpaAdapter paymentJpaAdapter ;
40
+ private PaymentUseCase paymentUseCase ;
42
41
private PaymentController paymentController ;
43
42
private PaymentAPIController paymentAPIController ;
44
43
44
+
45
45
private final Long defaultOrderId = 1L ;
46
46
private final String qrData = UUID .randomUUID ().toString ();
47
47
private final Double totalPrice = 100.00 ;
@@ -63,6 +63,7 @@ void setUp() {
63
63
public void testGetPaymentStatus_EndToEnd () {
64
64
when (paymentJpaRepository .findByOrderId (defaultOrderId )).thenReturn (Optional .of (defaultPaymentPersistenceEntity ));
65
65
when (orderGateway .getOrderById (defaultOrderId )).thenReturn (Optional .of (orderDTO ));
66
+ when (mercadoPagoGateway .generateQRCode (defaultOrderId , totalPrice )).thenReturn (qrData );
66
67
67
68
ResponseEntity <PaymentStatusResponseDTO > response = paymentAPIController .getStatusByOrderId (defaultOrderId );
68
69
assertEquals (HttpStatus .OK , response .getStatusCode ());
You can’t perform that action at this time.
0 commit comments