1
0
mirror of synced 2025-12-22 00:48:00 +08:00

去掉joor的依赖,并重构相关反射代码 for #58

This commit is contained in:
Binary Wang
2016-10-21 15:23:23 +08:00
parent 5885ce826e
commit 4b88c3d426
6 changed files with 96 additions and 132 deletions

View File

@@ -30,6 +30,7 @@ public class WxMpStoreServiceImplTest {
* @throws WxErrorException
*/
public void testAdd() throws WxErrorException {
this.wxMpService.getStoreService().add(WxMpStoreBaseInfo.builder().build());
this.wxMpService.getStoreService()
.add(WxMpStoreBaseInfo.builder().businessName("haha").branchName("abc")
.province("aaa").district("aaa").telephone("122").address("abc").categories(new String[] { "美食,江浙菜" })

View File

@@ -1,33 +0,0 @@
package me.chanjar.weixin.mp.bean.pay;
import java.lang.reflect.Field;
import java.util.Map.Entry;
import org.joor.Reflect;
import org.testng.annotations.Test;
import com.thoughtworks.xstream.annotations.XStreamAlias;
@Test
public class WxSendRedpackRequestTest {
public void test() throws NoSuchFieldException, SecurityException {
WxSendRedpackRequest request = new WxSendRedpackRequest();
request.setMchBillno("123");
request.setActName("ab");
for (Entry<String, Reflect> entry : Reflect.on(request).fields().entrySet()) {
Reflect reflect = entry.getValue();
if (reflect.get() == null) {
continue;
}
Field field = WxSendRedpackRequest.class.getDeclaredField(entry.getKey());
if (field.isAnnotationPresent(XStreamAlias.class)) {
System.err.println(reflect.get() + " = " + field.getAnnotation(XStreamAlias.class).value());
}
}
}
}