Commit 56ceb6b9 authored by 赵然's avatar 赵然

zr

parent f469bfe4
......@@ -39,6 +39,8 @@ public class 账户异常提现 extends DuibaTestBase{
private static String consumerId = "100098000";
private static int uid2 = 4460;
private static String consumerId2 = "100098001";
private static int uid3 = 4461;
private static String consumerId3 = "100098002";
@AfterClass
public void afterclass() {
try {
......@@ -49,9 +51,12 @@ public class 账户异常提现 extends DuibaTestBase{
hbaseService.updateHBASEKey(key,"","1");
String key2 = "k01_AAWH_K003_"+y_m+"_"+consumerId2;
hbaseService.updateHBASEKey(key2,"","1");
String key3 = "k01_AAWH_K003_"+y_m+"_"+consumerId3;
hbaseService.updateHBASEKey(key3,"","1");
// 修改账户过期时间,确保账户余额不会过期清零
jdbc.update("update consumer_account_log.tb_expire_consumer_account set gmt_modified ='"+getTime(0)+"' where account_id = '"+consumerId+"_6_0'");
jdbc.update("update consumer_account_log.tb_expire_consumer_account set gmt_modified ='"+getTime(0)+"' where account_id = '"+consumerId2+"_6_0'");
jdbc.update("update consumer_account_log.tb_expire_consumer_account set gmt_modified ='"+getTime(0)+"' where account_id = '"+consumerId3+"_6_0'");
} catch (Exception e) {
logger.info("数据后面置操作异常");
......@@ -60,7 +65,7 @@ public class 账户异常提现 extends DuibaTestBase{
@Test
public void 红包账户余额不足() throws Exception {
public void 用户账户余额不足() throws Exception {
//获取原账户余额
Map<String, Object> selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0976 where account_id = '"+consumerId+"_6_0' ");
......@@ -73,6 +78,7 @@ public class 账户异常提现 extends DuibaTestBase{
map.put("alipay","peeulk6392@sandbox.com");
map.put("realname","沙箱环境");
Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).params(map).post(activityHost+"/walletAccount/doTakePrize");
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("success"),"false","/walletAccount/doTakePrize接口失败");
Assert.assertEquals(response.jsonPath().getString("message"),"账户余额不足","/walletAccount/doTakePrize接口失败");
......@@ -111,6 +117,34 @@ public class 账户异常提现 extends DuibaTestBase{
logger.info("用户账户余额校验成功");
}
@Test
public void 开发者账户余额不足() throws Exception {
//获取原账户余额
Map<String, Object> selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0978 where account_id = '"+consumerId3+"_6_0' ");
int balance = Integer.parseInt(String.valueOf(selectResult.get("balance_amount")));
logger.info("账户原有余额为"+balance);
//账户支付宝提现
logger.info("请求doTakePrize");
Map<String,String> map = new HashMap<>();
map.put("alipay","peeulk6392@sandbox.com");
map.put("realname","沙箱环境");
Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid3)).params(map).post(activityHost+"/walletAccount/doTakePrize");
response.prettyPrint();
Assert.assertEquals(response.jsonPath().getString("success"),"false","/walletAccount/doTakePrize接口失败");
Assert.assertEquals(response.jsonPath().getString("message"),"扣app余额失败","/walletAccount/doTakePrize接口失败");
//获取新账户余额
selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0978 where account_id = '"+consumerId3+"_6_0' ");
int balanceNew = Integer.parseInt(String.valueOf(selectResult.get("balance_amount")));
logger.info("账户新余额为"+balanceNew);
Assert.assertEquals(balanceNew,balance,"全局红包增加账户余额失败");
logger.info("用户账户余额校验成功");
}
// 获取时间方法
public String getTime(int amount){
SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd", Locale.ENGLISH);
......
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