From 446bbb259ce5ec053fd5b40f8c630c130f96ec86 Mon Sep 17 00:00:00 2001 From: wb2476 Date: Mon, 29 Jul 2024 15:31:52 +0800 Subject: [PATCH] =?UTF-8?q?test=EF=BC=9A=E7=B1=B3=E9=98=B3=E5=8F=97?= =?UTF-8?q?=E6=89=98=E5=8D=8F=E8=AE=AE=E6=94=AF=E4=BB=98=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=B8=B4=E6=97=B6test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../miyang/entpay/EntPayService.java | 2 +- .../api/test/service/EntPayServiceTest.java | 76 +++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 scfs-api-test/src/test/java/com/czcb/scfs/api/test/service/EntPayServiceTest.java diff --git a/scfs-api-service/src/main/java/com/czcb/scfs/api/service/v2/customization/miyang/entpay/EntPayService.java b/scfs-api-service/src/main/java/com/czcb/scfs/api/service/v2/customization/miyang/entpay/EntPayService.java index 619e243..0020da7 100644 --- a/scfs-api-service/src/main/java/com/czcb/scfs/api/service/v2/customization/miyang/entpay/EntPayService.java +++ b/scfs-api-service/src/main/java/com/czcb/scfs/api/service/v2/customization/miyang/entpay/EntPayService.java @@ -61,7 +61,7 @@ public class EntPayService { /** * 300311-协议支付 */ - public EntPayAgrtPayResponse commonAgrtPay(EntPayAgrtPayRequest request) { + public EntPayAgrtPayResponse agrtPay(EntPayAgrtPayRequest request) { String url = "/entpay/agrt-pay"; HttpResponse httpResponse = apiClient.post(url, HttpHeaders.apiVersionV2(), request.toJsonRequest(), EntPayAgrtPayResponse.class); diff --git a/scfs-api-test/src/test/java/com/czcb/scfs/api/test/service/EntPayServiceTest.java b/scfs-api-test/src/test/java/com/czcb/scfs/api/test/service/EntPayServiceTest.java new file mode 100644 index 0000000..7de8386 --- /dev/null +++ b/scfs-api-test/src/test/java/com/czcb/scfs/api/test/service/EntPayServiceTest.java @@ -0,0 +1,76 @@ +package com.czcb.scfs.api.test.service; + + +import com.czcb.scfs.api.service.v2.customization.miyang.entpay.EntPayService; +import com.czcb.scfs.api.service.v2.customization.miyang.entpay.model.*; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.test.context.SpringBootTest; + +import javax.annotation.Resource; + +/** + * 米阳受托支付功能 + * + * @author H.T + * @since 2024-07-29 + */ +@SpringBootTest +class EntPayServiceTest { + + private static final Logger log = LoggerFactory.getLogger(EntPayServiceTest.class); + @Resource + private EntPayService service; + + @Test + void agrtCreateTest() { + try { + EntPayAgrtCreateResponse response = service.agrtCreate(new EntPayAgrtCreateRequest()); + Assertions.assertEquals("000000", response.getRecode()); + } catch (Exception e) { + log.info(e.getMessage()); + } + } + + @Test + void agrtDelTest() { + try { + EntPayAgrtDelResponse response = service.agrtDel(new EntPayAgrtDelRequest()); + Assertions.assertEquals("000000", response.getRecode()); + } catch (Exception e) { + log.info(e.getMessage()); + } + } + + @Test + void agrtQueryListTest() { + try { + EntPayAgrtQueryListResponse response = service.agrtQueryList(new EntPayAgrtQueryListRequest()); + Assertions.assertEquals("000000", response.getRecode()); + } catch (Exception e) { + log.info(e.getMessage()); + } + } + + @Test + void commonAgrtPayTest() { + try { + CommonAgrtPayResponse response = service.commonAgrtPay(new CommonAgrtPayRequest()); + Assertions.assertEquals("000000", response.getRecode()); + } catch (Exception e) { + log.info(e.getMessage()); + } + } + + @Test + void agrtPayTest() { + try { + EntPayAgrtPayResponse response = service.agrtPay(new EntPayAgrtPayRequest()); + Assertions.assertEquals("000000", response.getRecode()); + } catch (Exception e) { + log.info(e.getMessage()); + } + } +}