Browse Source

🎨 优化代码

dev1
Binary Wang 4 years ago
parent
commit
4929e4e03e
4 changed files with 50 additions and 42 deletions
  1. +5
    -12
      weixin-java-pay/pom.xml
  2. +7
    -1
      weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequest.java
  3. +3
    -3
      weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
  4. +35
    -26
      weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImplTest.java

+ 5
- 12
weixin-java-pay/pom.xml View File

@@ -12,18 +12,11 @@
<artifactId>weixin-java-pay</artifactId>
<name>WxJava - PAY Java SDK</name>
<description>微信支付 Java SDK</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
<dependency>


+ 7
- 1
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/payscore/WxPayScoreRequest.java View File

@@ -1,8 +1,11 @@
package com.github.binarywang.wxpay.bean.payscore;

import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;
@@ -11,8 +14,11 @@ import java.util.List;
* @author doger.wang
* @date 2020/5/12 16:36
*/
@NoArgsConstructor
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxPayScoreRequest implements Serializable {
private static final long serialVersionUID = 364764508076146082L;



+ 3
- 3
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java View File

@@ -144,11 +144,11 @@ public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl {
}

private CloseableHttpClient createApiV3HttpClient() throws WxPayException {
CloseableHttpClient apiv3HttpClient = this.getConfig().getApiV3HttpClient();
if (null == apiv3HttpClient) {
CloseableHttpClient apiV3HttpClient = this.getConfig().getApiV3HttpClient();
if (null == apiV3HttpClient) {
return this.getConfig().initApiV3HttpClient();
}
return apiv3HttpClient;
return apiV3HttpClient;
}

private StringEntity createEntry(String requestStr) {


+ 35
- 26
weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayScoreServiceImplTest.java View File

@@ -1,46 +1,55 @@
package com.github.binarywang.wxpay.service.impl;

import com.github.binarywang.wxpay.bean.payscore.WxPayScoreRequest;
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 org.testng.annotations.Guice;
import org.testng.annotations.Test;

import static org.testng.Assert.*;

/**
* 测试代码,待补充完善.
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2020-05-19
*/
@Test
@Guice(modules = ApiTestModule.class)
public class PayScoreServiceImplTest {
@Inject
private WxPayService payService;

@Test
public void testCreateServiceOrder() {
}
@Test
public void testCreateServiceOrder() throws WxPayException {
this.payService.getPayScoreService().createServiceOrder(WxPayScoreRequest.builder().build());
}

@Test
public void testQueryServiceOrder() {
}
@Test
public void testQueryServiceOrder() {
}

@Test
public void testCancelServiceOrder() {
}
@Test
public void testCancelServiceOrder() {
}

@Test
public void testModifyServiceOrder() {
}
@Test
public void testModifyServiceOrder() {
}

@Test
public void testCompleteServiceOrder() {
}
@Test
public void testCompleteServiceOrder() {
}

@Test
public void testPayServiceOrder() {
}
@Test
public void testPayServiceOrder() {
}

@Test
public void testSyncServiceOrder() {
}
@Test
public void testSyncServiceOrder() {
}

@Test
public void testDecryptNotifyData() {
}
@Test
public void testDecryptNotifyData() {
}
}

Loading…
Cancel
Save