sonarqube质量修复

This commit is contained in:
gaoqr
2024-10-08 16:52:56 +08:00
parent 4fe3cfda62
commit 73b4051641
41 changed files with 151 additions and 4400 deletions
@@ -16,6 +16,8 @@ import org.junit.jupiter.api.Test;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import static org.junit.jupiter.api.Assertions.assertNotNull;
/**
* {@link PayClientFactoryImpl} 的集成测试
*
@@ -43,6 +45,7 @@ public class PayClientFactoryImplIntegrationTest {
Long channelId = RandomUtil.randomLong();
payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.WX_PUB.getCode(), config);
PayClient client = payClientFactory.getPayClient(channelId);
assertNotNull(client);
// 发起支付
PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO();
// CommonResult<?> result = client.unifiedOrder(reqDTO);
@@ -66,6 +69,7 @@ public class PayClientFactoryImplIntegrationTest {
Long channelId = RandomUtil.randomLong();
payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.WX_PUB.getCode(), config);
PayClient client = payClientFactory.getPayClient(channelId);
assertNotNull(client);
// 发起支付
PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO();
// CommonResult<?> result = client.unifiedOrder(reqDTO);
@@ -89,6 +93,7 @@ public class PayClientFactoryImplIntegrationTest {
Long channelId = RandomUtil.randomLong();
payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.ALIPAY_QR.getCode(), config);
PayClient client = payClientFactory.getPayClient(channelId);
assertNotNull(client);
// 发起支付
PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO();
reqDTO.setNotifyUrl("http://yunai.natapp1.cc/admin-api/pay/notify/callback/18"); // TODO @tina: 这里改成你的 natapp 回调地址
@@ -113,6 +118,7 @@ public class PayClientFactoryImplIntegrationTest {
Long channelId = RandomUtil.randomLong();
payClientFactory.createOrUpdatePayClient(channelId, PayChannelEnum.ALIPAY_WAP.getCode(), config);
PayClient client = payClientFactory.getPayClient(channelId);
assertNotNull(client);
// 发起支付
PayOrderUnifiedReqDTO reqDTO = buildPayOrderUnifiedReqDTO();
// CommonResult<?> result = client.unifiedOrder(reqDTO);
@@ -18,6 +18,8 @@ import org.junit.jupiter.api.Test;
import java.time.Duration;
import static org.junit.jupiter.api.Assertions.assertNotNull;
/**
* {@link WxBarPayClient} 的集成测试,用于快速调试微信条码支付
*
@@ -48,6 +50,8 @@ public class WxBarPayClientIntegrationTest {
System.out.println(JsonUtils.toJsonPrettyString(request));
WxPayMicropayResult response = client.micropay(request);
System.out.println("========= response ==========");
assertNotNull(response);
assertNotNull(response.getTransactionId());
System.out.println(JsonUtils.toJsonPrettyString(response));
}
@@ -62,6 +66,7 @@ public class WxBarPayClientIntegrationTest {
// 执行解析
String xml = "<xml><return_code>SUCCESS</return_code><appid><![CDATA[wx62056c0d5e8db250]]></appid><mch_id><![CDATA[1545083881]]></mch_id><nonce_str><![CDATA[ed8f02c21d15635cede114a42d0525a0]]></nonce_str><req_info><![CDATA[bGp+wB9DAHjoOO9Nw1iSmmIFdN2zZDhsoRWZBYdf/8bcpjowr4T8i2qjLsbMtvKQeVC5kBZOL/Agal3be6UPwnoantil+L+ojZgvLch7dXFKs/AcoxIYcVYyGka+wmnRJfUmuFRBgzt++8HOFsmJz6e2brYv1EAz+93fP2AsJtRuw1FEzodcg8eXm52hbE0KhLNqC2OyNVkn8AbOOrwIxSYobg2jVbuJ4JllYbEGIQ/6kWzNbVmMKhGJGYBy/NbUGKoQsoe4QeTQqcqQqVp08muxaOfJGThaN3B9EEMFSrog/3yT7ykVV6WQ5+Ygt89LplOf5ucWa4Ird7VJhHWtzI92ZePj4Omy1XkT1TRlwtDegA0S5MeQpM4WZ1taMrhxgmNkTUJ0JXFncx5e2KLQvbvD/HOcccx48Xv1c16JBz6G3501k8E++LWXgZ2TeNXwGsk6FyRZb0ApLyQHIx5ZtPo/UET9z3AmJCPXkrUsZ4WK46fDtbzxVPU2r8nTOcGCPbO0LUsGT6wpsuQVC4CisXDJwoZmL6kKwHfKs6mmUL2YZYzNfgoB/KgpJYSpC96kcpQyFvw+xuwqK2SXGZbAl9lADT+a83z04feQHSSIG3PCrX4QEWzpCZZ4+ySEz1Y34aoU20X9GtX+1LSwUjmQgwHrMBSvFm3/B7+IFM8OUqDB+Uvkr9Uvy7P2/KDvfy3Ih7GFcGd0C5NXpSvVTTfu1IlK/T3/t6MR/8iq78pp/2ZTYvO6eNDRJWaXYU+x6sl2dTs9n+2Z4W4AfYTvEyuxlx+aI19SqCJh7WmaFcAxidFl/9iqDjWiplb9+C6ijZv2hJtVjSCuoptIWpGDYItH7RAqlKHrx6flJD+M/5BceMHBv2w4OWCD9vPRLo8gl9o06ip0iflzO1dixhOAgLFjsQmQHNGFtR3EvCID+iS4FUlilwK+hcKNxrr0wp9Btkl9W1R9aTo289CUiIxx45skfCYzHwb+7Hqj3uTiXnep6zhCKZBAnPsDOvISXfBgXKufcFsTNtts09jX8H5/uMc9wyJ179H1cp+At1mIK2duwfo4Q9asfEoffl6Zn1olGdtEruxHGeVU0NwJ8V7RflC/Cx5RXtJ3sPJ/sHmVnBlVyR0=]]></req_info></xml>";
WxPayRefundNotifyResult response = client.parseRefundNotifyResult(xml);
assertNotNull(response.getReqInfo().getTransactionId());
System.out.println(response.getReqInfo());
}
@@ -84,6 +89,7 @@ public class WxBarPayClientIntegrationTest {
System.out.println(JsonUtils.toJsonPrettyString(request));
WxPayRefundResult response = client.refund(request);
System.out.println("========= response ==========");
assertNotNull(response.getTransactionId());
System.out.println(JsonUtils.toJsonPrettyString(response));
}
@@ -105,6 +111,7 @@ public class WxBarPayClientIntegrationTest {
System.out.println(JsonUtils.toJsonPrettyString(request));
WxPayRefundV3Result response = client.refundV3(request);
System.out.println("========= response ==========");
assertNotNull(response.getTransactionId());
System.out.println(JsonUtils.toJsonPrettyString(response));
}
@@ -15,6 +15,8 @@ import org.junit.jupiter.api.Test;
import java.time.Duration;
import static org.junit.jupiter.api.Assertions.assertNotNull;
/**
* {@link WxNativePayClient} 的集成测试,用于快速调试微信扫码支付
*
@@ -43,6 +45,7 @@ public class WxNativePayClientIntegrationTest {
System.out.println(JsonUtils.toJsonPrettyString(request));
String response = client.createOrderV3(TradeTypeEnum.NATIVE, request);
System.out.println("========= response ==========");
assertNotNull(response);
System.out.println(JsonUtils.toJsonPrettyString(response));
}
@@ -64,6 +67,7 @@ public class WxNativePayClientIntegrationTest {
System.out.println(JsonUtils.toJsonPrettyString(request));
WxPayRefundV3Result response = client.refundV3(request);
System.out.println("========= response ==========");
assertNotNull(response.getTransactionId());
System.out.println(JsonUtils.toJsonPrettyString(response));
}