Implement WXA code and WXA QR code getting.
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
+21
@@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user