Implement WXA code and WXA QR code getting.

This commit is contained in:
Sutra Zhou
2018-05-22 22:19:07 +08:00
parent 822307464e
commit 2acb0efbd2
12 changed files with 569 additions and 1 deletions
@@ -0,0 +1,21 @@
package com.foxinmy.weixin4j.wxa.api;
import static org.junit.Assert.assertTrue;
import java.awt.Color;
import org.junit.Test;
import com.alibaba.fastjson.JSON;
public class WxaCodeParameterTest {
@Test
public void test() {
WxaCodeParameter param = new WxaCodeParameter("pages/index/index", 430, false, new Color(1, 2, 3), true);
String json = JSON.toJSONString(param);
assertTrue(json.contains("\"line_color\":"));
assertTrue(json.contains("\"is_hyaline\":true"));
}
}
@@ -0,0 +1,21 @@
package com.foxinmy.weixin4j.wxa.api;
import static org.junit.Assert.assertTrue;
import java.awt.Color;
import org.junit.Test;
import com.alibaba.fastjson.JSON;
public class WxaCodeUnlimitParameterTest {
@Test
public void test() {
WxaCodeUnlimitParameter param = new WxaCodeUnlimitParameter("myScene", "pages/index/index", 430, false, new Color(1, 2, 3), true);
String json = JSON.toJSONString(param);
assertTrue(json.contains("\"line_color\":"));
assertTrue(json.contains("\"is_hyaline\":true"));
}
}
@@ -0,0 +1,19 @@
package com.foxinmy.weixin4j.wxa.api;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.alibaba.fastjson.JSON;
public class WxaQrCodeParameterTest {
@Test
public void test() {
WxaQrCodeParameter param = new WxaQrCodeParameter("myPath", 100);
String json = JSON.toJSONString(param);
assertTrue(json.contains("\"path\":\"myPath\""));
assertTrue(json.contains("\"width\":100"));
}
}