Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add url in Checkout response #36

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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