1
0
mirror of synced 2025-12-20 07:38:27 +08:00

#672 小程序增加jssdk相关接口实现

This commit is contained in:
Binary Wang
2018-08-05 19:51:41 +08:00
parent 93db3237a6
commit 214e7e58fa
9 changed files with 243 additions and 9 deletions

View File

@@ -0,0 +1,45 @@
package cn.binarywang.wx.miniapp.api.impl;
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.config.WxMaConfig;
import cn.binarywang.wx.miniapp.test.ApiTestModule;
import com.google.inject.Inject;
import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.error.WxErrorException;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
import static org.assertj.core.api.Assertions.assertThat;
/**
* <pre>
* Created by BinaryWang on 2018/8/5.
* </pre>
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
@Test
@Guice(modules = ApiTestModule.class)
public class WxMaJsapiServiceImplTest {
@Inject
private WxMaService wxService;
@Inject
private WxMaConfig wxMaConfig;
@Test
public void testGetJsapiTicket() throws WxErrorException {
assertThat(this.wxService.getJsapiService().getJsapiTicket()).isNotBlank();
}
@Test
public void testGetJsapiTicket1() throws WxErrorException {
assertThat(this.wxService.getJsapiService().getJsapiTicket(true)).isNotBlank();
}
@Test
public void testCreateJsapiSignature() throws WxErrorException {
final WxJsapiSignature jsapiSignature = this.wxService.getJsapiService().createJsapiSignature("http://www.qq.com");
System.out.println(jsapiSignature);
assertThat(jsapiSignature).isNotNull();
}
}

View File

@@ -54,6 +54,7 @@ public class TestConfig extends WxMaInMemoryConfig {
this.templateId = templateId;
}
@Override
public void setAccessTokenLock(Lock lock) {
super.accessTokenLock = lock;
}