From 5f9627296d9b6bea96e79642d1f38388098c66b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 19 Dec 2025 17:28:45 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=9E=E5=90=8D=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E6=9C=8D=E5=8A=A1=E7=9A=84=E6=B5=8B=E8=AF=95=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com> --- .../service/impl/RealNameServiceImplTest.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/RealNameServiceImplTest.java diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/RealNameServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/RealNameServiceImplTest.java new file mode 100644 index 000000000..dda237194 --- /dev/null +++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/RealNameServiceImplTest.java @@ -0,0 +1,54 @@ +package com.github.binarywang.wxpay.service.impl; + +import com.github.binarywang.wxpay.bean.realname.RealNameRequest; +import com.github.binarywang.wxpay.bean.realname.RealNameResult; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.service.WxPayService; +import com.github.binarywang.wxpay.testbase.ApiTestModule; +import com.google.inject.Inject; +import lombok.extern.slf4j.Slf4j; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +/** + *
+ * 实名验证测试类. + *+ * + * @author Binary Wang + */ +@Test +@Guice(modules = ApiTestModule.class) +@Slf4j +public class RealNameServiceImplTest { + + @Inject + private WxPayService payService; + + /** + * 测试查询用户实名认证信息. + * + * @throws WxPayException the wx pay exception + */ + @Test + public void testQueryRealName() throws WxPayException { + RealNameRequest request = RealNameRequest.newBuilder() + .openid("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o") + .build(); + + RealNameResult result = this.payService.getRealNameService().queryRealName(request); + log.info("实名认证查询结果:{}", result); + } + + /** + * 测试查询用户实名认证信息(简化方法). + * + * @throws WxPayException the wx pay exception + */ + @Test + public void testQueryRealNameSimple() throws WxPayException { + RealNameResult result = this.payService.getRealNameService() + .queryRealName("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"); + log.info("实名认证查询结果:{}", result); + } +}