diff --git a/src/test/java/webpayplus/OneclickMallDeferredTest.java b/src/test/java/webpayplus/OneclickMallDeferredTest.java index 15e79ea..3220d03 100644 --- a/src/test/java/webpayplus/OneclickMallDeferredTest.java +++ b/src/test/java/webpayplus/OneclickMallDeferredTest.java @@ -25,7 +25,7 @@ import static org.mockserver.integration.ClientAndServer.startClientAndServer; -public class OneclickMallDeferredTest extends OneclickMallTestBase { +class OneclickMallDeferredTest extends OneclickMallTestBase { private static String apiUrl = ApiConstants.ONECLICK_ENDPOINT; private static Options option = new WebpayOptions(IntegrationCommerceCodes.ONECLICK_MALL_DEFERRED, @@ -38,21 +38,21 @@ public class OneclickMallDeferredTest extends OneclickMallTestBase { private static String testToken = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; @BeforeAll - public static void startProxy() { + static void startProxy() { client = startClientAndServer(8888); } @AfterAll - public static void stopProxy() { + static void stopProxy() { client.stop(); } @AfterEach - public void resetMockServer() { + void resetMockServer() { client.reset(); } @Test - public void start() throws IOException, InscriptionStartException { + void start() throws IOException, InscriptionStartException { String url = String.format("/%s/inscriptions",apiUrl); String urlResponse = "https://webpay3gint.transbank.cl/webpayserver/bp_multicode_inscription.cgi"; @@ -72,7 +72,7 @@ public void start() throws IOException, InscriptionStartException { } @Test - public void finish() throws IOException, InscriptionFinishException { + void finish() throws IOException, InscriptionFinishException { String url = String.format("/%s/inscriptions/%s", apiUrl, testToken); byte responseCode = 0; @@ -100,21 +100,21 @@ public void finish() throws IOException, InscriptionFinishException { } @Test - public void delete() throws IOException, InscriptionDeleteException { + void delete() throws IOException, InscriptionDeleteException { String url = String.format("/%s/inscriptions", apiUrl); setResponseDelete(url); final boolean response = (new Oneclick.MallInscription(option)).delete(tbkUser, username); assertTrue(response); } @Test - public void deleteNotFound() throws IOException, InscriptionDeleteException { + void deleteNotFound() throws IOException, InscriptionDeleteException { String url = String.format("/%s/inscriptions", apiUrl); setResponseDeleteError(url, HttpStatusCode.NOT_FOUND_404); final boolean response = (new Oneclick.MallInscription(option)).delete(tbkUser, username); assertFalse(response); } @Test - public void authorize() throws IOException, TransactionAuthorizeException { + void authorize() throws IOException, TransactionAuthorizeException { OneclickMallTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions",apiUrl); setResponsePost(url, generateJsonResponse()); @@ -163,7 +163,7 @@ public void authorize() throws IOException, TransactionAuthorizeException { } @Test - public void refund() throws IOException, TransactionRefundException { + void refund() throws IOException, TransactionRefundException { String buyOrder = "1643997337"; String url = String.format("/%s/transactions/%s/refunds", apiUrl, buyOrder); @@ -185,7 +185,7 @@ public void refund() throws IOException, TransactionRefundException { } @Test - public void status() throws IOException, TransactionStatusException { + void status() throws IOException, TransactionStatusException { OneclickMallTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions/%s", apiUrl, expectedResponse.getBuyOrder()); setResponseGet(url, generateJsonResponse()); @@ -221,7 +221,7 @@ public void status() throws IOException, TransactionStatusException { } @Test - public void capture() throws IOException, TransactionCaptureException { + void capture() throws IOException, TransactionCaptureException { String url = String.format("/%s/transactions/capture",apiUrl); String authorizationCode = "138248"; diff --git a/src/test/java/webpayplus/OneclickMallTest.java b/src/test/java/webpayplus/OneclickMallTest.java index ea4f492..fcb2f77 100644 --- a/src/test/java/webpayplus/OneclickMallTest.java +++ b/src/test/java/webpayplus/OneclickMallTest.java @@ -24,7 +24,7 @@ import static org.junit.jupiter.api.Assertions.*; import static org.mockserver.integration.ClientAndServer.startClientAndServer; -public class OneclickMallTest extends OneclickMallTestBase { +class OneclickMallTest extends OneclickMallTestBase { private static String apiUrl = ApiConstants.ONECLICK_ENDPOINT; private static Options option = new WebpayOptions(IntegrationCommerceCodes.ONECLICK_MALL, @@ -37,22 +37,22 @@ public class OneclickMallTest extends OneclickMallTestBase { private static String testToken = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; @BeforeAll - public static void startProxy() { + static void startProxy() { client = startClientAndServer(8888); } @AfterAll - public static void stopProxy() { + static void stopProxy() { client.stop(); } @AfterEach - public void resetMockServer() { + void resetMockServer() { client.reset(); } @Test - public void start() throws IOException, InscriptionStartException { + void start() throws IOException, InscriptionStartException { String url = String.format("/%s/inscriptions",apiUrl); String urlResponse = "https://webpay3gint.transbank.cl/webpayserver/bp_multicode_inscription.cgi"; @@ -72,7 +72,7 @@ public void start() throws IOException, InscriptionStartException { } @Test - public void finish() throws IOException, InscriptionFinishException { + void finish() throws IOException, InscriptionFinishException { String url = String.format("/%s/inscriptions/%s", apiUrl, testToken); byte responseCode = 0; @@ -101,7 +101,7 @@ public void finish() throws IOException, InscriptionFinishException { } @Test - public void delete() throws IOException, InscriptionDeleteException { + void delete() throws IOException, InscriptionDeleteException { String url = String.format("/%s/inscriptions", apiUrl); setResponseDelete(url); final boolean response = (new Oneclick.MallInscription(option)).delete(tbkUser, username); @@ -109,14 +109,14 @@ public void delete() throws IOException, InscriptionDeleteException { } @Test - public void deleteNotFound() throws IOException, InscriptionDeleteException { + void deleteNotFound() throws IOException, InscriptionDeleteException { String url = String.format("/%s/inscriptions", apiUrl); setResponseDeleteError(url, HttpStatusCode.NOT_FOUND_404); final boolean response = (new Oneclick.MallInscription(option)).delete(tbkUser, username); assertFalse(response); } @Test - public void authorize() throws IOException, TransactionAuthorizeException { + void authorize() throws IOException, TransactionAuthorizeException { OneclickMallTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions",apiUrl); setResponsePost(url, generateJsonResponse()); @@ -165,7 +165,7 @@ public void authorize() throws IOException, TransactionAuthorizeException { } @Test - public void refund() throws IOException, TransactionRefundException { + void refund() throws IOException, TransactionRefundException { String buyOrder = "1643997337"; String url = String.format("/%s/transactions/%s/refunds", apiUrl, buyOrder); @@ -187,7 +187,7 @@ public void refund() throws IOException, TransactionRefundException { } @Test - public void status() throws IOException, TransactionStatusException { + void status() throws IOException, TransactionStatusException { OneclickMallTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions/%s", apiUrl, expectedResponse.getBuyOrder()); setResponseGet(url, generateJsonResponse()); diff --git a/src/test/java/webpayplus/PatpassComercioTest.java b/src/test/java/webpayplus/PatpassComercioTest.java index 6bffa16..df79fb4 100644 --- a/src/test/java/webpayplus/PatpassComercioTest.java +++ b/src/test/java/webpayplus/PatpassComercioTest.java @@ -26,7 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockserver.integration.ClientAndServer.startClientAndServer; -public class PatpassComercioTest extends TestBase { +class PatpassComercioTest extends TestBase { private static String apiUrl = ApiConstants.PATPASS_COMERCIO_ENDPOINT; private static Options option = new PatpassOptions(IntegrationCommerceCodes.PATPASS_COMERCIO, @@ -34,20 +34,20 @@ public class PatpassComercioTest extends TestBase { private static String testToken = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; @BeforeAll - public static void startProxy() { + static void startProxy() { client = startClientAndServer(8888); } @AfterAll - public static void stopProxy() { + static void stopProxy() { client.stop(); } @AfterEach - public void resetMockServer() { + void resetMockServer() { client.reset(); } @Test - public void start() throws IOException, InscriptionStartException { + void start() throws IOException, InscriptionStartException { String url = String.format("/%s/patInscription", apiUrl); @@ -97,7 +97,7 @@ public void start() throws IOException, InscriptionStartException { } @Test - public void status() throws IOException, TransactionStatusException { + void status() throws IOException, TransactionStatusException { String url = String.format("/%s/status", apiUrl); diff --git a/src/test/java/webpayplus/WebpayPlusDeferredTest.java b/src/test/java/webpayplus/WebpayPlusDeferredTest.java index 3b4a583..b3f2ab4 100644 --- a/src/test/java/webpayplus/WebpayPlusDeferredTest.java +++ b/src/test/java/webpayplus/WebpayPlusDeferredTest.java @@ -24,27 +24,27 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockserver.integration.ClientAndServer.startClientAndServer; -public class WebpayPlusDeferredTest extends WebpayPlusTestBase { +class WebpayPlusDeferredTest extends WebpayPlusTestBase { private static String apiUrl = ApiConstants.WEBPAY_ENDPOINT; private static Options option = new WebpayOptions(IntegrationCommerceCodes.WEBPAY_PLUS_DEFERRED, IntegrationApiKeys.WEBPAY, IntegrationType.SERVER_MOCK); private static String testToken = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; @BeforeAll - public static void startProxy() { + static void startProxy() { client = startClientAndServer(8888); } @AfterAll - public static void stopProxy() { + static void stopProxy() { client.stop(); } @AfterEach - public void resetMockServer() { + void resetMockServer() { client.reset(); } @Test - public void create() throws IOException, TransactionCreateException { + void create() throws IOException, TransactionCreateException { String url = String.format("/%s/transactions", apiUrl); String urlResponse = "https://webpay3gint.transbank.cl/webpayserver/initTransaction"; @@ -67,7 +67,7 @@ public void create() throws IOException, TransactionCreateException { } @Test - public void commit() throws IOException, TransactionCommitException { + void commit() throws IOException, TransactionCommitException { WebpayPlusTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions/%s", apiUrl, testToken); setResponsePut(url, generateCommitJsonResponse()); @@ -88,7 +88,7 @@ public void commit() throws IOException, TransactionCommitException { } @Test - public void refund() throws IOException, TransactionRefundException { + void refund() throws IOException, TransactionRefundException { String url = String.format("/%s/transactions/%s/refunds", apiUrl, testToken); double amount = 1000d; String type = "REVERSED"; @@ -105,7 +105,7 @@ public void refund() throws IOException, TransactionRefundException { } @Test - public void status() throws IOException, TransactionStatusException { + void status() throws IOException, TransactionStatusException { WebpayPlusTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions/%s", apiUrl, testToken); setResponseGet(url, generateCommitJsonResponse()); @@ -126,7 +126,7 @@ public void status() throws IOException, TransactionStatusException { } @Test - public void capture() throws IOException, TransactionCaptureException { + void capture() throws IOException, TransactionCaptureException { String url = String.format("/%s/transactions/%s/capture", apiUrl, testToken); String authorizationCode = "1213"; String authorizationDate = "2021-08-01T03:17:42.785Z"; diff --git a/src/test/java/webpayplus/WebpayPlusMallDeferredTest.java b/src/test/java/webpayplus/WebpayPlusMallDeferredTest.java index 4241812..dd9825e 100644 --- a/src/test/java/webpayplus/WebpayPlusMallDeferredTest.java +++ b/src/test/java/webpayplus/WebpayPlusMallDeferredTest.java @@ -22,7 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockserver.integration.ClientAndServer.startClientAndServer; -public class WebpayPlusMallDeferredTest extends WebpayPlusMallTestBase { +class WebpayPlusMallDeferredTest extends WebpayPlusMallTestBase { private static String apiUrl = ApiConstants.WEBPAY_ENDPOINT; private static Options option = new WebpayOptions(IntegrationCommerceCodes.WEBPAY_PLUS_MALL_DEFERRED, @@ -30,20 +30,20 @@ public class WebpayPlusMallDeferredTest extends WebpayPlusMallTestBase { private static String testToken = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; @BeforeAll - public static void startProxy() { + static void startProxy() { client = startClientAndServer(8888); } @AfterAll - public static void stopProxy() { + static void stopProxy() { client.stop(); } @AfterEach - public void resetMockServer() { + void resetMockServer() { client.reset(); } @Test - public void create() throws IOException, TransactionCreateException { + void create() throws IOException, TransactionCreateException { String url = String.format("/%s/transactions", apiUrl); @@ -78,7 +78,7 @@ public void create() throws IOException, TransactionCreateException { } @Test - public void commit() throws IOException, TransactionCommitException { + void commit() throws IOException, TransactionCommitException { WebpayPlusMallTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions/%s", apiUrl, testToken); setResponsePut(url, generateCommitJsonResponse()); @@ -117,7 +117,7 @@ public void commit() throws IOException, TransactionCommitException { @Test - public void refund() throws IOException, TransactionRefundException { + void refund() throws IOException, TransactionRefundException { String url = String.format("/%s/transactions/%s/refunds", apiUrl, testToken); String type = "REVERSED"; @@ -139,7 +139,7 @@ public void refund() throws IOException, TransactionRefundException { } @Test - public void status() throws IOException, TransactionStatusException { + void status() throws IOException, TransactionStatusException { WebpayPlusMallTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions/%s",apiUrl, testToken); setResponseGet(url, generateCommitJsonResponse()); @@ -177,7 +177,7 @@ public void status() throws IOException, TransactionStatusException { } @Test - public void capture() throws IOException, TransactionCaptureException { + void capture() throws IOException, TransactionCaptureException { String url = String.format("/%s/transactions/%s/capture", apiUrl, testToken); String commerceCode = "597055555537"; diff --git a/src/test/java/webpayplus/WebpayPlusMallTest.java b/src/test/java/webpayplus/WebpayPlusMallTest.java index 1ce0e97..a267521 100644 --- a/src/test/java/webpayplus/WebpayPlusMallTest.java +++ b/src/test/java/webpayplus/WebpayPlusMallTest.java @@ -25,7 +25,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockserver.integration.ClientAndServer.startClientAndServer; -public class WebpayPlusMallTest extends WebpayPlusMallTestBase { +class WebpayPlusMallTest extends WebpayPlusMallTestBase { private static String apiUrl = ApiConstants.WEBPAY_ENDPOINT; private static Options option = new WebpayOptions(IntegrationCommerceCodes.WEBPAY_PLUS_MALL, @@ -33,20 +33,20 @@ public class WebpayPlusMallTest extends WebpayPlusMallTestBase { private static String testToken = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; @BeforeAll - public static void startProxy() { + static void startProxy() { client = startClientAndServer(8888); } @AfterAll - public static void stopProxy() { + static void stopProxy() { client.stop(); } @AfterEach - public void resetMockServer() { + void resetMockServer() { client.reset(); } @Test - public void create() throws IOException, TransactionCreateException { + void create() throws IOException, TransactionCreateException { String url = String.format("/%s/transactions", apiUrl); @@ -81,7 +81,7 @@ public void create() throws IOException, TransactionCreateException { } @Test - public void commit() throws IOException, TransactionCommitException { + void commit() throws IOException, TransactionCommitException { WebpayPlusMallTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions/%s", apiUrl, testToken); setResponsePut(url, generateCommitJsonResponse()); @@ -120,7 +120,7 @@ public void commit() throws IOException, TransactionCommitException { @Test - public void refund() throws IOException, TransactionRefundException { + void refund() throws IOException, TransactionRefundException { String url = String.format("/%s/transactions/%s/refunds", apiUrl, testToken); String type = "REVERSED"; @@ -142,7 +142,7 @@ public void refund() throws IOException, TransactionRefundException { } @Test - public void status() throws IOException, TransactionStatusException { + void status() throws IOException, TransactionStatusException { WebpayPlusMallTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions/%s",apiUrl, testToken); setResponseGet(url, generateCommitJsonResponse()); diff --git a/src/test/java/webpayplus/WebpayPlusTest.java b/src/test/java/webpayplus/WebpayPlusTest.java index d9d3cad..a3c58e3 100644 --- a/src/test/java/webpayplus/WebpayPlusTest.java +++ b/src/test/java/webpayplus/WebpayPlusTest.java @@ -29,27 +29,27 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockserver.integration.ClientAndServer.startClientAndServer; -public class WebpayPlusTest extends WebpayPlusTestBase { +class WebpayPlusTest extends WebpayPlusTestBase { private static String apiUrl = ApiConstants.WEBPAY_ENDPOINT; private static Options option = new WebpayOptions(IntegrationCommerceCodes.WEBPAY_PLUS, IntegrationApiKeys.WEBPAY, IntegrationType.SERVER_MOCK); private static String testToken = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; @BeforeAll - public static void startProxy() { + static void startProxy() { client = startClientAndServer(8888); } @AfterAll - public static void stopProxy() { + static void stopProxy() { client.stop(); } @AfterEach - public void resetMockServer() { + void resetMockServer() { client.reset(); } @Test - public void create() throws IOException, TransactionCreateException { + void create() throws IOException, TransactionCreateException { String url = String.format("/%s/transactions", apiUrl); String urlResponse = "https://webpay3gint.transbank.cl/webpayserver/initTransaction"; @@ -72,7 +72,7 @@ public void create() throws IOException, TransactionCreateException { } @Test - public void commit() throws IOException, TransactionCommitException { + void commit() throws IOException, TransactionCommitException { WebpayPlusTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions/%s", apiUrl, testToken); setResponsePut(url, generateCommitJsonResponse()); @@ -93,7 +93,7 @@ public void commit() throws IOException, TransactionCommitException { } @Test - public void refund() throws IOException, TransactionRefundException { + void refund() throws IOException, TransactionRefundException { String url = String.format("/%s/transactions/%s/refunds", apiUrl, testToken); double amount = 1000d; String type = "REVERSED"; @@ -110,7 +110,7 @@ public void refund() throws IOException, TransactionRefundException { } @Test - public void status() throws IOException, TransactionStatusException { + void status() throws IOException, TransactionStatusException { WebpayPlusTransactionStatusResponse expectedResponse = generateStatusResponse(); String url = String.format("/%s/transactions/%s", apiUrl, testToken); setResponseGet(url, generateCommitJsonResponse());