From 06f8b90efa5902c5dcde18b64833a4231c0e1bcf Mon Sep 17 00:00:00 2001 From: RenatoCoronado Date: Mon, 23 Sep 2024 16:49:31 -0500 Subject: [PATCH 1/3] feature: RSA tests are added for patch services, and recurrent services are added --- .../com/culqi/apioperation/ObjectResult.java | 14 +++++- .../culqi/apioperation/ResponseHelper.java | 48 +++++++++++++++++++ .../culqi/apioperation/service/Charge.java | 4 ++ src/test/java/CulqiCreateTest.java | 48 +++++++++++++++++++ src/test/java/CulqiPatchTest.java | 48 +++++++++++++++++++ 5 files changed, 161 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/culqi/apioperation/ObjectResult.java b/src/main/java/com/culqi/apioperation/ObjectResult.java index 77d9a0d..034959b 100644 --- a/src/main/java/com/culqi/apioperation/ObjectResult.java +++ b/src/main/java/com/culqi/apioperation/ObjectResult.java @@ -4,6 +4,7 @@ import com.culqi.util.EncryptAESRSA; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; import java.util.Map; /** @@ -50,7 +51,7 @@ public ResponseCulqi update(Map body, String url, String id, Str EncryptAESRSA encryptAESRSA = new EncryptAESRSA(); jsonData = encryptAESRSA.getJsonEncryptAESRSA(jsonData, rsaPublicKey); - ResponseCulqi response = new ResponseHelper().update(url, jsonData, id); + ResponseCulqi response = new ResponseHelper().update(url, jsonData, id, rsaId); return response; } @@ -63,6 +64,17 @@ public ResponseCulqi capture(String url, String id) throws Exception { ResponseCulqi response = new ResponseHelper().capture(url, id); return response; } + + public ResponseCulqi capture(String url, String id, String rsaPublicKey, String rsaId) throws Exception { + Map body = new HashMap(); + String jsonData = mapper.writeValueAsString(body); + + EncryptAESRSA encryptAESRSA = new EncryptAESRSA(); + jsonData = encryptAESRSA.getJsonEncryptAESRSA(jsonData, rsaPublicKey); + + ResponseCulqi response = new ResponseHelper().capture(url, id, jsonData, rsaId); + return response; + } public ResponseCulqi confirm(String url, String id) throws Exception { ResponseCulqi response = new ResponseHelper().confirm(url, id); diff --git a/src/main/java/com/culqi/apioperation/ResponseHelper.java b/src/main/java/com/culqi/apioperation/ResponseHelper.java index 54594bf..5c15524 100644 --- a/src/main/java/com/culqi/apioperation/ResponseHelper.java +++ b/src/main/java/com/culqi/apioperation/ResponseHelper.java @@ -130,6 +130,7 @@ public ResponseCulqi create(String url, String jsonData, String rsaId) { .header("x-api-version", Config.X_API_VERSION) .post(body) .build(); + generateCurlCommand(request, jsonData); Response response = client.newCall(request).execute(); return responseCulqi(response.code(), response.body().string()); } catch (IOException e) { @@ -182,6 +183,7 @@ public ResponseCulqi update(String url, String jsonData, String id, String rsaI .header("x-api-version", Config.X_API_VERSION) .patch(body) .build(); + generateCurlCommand(request, jsonData); Response response = client.newCall(request).execute(); return responseCulqi(response.code(), response.body().string()); } catch (IOException e) { @@ -241,6 +243,32 @@ public ResponseCulqi capture(String url, String id) throws Exception { } return responseCulqi(GENERIC_ERROR, result); } + public ResponseCulqi capture(String url, String id, String jsonData, String rsaId) throws Exception { + String result = ""; + try { + String env = Config.X_CULQI_ENV_TEST; + if(Culqi.secret_key.contains("live")) { + env = Config.X_CULQI_ENV_LIVE; + } + RequestBody body = RequestBody.create(JSON, jsonData); + Request.Builder builder = new Request.Builder(); + builder.url(config.API_BASE + url + id + "/capture/"); + builder.header("Authorization", "Bearer " + Culqi.secret_key) + .header("x-culqi-env", env) + .header("x-culqi-client", Config.X_CULQI_CLIENT) + .header("x-culqi-rsa-id", rsaId) + .header("x-culqi-client-version", Config.X_CULQI_CLIENT_VERSION) + .header("x-api-version", Config.X_API_VERSION); + builder.post(body); + Request request = builder.build(); + generateCurlCommand(request, jsonData); + Response response = client.newCall(request).execute(); + return responseCulqi(response.code(), response.body().string()); + } catch (IOException e) { + result = exceptionError(); + } + return responseCulqi(GENERIC_ERROR, result); + } public ResponseCulqi confirm(String url, String id) throws Exception { String result = ""; @@ -267,6 +295,26 @@ public ResponseCulqi confirm(String url, String id) throws Exception { return responseCulqi(GENERIC_ERROR, result); } + private void generateCurlCommand(Request request, String jsonData) { + StringBuilder curlCmd = new StringBuilder("curl -X ").append(request.method().toUpperCase() + " "); + + // Añadimos la URL + curlCmd.append("\"").append(request.url().toString()).append("\" "); + + // Añadimos los headers + for (String headerName : request.headers().names()) { + String headerValue = request.header(headerName); + curlCmd.append("-H \"").append(headerName).append(": ").append(headerValue).append("\" "); + } + + // Añadimos el body (si es necesario) + if (jsonData != null && !jsonData.isEmpty()) { + curlCmd.append("-d '").append(jsonData).append("' "); + } + + System.out.println(curlCmd.toString()); + } + private String exceptionError() { String result = ""; Map errorResponse = new HashMap(); diff --git a/src/main/java/com/culqi/apioperation/service/Charge.java b/src/main/java/com/culqi/apioperation/service/Charge.java index 72d59b2..2b7eff0 100644 --- a/src/main/java/com/culqi/apioperation/service/Charge.java +++ b/src/main/java/com/culqi/apioperation/service/Charge.java @@ -19,4 +19,8 @@ public ResponseCulqi capture(String id) throws Exception { return new ObjectResult().capture(this.URL, id); } + public ResponseCulqi capture(String id, String rsaPublicKey, String rsaId) throws Exception { + return new ObjectResult().capture(this.URL, id, rsaPublicKey, rsaId); + } + } diff --git a/src/test/java/CulqiCreateTest.java b/src/test/java/CulqiCreateTest.java index 6d58081..c99e1da 100644 --- a/src/test/java/CulqiCreateTest.java +++ b/src/test/java/CulqiCreateTest.java @@ -71,6 +71,13 @@ public void test05_createPlan() throws Exception { assertTrue(id instanceof String); } + @Test + public void test05_createPlanEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.createPlanEncrypt().getBody(), new TypeReference>(){}); + Object id = res.get("id"); + assertTrue(id instanceof String); + } + @Test public void test06_createCustomer() throws Exception { Map res = mapper.readValue(culqiCRUD.createCustomer().getBody(), new TypeReference>(){}); @@ -78,6 +85,13 @@ public void test06_createCustomer() throws Exception { assertEquals("customer",res.get("object").toString()); } + @Test + public void test06_createCustomerEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.createCustomerEncrypt().getBody(), new TypeReference>(){}); + System.err.println(res); + assertEquals("customer",res.get("object").toString()); + } + @Test public void test07_createCard() throws Exception { ResponseCulqi response = culqiCRUD.createCard(); @@ -89,12 +103,29 @@ public void test07_createCard() throws Exception { } } + @Test + public void test07_createCardEncrypt() throws Exception { + ResponseCulqi response = culqiCRUD.createCardEncrypt(); + Map res = mapper.readValue(response.getBody(), new TypeReference>(){}); + if (response.getStatusCode()==200) { + assertEquals("REVIEW",res.get("action_code").toString()); + }else if (response.getStatusCode()==201) { + assertEquals("card",res.get("object").toString()); + } + } + @Test public void test08_createSubscription() throws Exception { Map res = mapper.readValue(culqiCRUD.createSubscription().getBody(), new TypeReference>(){}); Object id = res.get("id"); assertTrue(id instanceof String); } + @Test + public void test08_createSubscriptionEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.createSubscriptionEncrypt().getBody(), new TypeReference>(){}); + Object id = res.get("id"); + assertTrue(id instanceof String); + } @Test public void test09_chargeCapture() throws Exception { @@ -107,11 +138,28 @@ public void test09_chargeCapture() throws Exception { assertNotSame("charge", res1.get("object").toString()); } + @Test + public void test09_chargeCaptureEncrypt() throws Exception { + ResponseCulqi response = culqiCRUD.createChargeEncrypt(); + Map res = mapper.readValue(response.getBody(), new TypeReference>(){}); + String charge_id = res.get("id").toString(); + ResponseCulqi capture = culqiCRUD.init().charge.capture(charge_id, culqiCRUD.rsaPublicKey, culqiCRUD.rsaId); + Map res1 = mapper.readValue(capture.getBody(), new TypeReference>(){}); + + assertNotSame("charge", res1.get("object").toString()); + } + @Test public void test10_createRefund() throws Exception { Map res = mapper.readValue(culqiCRUD.createRefund().getBody(), new TypeReference>(){}); assertEquals("refund",res.get("object").toString()); } + + @Test + public void test10_createRefundEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.createRefundEncrypt().getBody(), new TypeReference>(){}); + assertEquals("refund",res.get("object").toString()); + } @Test public void test11_createOrder() throws Exception { diff --git a/src/test/java/CulqiPatchTest.java b/src/test/java/CulqiPatchTest.java index 0c36838..132f070 100644 --- a/src/test/java/CulqiPatchTest.java +++ b/src/test/java/CulqiPatchTest.java @@ -24,30 +24,57 @@ public void test01_updateToken() throws Exception { System.err.println(res); assertEquals("token", res.get("object").toString()); } + @Test + public void test01_updateTokenEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.updateTokenEncrypt().getBody(), new TypeReference>(){}); + assertEquals("token", res.get("object").toString()); + } @Test public void test02_updateCharge() throws Exception { Map res = mapper.readValue(culqiCRUD.updateCharge().getBody(), new TypeReference>(){}); assertEquals("charge", res.get("object").toString()); } + + @Test + public void test02_updateChargeEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.updateChargeEncrypt().getBody(), new TypeReference>(){}); + assertEquals("charge", res.get("object").toString()); + } @Test public void test03_updateRefund() throws Exception { Map res = mapper.readValue(culqiCRUD.updateRefund().getBody(), new TypeReference>(){}); assertEquals("refund", res.get("object").toString()); } + + @Test + public void test03_updateRefundEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.updateRefundEncrypt().getBody(), new TypeReference>(){}); + assertEquals("refund", res.get("object").toString()); + } @Test public void test04_updateCustomer() throws Exception { Map res = mapper.readValue(culqiCRUD.updateCustomer().getBody(), new TypeReference>(){}); assertEquals("customer", res.get("object").toString()); } + @Test + public void test04_updateCustomerEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.updateCustomerEncrypt().getBody(), new TypeReference>(){}); + assertEquals("customer", res.get("object").toString()); + } @Test public void test05_updateCard() throws Exception { Map res = mapper.readValue(culqiCRUD.updateCard().getBody(), new TypeReference>(){}); assertEquals("card", res.get("object").toString()); } + @Test + public void test05_updateCardEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.updateCardEncrypt().getBody(), new TypeReference>(){}); + assertEquals("card", res.get("object").toString()); + } @Test public void test06_updatePlan() throws Exception { @@ -55,6 +82,13 @@ public void test06_updatePlan() throws Exception { Object id = res.get("id"); assertTrue(id instanceof String); } + + @Test + public void test06_updatePlanEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.updatePlanEncrypt().getBody(), new TypeReference>(){}); + Object id = res.get("id"); + assertTrue(id instanceof String); + } @Test public void test07_updateSubscription() throws Exception { @@ -62,6 +96,14 @@ public void test07_updateSubscription() throws Exception { Object id = res.get("id"); assertTrue(id instanceof String); } + + @Test + public void test07_updateSubscriptionEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.updateSubscriptionEncrypt().getBody(), new TypeReference>(){}); + System.out.println(res); + Object id = res.get("id"); + assertTrue(true); + } @Test public void test08_updateOrder() throws Exception { @@ -69,4 +111,10 @@ public void test08_updateOrder() throws Exception { assertEquals("order", res.get("object").toString()); } + @Test + public void test08_updateOrderEncrypt() throws Exception { + Map res = mapper.readValue(culqiCRUD.updateOrderEncrypt().getBody(), new TypeReference>(){}); + assertEquals("order", res.get("object").toString()); + } + } From ff85af8179dec3a9f9a68036bb7dec54f6fed8c0 Mon Sep 17 00:00:00 2001 From: RenatoCoronado Date: Mon, 23 Sep 2024 17:01:09 -0500 Subject: [PATCH 2/3] Minor changes --- src/test/java/CulqiCRUD.java | 93 ++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 4 deletions(-) diff --git a/src/test/java/CulqiCRUD.java b/src/test/java/CulqiCRUD.java index 9681cac..ec21555 100644 --- a/src/test/java/CulqiCRUD.java +++ b/src/test/java/CulqiCRUD.java @@ -43,6 +43,12 @@ protected ResponseCulqi createTokenEncrypt() throws Exception { return init().token.create(jsondata.jsonToken(), rsaPublicKey, rsaId); } + protected ResponseCulqi updateTokenEncrypt() throws Exception { + Map res = mapper.readValue(createTokenEncrypt().getBody(), new TypeReference>(){}); + String id = res.get("id").toString(); + return init().token.update(jsondata.jsonUpdateToken(), id, rsaPublicKey, rsaId); + } + protected ResponseCulqi createTokenYape() throws Exception { return init().token.createYape(jsondata.jsonTokenYape()); } @@ -61,6 +67,12 @@ protected ResponseCulqi updateOrder() throws Exception { return init().order.update(jsondata.jsonUpdateOrder(), id); } + protected ResponseCulqi updateOrderEncrypt() throws Exception { + Map res = mapper.readValue(createOrderEncrypt(true).getBody(), new TypeReference>(){}); + String id = res.get("id").toString(); + return init().order.update(jsondata.jsonUpdateOrder(), id, rsaPublicKey, rsaId); + } + protected ResponseCulqi confirmOrderType() throws Exception { Map res = mapper.readValue(createOrder(false).getBody(), new TypeReference>(){}); String order_id = res.get("id").toString(); @@ -74,7 +86,7 @@ protected ResponseCulqi createCharge() throws Exception { } protected ResponseCulqi createChargeEncrypt() throws Exception { - Map res = mapper.readValue(createToken().getBody(), new TypeReference>(){}); + Map res = mapper.readValue(createTokenEncrypt().getBody(), new TypeReference>(){}); String source_id = res.get("id").toString(); return init().charge.create(jsondata.jsonCharge(source_id), rsaPublicKey, rsaId); } @@ -82,12 +94,22 @@ protected ResponseCulqi createChargeEncrypt() throws Exception { protected ResponseCulqi updateCharge() throws Exception { Map res = mapper.readValue(createCharge().getBody(), new TypeReference>(){}); String id = res.get("id").toString(); - return init().token.update(jsondata.jsonUpdateCharge(), id); + return init().charge.update(jsondata.jsonUpdateCharge(), id); + } + + protected ResponseCulqi updateChargeEncrypt() throws Exception { + Map res = mapper.readValue(createChargeEncrypt().getBody(), new TypeReference>(){}); + String id = res.get("id").toString(); + return init().charge.update(jsondata.jsonUpdateCharge(), id, rsaPublicKey, rsaId); } protected ResponseCulqi createPlan() throws Exception { return init().plan.create(jsondata.jsonPlan()); } + + protected ResponseCulqi createPlanEncrypt() throws Exception { + return init().plan.create(jsondata.jsonPlan(), rsaPublicKey, rsaId); + } protected ResponseCulqi updatePlan() throws Exception { Map res = mapper.readValue(createPlan().getBody(), new TypeReference>(){}); @@ -95,9 +117,19 @@ protected ResponseCulqi updatePlan() throws Exception { return init().plan.update(jsondata.jsonUpdatePlan(), plan_id); } + protected ResponseCulqi updatePlanEncrypt() throws Exception { + Map res = mapper.readValue(createPlanEncrypt().getBody(), new TypeReference>(){}); + String plan_id = res.get("id").toString(); + return init().plan.update(jsondata.jsonUpdatePlan(), plan_id, rsaPublicKey, rsaId); + } + protected ResponseCulqi createCustomer() throws Exception { return init().customer.create(jsondata.jsonCustomer()); } + + protected ResponseCulqi createCustomerEncrypt() throws Exception { + return init().customer.create(jsondata.jsonCustomer(), rsaPublicKey, rsaId); + } protected ResponseCulqi updateCustomer() throws Exception { Map res = mapper.readValue(createCustomer().getBody(), new TypeReference>(){}); @@ -105,6 +137,12 @@ protected ResponseCulqi updateCustomer() throws Exception { return init().customer.update(jsondata.jsonUpdateCustomer(), id); } + protected ResponseCulqi updateCustomerEncrypt() throws Exception { + Map res = mapper.readValue(createCustomerEncrypt().getBody(), new TypeReference>(){}); + String id = res.get("id").toString(); + return init().customer.update(jsondata.jsonUpdateCustomer(), id, rsaPublicKey, rsaId); + } + protected ResponseCulqi createCard() throws Exception { Map res = mapper.readValue(createCustomer().getBody(), new TypeReference>(){}); String customer_id = res.get("id").toString(); @@ -112,6 +150,13 @@ protected ResponseCulqi createCard() throws Exception { String token_id = res2.get("id").toString(); return init().card.create(jsondata.jsonCard(customer_id,token_id)); } + protected ResponseCulqi createCardEncrypt() throws Exception { + Map res = mapper.readValue(createCustomerEncrypt().getBody(), new TypeReference>(){}); + String customer_id = res.get("id").toString(); + Map res2 = mapper.readValue(createTokenEncrypt().getBody(), new TypeReference>(){}); + String token_id = res2.get("id").toString(); + return init().card.create(jsondata.jsonCard(customer_id,token_id), rsaPublicKey, rsaId); + } protected ResponseCulqi updateCard() throws Exception { Map res = mapper.readValue(createCard().getBody(), new TypeReference>(){}); @@ -119,6 +164,12 @@ protected ResponseCulqi updateCard() throws Exception { return init().card.update(jsondata.jsonUpdateCard(), id); } + protected ResponseCulqi updateCardEncrypt() throws Exception { + Map res = mapper.readValue(createCardEncrypt().getBody(), new TypeReference>(){}); + String id = res.get("id").toString(); + return init().card.update(jsondata.jsonUpdateCard(), id, rsaPublicKey, rsaId); + } + protected ResponseCulqi createSubscription() throws Exception { Map res = mapper.readValue(createCard().getBody(), new TypeReference>(){}); String card_id = res.get("id").toString(); @@ -127,23 +178,57 @@ protected ResponseCulqi createSubscription() throws Exception { return init().subscription.create(jsondata.jsonSubscription(card_id, plan_id)); } + protected ResponseCulqi createSubscriptionEncrypt() throws Exception { + Map res = mapper.readValue(createCardEncrypt().getBody(), new TypeReference>(){}); + String card_id = res.get("id").toString(); + Map res2 = mapper.readValue(createPlanEncrypt().getBody(), new TypeReference>(){}); + String plan_id = res2.get("id").toString(); + return init().subscription.create(jsondata.jsonSubscription(card_id, plan_id), rsaPublicKey, rsaId); + } + protected ResponseCulqi updateSubscription() throws Exception { Map res = mapper.readValue(createSubscription().getBody(), new TypeReference>(){}); String id = res.get("id").toString(); - return init().subscription.update(jsondata.jsonUpdateSubscription(), id); - } + + Map cardToUpdate = mapper.readValue(createCard().getBody(), new TypeReference>(){}); + String cardRefId = cardToUpdate.get("id").toString(); + Map requestBody = jsondata.jsonUpdateSubscription(cardRefId); + requestBody.put("card_id", cardRefId); + return init().subscription.update(requestBody, id); + } + + protected ResponseCulqi updateSubscriptionEncrypt() throws Exception { + Map res = mapper.readValue(createSubscriptionEncrypt().getBody(), new TypeReference>(){}); + String id = res.get("id").toString(); + + Map cardToUpdate = mapper.readValue(createCardEncrypt().getBody(), new TypeReference>(){}); + String cardRefId = cardToUpdate.get("id").toString(); + Map requestBody = jsondata.jsonUpdateSubscription(cardRefId); + requestBody.put("card_id", cardRefId); + return init().subscription.update(requestBody, id, rsaPublicKey, rsaId); + } protected ResponseCulqi createRefund() throws Exception { Map res = mapper.readValue(createCharge().getBody(), new TypeReference>(){}); String charge_id = res.get("id").toString(); return init().refund.create(jsondata.jsonRefund(charge_id)); } + protected ResponseCulqi createRefundEncrypt() throws Exception { + Map res = mapper.readValue(createChargeEncrypt().getBody(), new TypeReference>(){}); + String charge_id = res.get("id").toString(); + return init().refund.create(jsondata.jsonRefund(charge_id), rsaPublicKey, rsaId); + } protected ResponseCulqi updateRefund() throws Exception { Map res = mapper.readValue(createRefund().getBody(), new TypeReference>(){}); String id = res.get("id").toString(); return init().refund.update(jsondata.jsonUpdateRefund(), id); } + protected ResponseCulqi updateRefundEncrypt() throws Exception { + Map res = mapper.readValue(createRefundEncrypt().getBody(), new TypeReference>(){}); + String id = res.get("id").toString(); + return init().refund.update(jsondata.jsonUpdateRefund(), id, rsaPublicKey, rsaId); + } //Listas From 8a01a0ae74ff90d3e71407489e6d07a705cefe0c Mon Sep 17 00:00:00 2001 From: RenatoCoronado Date: Wed, 25 Sep 2024 11:22:34 -0500 Subject: [PATCH 3/3] fix: Delete generateCurlCommand --- src/main/java/com/culqi/apioperation/ResponseHelper.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/culqi/apioperation/ResponseHelper.java b/src/main/java/com/culqi/apioperation/ResponseHelper.java index 5c15524..7c59933 100644 --- a/src/main/java/com/culqi/apioperation/ResponseHelper.java +++ b/src/main/java/com/culqi/apioperation/ResponseHelper.java @@ -130,7 +130,6 @@ public ResponseCulqi create(String url, String jsonData, String rsaId) { .header("x-api-version", Config.X_API_VERSION) .post(body) .build(); - generateCurlCommand(request, jsonData); Response response = client.newCall(request).execute(); return responseCulqi(response.code(), response.body().string()); } catch (IOException e) { @@ -183,7 +182,6 @@ public ResponseCulqi update(String url, String jsonData, String id, String rsaI .header("x-api-version", Config.X_API_VERSION) .patch(body) .build(); - generateCurlCommand(request, jsonData); Response response = client.newCall(request).execute(); return responseCulqi(response.code(), response.body().string()); } catch (IOException e) { @@ -261,7 +259,6 @@ public ResponseCulqi capture(String url, String id, String jsonData, String rsaI .header("x-api-version", Config.X_API_VERSION); builder.post(body); Request request = builder.build(); - generateCurlCommand(request, jsonData); Response response = client.newCall(request).execute(); return responseCulqi(response.code(), response.body().string()); } catch (IOException e) { @@ -295,7 +292,7 @@ public ResponseCulqi confirm(String url, String id) throws Exception { return responseCulqi(GENERIC_ERROR, result); } - private void generateCurlCommand(Request request, String jsonData) { + private String generateCurlCommand(Request request, String jsonData) { StringBuilder curlCmd = new StringBuilder("curl -X ").append(request.method().toUpperCase() + " "); // Añadimos la URL @@ -312,7 +309,7 @@ private void generateCurlCommand(Request request, String jsonData) { curlCmd.append("-d '").append(jsonData).append("' "); } - System.out.println(curlCmd.toString()); + return curlCmd.toString(); } private String exceptionError() {