Commit 547145a8 authored by Su-Yi's avatar Su-Yi

修改文章推荐

parent be75345f
......@@ -178,10 +178,10 @@ public class Article {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",3);
params.put("pageSize",2);
Response response = network.getResponse(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS);
int count = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(count,3,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"获取个人专栏列表有误",response.body().asString()));
boolean hasList = response.jsonPath().getInt("data.list.size()") > 0;
Assert.assertTrue(hasList,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"代理人-获取个人专栏列表有误",response.body().asString()));
String answer = response.jsonPath().getString("data.list[0].answer");
Assert.assertNotNull(answer,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"获取问答内容有误",response.body().asString()));
}
......@@ -406,10 +406,10 @@ public class Article {
Map<String, Object> params = new HashMap<String, Object>();
params.put("scid",scid);
params.put("pageIndex",1);
params.put("pageSize",3);
params.put("pageSize",2);
Response response = network.getResponse(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS);
int count = response.jsonPath().getInt("data.list.size()");
Assert.assertEquals(count,3,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"访客-获取个人专栏列表有误",response.body().asString()));
boolean hasList = response.jsonPath().getInt("data.list.size()") > 0;
Assert.assertTrue(hasList,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"访客-获取个人专栏列表有误",response.body().asString()));
String answer = response.jsonPath().getString("data.list[0].answer");
Assert.assertNotNull(answer,network.message(params,ARTICLE_ENHANCEDCOLUMN_GETFAQS,"访客-获取问答内容有误",response.body().asString()));
}
......
......@@ -116,7 +116,37 @@ public class Pay {
Assert.assertEquals(userVersion,changeVersion,network.message(params, VERSION_INFO,"会员类型版本判断:判断错误,此版本为尊享版",response.body().asString()));
}
@Test (description = "默认付费_微信支付后回调",priority = 5)
@Test (description = "优惠券付费",priority = 5)
public void 优惠券付费 () throws IOException {
String promotionCode = BaseUtils.getPromotionCode();
Map<String, Object> params = new HashMap<String, Object>();
params.put("code",promotionCode);
Response response = network.getResponse(params,PAY_COMBOLIST);
Map<String, Object> payParams = new HashMap<String, Object>();
payParams.put("userVersion",2); // 1 通用版 2 保险版
payParams.put("comboId","Kj21MTU");
payParams.put("oaId","1");
payParams.put("paySource","101004");
payParams.put("sellerFrom","");
payParams.put("promotionCode",promotionCode);
response = network.postResponse(payParams,PAY_ORDERCREATE);
String tradeNo = response.jsonPath().getString("data.tradeNo");
response.body().prettyPrint();
// mock微信回调成功
Map<String, Object> callbackParams = new HashMap<String, Object>();
callbackParams.put("tradeNo",tradeNo);
callbackParams.put("payResult",true);
callbackParams.put("payTradeNo","test");
response = network.getResponse(callbackParams,PAY_CALLOUT);
boolean result = response.jsonPath().getBoolean("data");
response.body().prettyPrint();
Assert.assertTrue(result,network.message(callbackParams,PAY_CALLOUT,"mock微信支付回调成功,但我们订单处理失败",response.body().asString()));
}
@Test (description = "默认付费_微信支付后回调",priority = 6)
public void 默认付费_微信支付后回调() throws IOException {
//创建支付
Map<String, Object> payParams = new HashMap<String, Object>();
......@@ -146,6 +176,21 @@ public class Pay {
response = network.getResponse(callbackParams,PAY_CALLOUT);
result = response.jsonPath().getBoolean("data");
Assert.assertTrue(result,network.message(callbackParams,PAY_CALLOUT,"mock微信支付回调成功,但我们订单处理失败",response.body().asString()));
// 检查会员开通结果
response = network.getResponse(USER_INFO);
boolean isVip = response.jsonPath().getBoolean("data.vipValid");
Assert.assertTrue(isVip,network.message(USER_INFO,"微信支付成功,但是接口返回还是非会员状态",response.body().asString()));
// 检查会员版本类型
response = network.getResponse(VERSION_INFO);
int userVersion = response.jsonPath().getInt("data.find {it.openType == 1}.userVersion"); // 找出开启状态的版本类型 1为通用版 2为保险版
Assert.assertEquals(userVersion,2,network.message(VERSION_INFO,"会员类型版本判断:判断错误,此版本为通用版",response.body().asString()));
// 重复提交
response = network.postResponse(payParams,PAY_ORDERCREATE);
tradeNo = response.jsonPath().getString("data.tradeNo");
System.out.println(tradeNo);
}
......
......@@ -77,7 +77,7 @@ public class BasicConfig {
public static final String PAY_GETPROMOCODE = HOST + "/kjy/order/getPromoCode";
public static final String PAY_COMBOLIST = HOST + "/kjy/mp/combo/list/v2?code=";
public static final String PAY_COMBOLIST = HOST + "/kjy/mp/combo/list/v2";
public static final String PAY_ORDERCREATE = HOST + "/kjy/order/create";
......
......@@ -270,7 +270,7 @@ public class BaseUtils {
public static void main(String[] args) throws IOException {
disableUser();
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment