Skip to content

Commit

Permalink
add url in Checkout response (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcarrero authored Dec 15, 2022
1 parent 46c4256 commit 7e065e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/main/java/conekta/io/model/impl/Checkout.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package conekta.io.model.impl;

import conekta.io.model.ConektaObject;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class Checkout extends ConektaObject {
private String url;
}
13 changes: 7 additions & 6 deletions src/test/java/conekta/io/client/impl/OrdersClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void generateAuthenticator() {
}

@Test
void createOrder() throws URISyntaxException, IOException, InterruptedException {
void createOrder() throws URISyntaxException, IOException {
// Arrange
String orderRequestJson = Utils.readFile("orders/order.json");
String orderResponseJson = Utils.readFile("orders/orderResponse.json");
Expand All @@ -47,10 +47,11 @@ void createOrder() throws URISyntaxException, IOException, InterruptedException

// Assert
Assertions.assertEquals(order.getData(), orderResp);
Assertions.assertEquals("https://pay.stg.conekta.io/checkout/0652bd0014f04cc281490a43a37fcadd", orderResp.getCheckout().getUrl());
}

@Test
void createOrderFail() throws URISyntaxException, IOException, InterruptedException {
void createOrderFail() throws URISyntaxException, IOException {
// Arrange
String orderRequestJson = Utils.readFile("orders/order.json");
String orderResponseFailJson = Utils.readFile("orders/orderCreateResponseFail.json");
Expand All @@ -68,7 +69,7 @@ void createOrderFail() throws URISyntaxException, IOException, InterruptedExcept
}

@Test
void updateOrder() throws IOException, InterruptedException, URISyntaxException {
void updateOrder() throws IOException, URISyntaxException {
String orderUpdateRequest = Utils.readFile("orders/orderUpdateRequest.json");
String orderJsonModified = Utils.readFile("orders/orderModified.json");
OrderReq orderReq = ConektaObjectMapper.getInstance().stringJsonToObject(orderUpdateRequest, OrderReq.class);
Expand All @@ -86,7 +87,7 @@ void updateOrder() throws IOException, InterruptedException, URISyntaxException
}

@Test
void updateOrderFail() throws IOException, InterruptedException, URISyntaxException {
void updateOrderFail() throws IOException, URISyntaxException {
// Arrange
String orderRequestJson = Utils.readFile("orders/order.json");
String orderUpdateRespFailJson = Utils.readFile("orders/orderUpdateResponseFail.json");
Expand All @@ -104,7 +105,7 @@ void updateOrderFail() throws IOException, InterruptedException, URISyntaxExcept
}

@Test
void getOrder() throws IOException, InterruptedException, URISyntaxException {
void getOrder() throws IOException, URISyntaxException {
String orderJson = Utils.readFile("orders/orderResponse.json");
Order order = ConektaObjectMapper.getInstance().stringJsonToObject(orderJson, Order.class);

Expand Down Expand Up @@ -218,7 +219,7 @@ void getOrdersFail() throws IOException, URISyntaxException {
}

@Test
void refundOrder() throws URISyntaxException, IOException, InterruptedException {
void refundOrder() throws URISyntaxException, IOException {
// Arrange
String orderRefundRequestJson = Utils.readFile("orders/orderRefundRequest.json");
String orderRefundResponseJson = Utils.readFile("orders/orderRefundResponse.json");
Expand Down

0 comments on commit 7e065e9

Please sign in to comment.