Commit 48c63f71 authored by 吕雯燕's avatar 吕雯燕

Merge branch 'master' into duiba_wenyan

parents c07c1684 6f9210c5
...@@ -173,13 +173,13 @@ public class 自有新卡密_兑换限制测试_ExchangeTest extends CheckTemple ...@@ -173,13 +173,13 @@ public class 自有新卡密_兑换限制测试_ExchangeTest extends CheckTemple
i--; i--;
} }
Thread.sleep(3000);
Response detailResponse = mobileService.appItemDetail(authorization.dafuwengLogin(uid),appItemId); Response detailResponse = mobileService.appItemDetail(authorization.dafuwengLogin(uid),appItemId);
detailResponse.prettyPrint(); detailResponse.prettyPrint();
String exchangeText = MatcherString.getString(detailResponse.asString(), "\"exchangeText\":\"(.*?)\",", 1); String exchangeText = MatcherString.getString(detailResponse.asString(), "\"exchangeText\":\"(.*?)\",", 1);
logger.info("商品兑换按钮:" + exchangeText); logger.info("商品兑换按钮:" + exchangeText);
//第二次兑换 //第二次兑换
Thread.sleep(3000);
try{ try{
response = gawService.couponExchange(uid, appItemId,82); response = gawService.couponExchange(uid, appItemId,82);
response.prettyPrint(); response.prettyPrint();
......
...@@ -102,6 +102,7 @@ public class 自有老虚拟商品_兑换限制测试_ExchangeTest extends Check ...@@ -102,6 +102,7 @@ public class 自有老虚拟商品_兑换限制测试_ExchangeTest extends Check
message = response.jsonPath().getString("message"); message = response.jsonPath().getString("message");
i--; i--;
} }
Thread.sleep(3000);
Response detailResponse = mobileService.appItemDetail(authorization.dafuwengLogin(uid),appItemId); Response detailResponse = mobileService.appItemDetail(authorization.dafuwengLogin(uid),appItemId);
detailResponse.prettyPrint(); detailResponse.prettyPrint();
...@@ -109,7 +110,6 @@ public class 自有老虚拟商品_兑换限制测试_ExchangeTest extends Check ...@@ -109,7 +110,6 @@ public class 自有老虚拟商品_兑换限制测试_ExchangeTest extends Check
logger.info("商品兑换按钮:" + exchangeText); logger.info("商品兑换按钮:" + exchangeText);
//第二次兑换 //第二次兑换
Thread.sleep(3000);
try{ try{
response = couponExchangeService.virtualExchange(authorization.dafuwengLogin(uid), appItemId, "123456"); response = couponExchangeService.virtualExchange(authorization.dafuwengLogin(uid), appItemId, "123456");
response.prettyPrint(); response.prettyPrint();
......
...@@ -222,7 +222,7 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase { ...@@ -222,7 +222,7 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase {
@Test @Test
public void 自有活动工具扣库存测试() throws Exception { public void 自有活动工具扣库存测试() throws Exception {
//获取兑换项库存 //获取兑换项库存
Response response = developerService.appItems("2239","【自动化勿动】自有优惠券"); Response response = developerService.appItems("2239","【自动化勿动】zr自有优惠券");
//response.prettyPrint(); //response.prettyPrint();
String remind = response.jsonPath().getString("data.list[0].remaind"); String remind = response.jsonPath().getString("data.list[0].remaind");
logger.info("抽奖前兑换项库存为:"+remind); logger.info("抽奖前兑换项库存为:"+remind);
...@@ -240,18 +240,18 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase { ...@@ -240,18 +240,18 @@ public class 扣库存测试_DuibaTest extends DuibaTestBase {
response = this.新活动工具接口传参("28247","abcde","iOS"); response = this.新活动工具接口传参("28247","abcde","iOS");
Assert.assertEquals(response.jsonPath().getString("lottery.type"),"coupon","校验type失败"); Assert.assertEquals(response.jsonPath().getString("lottery.type"),"coupon","校验type失败");
Assert.assertEquals(response.jsonPath().getString("lottery.title"),"【自动化勿动】自有优惠券","校验title失败"); Assert.assertEquals(response.jsonPath().getString("lottery.title"),"【自动化勿动】zr自有优惠券","校验title失败");
Assert.assertTrue(response.jsonPath().getString("lottery.link").contains("/crecord/recordDetailNew?orderId=")); Assert.assertTrue(response.jsonPath().getString("lottery.link").contains("/crecord/recordDetailNew?orderId="));
Assert.assertEquals(response.jsonPath().getString("lottery.id"), "16405", "校验id失败"); Assert.assertEquals(response.jsonPath().getString("lottery.id"), "16405", "校验id失败");
logger.info("校验实物商品:type,title,link,id成功"); logger.info("校验实物商品:type,title,link,id成功");
//校验兑换项库存 //校验兑换项库存
response = developerService.appItems("2239","【自动化勿动】自有优惠券"); response = developerService.appItems("2239","【自动化勿动】zr自有优惠券");
String Newremind = response.jsonPath().getString("data.list[0].remaind"); String Newremind = response.jsonPath().getString("data.list[0].remaind");
int i= 10; int i= 10;
while(i>0 && !Newremind.equals(remind)){ while(i>0 && !Newremind.equals(remind)){
Thread.sleep(500); Thread.sleep(500);
response = developerService.appItems("2239","【自动化勿动】自有优惠券"); response = developerService.appItems("2239","【自动化勿动】zr自有优惠券");
Newremind = response.jsonPath().getString("data.list[0].remaind"); Newremind = response.jsonPath().getString("data.list[0].remaind");
i--; i--;
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* FileName: 瓜分积分测试_AccessTest * FileName: 瓜分积分测试_AccessTest
* Author: zhaoran * Author: zhaoran
* Date: 2018/12/10 19:45 * Date: 2018/12/10 19:45
* AppId: 21827
* Description: * Description:
*/ */
package http.cases.PkMoudleTest; package http.cases.PkMoudleTest;
...@@ -198,6 +199,7 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase { ...@@ -198,6 +199,7 @@ public class 瓜分积分_实际瓜分_AccessTest extends DuibaTestBase {
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].bonusType"),"4","中奖弹窗类型校验失败"); Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].bonusType"),"4","中奖弹窗类型校验失败");
Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败"); Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败");
Assert.assertEquals(response.jsonPath().getString("data.unitName"),"金币","积分单位校验失败");
Response response2 = pkService.popup(uid3); Response response2 = pkService.popup(uid3);
response.prettyPrint(); response.prettyPrint();
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* FileName: 瓜分积分测试_AccessTest * FileName: 瓜分积分测试_AccessTest
* Author: zhaoran * Author: zhaoran
* Date: 2018/12/10 19:45 * Date: 2018/12/10 19:45
* Description: * Description: appId 21832
*/ */
package http.cases.PkMoudleTest; package http.cases.PkMoudleTest;
...@@ -204,6 +204,7 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas ...@@ -204,6 +204,7 @@ public class 瓜分积分_实际瓜分_主胜方_AccessTest extends DuibaTestBas
Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].bonusType"),"4","中奖弹窗类型校验失败"); Assert.assertEquals(response.jsonPath().getString("data.prizeList[0].bonusType"),"4","中奖弹窗类型校验失败");
Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败"); Assert.assertEquals(response.jsonPath().getString("data.show"),"true","展示弹窗校验失败");
Assert.assertEquals(response.jsonPath().getString("data.unitName"),"金币","积分单位校验失败");
Response response2 = pkService.popup(uid1); Response response2 = pkService.popup(uid1);
response.prettyPrint(); response.prettyPrint();
......
...@@ -42,24 +42,24 @@ public class 插件场景测试_pluginTest extends DuibaTestBase { ...@@ -42,24 +42,24 @@ public class 插件场景测试_pluginTest extends DuibaTestBase {
public void before(){ public void before(){
// jdbc = MysqlUtils.mysqlDuiba(""); // jdbc = MysqlUtils.mysqlDuiba("");
try { // try {
//
jdbc.update("insert into `dafuweng`.`user` ( `enable`, `app_id`, `gmt_modified`, `gmt_create`, `credits`, `version`, `name`) values ( b'0', '57', '2018-05-23 16:43:44', '2018-05-23 16:43:44', '10000', '0', 'auto-test');"); // jdbc.update("insert into `dafuweng`.`user` ( `enable`, `app_id`, `gmt_modified`, `gmt_create`, `credits`, `version`, `name`) values ( b'0', '57', '2018-05-23 16:43:44', '2018-05-23 16:43:44', '10000', '0', 'auto-test');");
} catch (Exception e) { // } catch (Exception e) {
System.out.println("insert failed"); // System.out.println("insert failed");
} // }
} }
@AfterClass @AfterClass
public void after(){ public void after(){
try { // try {
jdbc.update("DELETE FROM `dafuweng`.`user` ORDER BY id DESC LIMIT 1"); // jdbc.update("DELETE FROM `dafuweng`.`user` ORDER BY id DESC LIMIT 1");
jdbc.update("DELETE FROM credits_activity.tb_activity_plugin where title = '【勿动】自动化-插件活动'"); // jdbc.update("DELETE FROM credits_activity.tb_activity_plugin where title = '【勿动】自动化-插件活动'");
} catch (Exception e) { // } catch (Exception e) {
System.out.println(); // System.out.println();
} // }
// jdbc.releaseConn(); // jdbc.releaseConn();
...@@ -89,7 +89,7 @@ public class 插件场景测试_pluginTest extends DuibaTestBase { ...@@ -89,7 +89,7 @@ public class 插件场景测试_pluginTest extends DuibaTestBase {
} }
@Test(dataProvider = "providerMethod") // @Test(dataProvider = "providerMethod")
public void 插件应用场景测试(int caseNum,String activityId,String url,String caseName) throws Exception { public void 插件应用场景测试(int caseNum,String activityId,String url,String caseName) throws Exception {
logger.info(caseName); logger.info(caseName);
...@@ -145,7 +145,10 @@ public class 插件场景测试_pluginTest extends DuibaTestBase { ...@@ -145,7 +145,10 @@ public class 插件场景测试_pluginTest extends DuibaTestBase {
} }
@Test(dataProvider = "providerMethod")
// @Test(dataProvider = "providerMethod")
public void 插件触发事件测试(int caseNum,String signType,String url,String caseName) throws Exception { public void 插件触发事件测试(int caseNum,String signType,String url,String caseName) throws Exception {
logger.info(caseName); logger.info(caseName);
......
package http.cases.WalletTest;
import base.DuibaLog;
import base.DuibaTestBase;
import http.service.Activity.GlobalRewardService;
import http.service.Activity.SeedRedPacketService;
import http.service.Activity.WalletAccountService;
import http.service.Authorization;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import utils.HbaseService;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.*;
import static io.restassured.RestAssured.given;
/**
* Created by 赵然 on 2019/04/04
* AppId: 22565
*/
public class 总帐户提现页校验_AccessTest extends DuibaTestBase{
@Value("${activity.host}")
String activityHost;
@Autowired
SeedRedPacketService seedRedPacketService;
@Autowired
WalletAccountService walletAccountService;
@Autowired
GlobalRewardService globalRewardService;
@Autowired
Authorization authorization;
@Autowired
HbaseService hbaseService;
private DuibaLog logger = DuibaLog.getLogger();
//指定用户
private static int uid = 7112;
private static String consumerId = "100145034";
@Test
public void 提现页校验() throws Exception {
Response response = globalRewardService.toWithdraw(uid);
response.print();
String expireTime = response.jsonPath().getString("data.expireTime");
String perLimitAmount = response.jsonPath().getString("data.perLimitAmount");
String periodOpen = response.jsonPath().getString("data.periodOpen");
Assert.assertEquals(expireTime,"2021/01/31 00:00:00","提现页过期时间校验失败");
Assert.assertEquals(perLimitAmount,"2000","提现页满额提现金额校验失败");
Assert.assertEquals(periodOpen,"true","总帐户状态校验失败");
logger.info("总帐户提现页校验成功!");
}
@Test
public void 后台红包周期校验() throws Exception {
Response response = globalRewardService.periodList("18157163293","22565","2");
response.print();
String bonusLimit = response.jsonPath().getString("data[0].bonusLimit");
String forConfirm = response.jsonPath().getString("data[0].forConfirm");
String periodStatus = response.jsonPath().getString("data[0].periodStatus");
String withdrawThreshold = response.jsonPath().getString("data[0].withdrawThreshold");
String relType = response.jsonPath().getString("data[0].relList[0].relType");
String relTypeName = response.jsonPath().getString("data[0].relList[0].relTypeName");
Assert.assertEquals(bonusLimit,"40000","红包预算校验失败");
Assert.assertEquals(forConfirm,"false","确认按钮校验失败");
Assert.assertEquals(periodStatus,"OPEN","总帐户状态校验失败");
Assert.assertEquals(withdrawThreshold,"2000","用户提现限制校验失败");
Assert.assertEquals(relType,"PK","关联活动类型校验失败");
Assert.assertEquals(relTypeName,"组件pk","关联活动名称校验失败");
response = globalRewardService.periodCount("18157163293","22565","2");
Assert.assertEquals(response.jsonPath().getString("data"),"1","周期个数校验失败");
}
}
...@@ -24,8 +24,9 @@ import static io.restassured.RestAssured.given; ...@@ -24,8 +24,9 @@ import static io.restassured.RestAssured.given;
/** /**
* Created by 赵然 on 2019/03/29 * Created by 赵然 on 2019/03/29
* AppId: 22565
*/ */
public class 总帐户账户正常提现 extends DuibaTestBase{ public class 总帐户账户正常提现_AccessTest extends DuibaTestBase{
@Value("${activity.host}") @Value("${activity.host}")
String activityHost; String activityHost;
@Autowired @Autowired
...@@ -48,7 +49,7 @@ public class 总帐户账户正常提现 extends DuibaTestBase{ ...@@ -48,7 +49,7 @@ public class 总帐户账户正常提现 extends DuibaTestBase{
public void beforeclass() { public void beforeclass() {
try { try {
//重置账户金额2000 //重置账户金额2000
walletAccountService.updateConsumerAccount(consumerId,"6","2000"); walletAccountService.updateConsumerAccount(consumerId,"6","2");
//清空提现记录 //清空提现记录
jdbc.update("DELETE FROM consumer_account_log.tb_consumer_accounts_log where account_id = '"+consumerId+"_6_0'"); jdbc.update("DELETE FROM consumer_account_log.tb_consumer_accounts_log where account_id = '"+consumerId+"_6_0'");
...@@ -89,7 +90,7 @@ public class 总帐户账户正常提现 extends DuibaTestBase{ ...@@ -89,7 +90,7 @@ public class 总帐户账户正常提现 extends DuibaTestBase{
Assert.assertEquals(success,"false","success状态失败"); Assert.assertEquals(success,"false","success状态失败");
Assert.assertEquals(code,"100000","错误码失败"); Assert.assertEquals(code,"100000","错误码失败");
Assert.assertEquals(message,"最低提现金额20元","message失败"); // Assert.assertEquals(message,"最低提现金额0元","message失败");
//获取新账户余额 //获取新账户余额
selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0906 where account_id = '100145034_6_0' "); selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0906 where account_id = '100145034_6_0' ");
...@@ -115,7 +116,7 @@ public class 总帐户账户正常提现 extends DuibaTestBase{ ...@@ -115,7 +116,7 @@ public class 总帐户账户正常提现 extends DuibaTestBase{
//账户支付宝提现 //账户支付宝提现
Map cookies = authorization.dafuwengLogin(uid); Map cookies = authorization.dafuwengLogin(uid);
Response response = this.账户提现失败(cookies,"2000",account,username); Response response = this.账户提现失败(cookies,"2",account,username);
response.print(); response.print();
Thread.sleep(5000); Thread.sleep(5000);
...@@ -147,11 +148,11 @@ public class 总帐户账户正常提现 extends DuibaTestBase{ ...@@ -147,11 +148,11 @@ public class 总帐户账户正常提现 extends DuibaTestBase{
Map<String, Object> selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0906 where account_id = '100145034_6_0' "); Map<String, Object> selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0906 where account_id = '100145034_6_0' ");
int balance = Integer.parseInt(String.valueOf(selectResult.get("balance_amount"))); int balance = Integer.parseInt(String.valueOf(selectResult.get("balance_amount")));
logger.info("账户原有余额为"+balance); logger.info("账户原有余额为"+balance);
balance = balance - 2000; balance = balance - 2;
//账户支付宝提现 //账户支付宝提现
Map cookies = authorization.dafuwengLogin(uid); Map cookies = authorization.dafuwengLogin(uid);
this.账户提现(cookies,"2000","peeulk6392@sandbox.com","沙箱环境"); this.账户提现(cookies,"2","peeulk6392@sandbox.com","沙箱环境");
Thread.sleep(2000); Thread.sleep(2000);
//获取新账户余额 //获取新账户余额
selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0906 where account_id = '100145034_6_0' "); selectResult = jdbc.findSimpleResult("select * from consumer_accounts.tb_consumer_account_0906 where account_id = '100145034_6_0' ");
......
...@@ -23,30 +23,10 @@ public class GlobalRewardService { ...@@ -23,30 +23,10 @@ public class GlobalRewardService {
Authorization authorization; Authorization authorization;
@Value("${activity.host}") @Value("${activity.host}")
String activityHost; String activityHost;
@Value("${hdserver.host}")
String hdHost;
private DuibaLog logger = DuibaLog.getLogger(); private DuibaLog logger = DuibaLog.getLogger();
/**
* 获取红包账户
* @param cookies
* @return
* @throws Exception
*/
public Response getWalletAccount(Map cookies) throws Exception {
logger.info("请求getWalletAccount");
Response response = given().cookies(cookies).get(activityHost+"/walletAccount/getWalletAccount");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/walletAccount/getWalletAccount接口失败");
}catch(Exception e){
throw new Exception("/walletAccount/getWalletAccount接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/walletAccount/getWalletAccount接口失败,返回信息:"+response.asString());
}
return response;
}
/** /**
* 红包账户提现 * 红包账户提现
* @param cookies * @param cookies
...@@ -77,92 +57,76 @@ public class GlobalRewardService { ...@@ -77,92 +57,76 @@ public class GlobalRewardService {
} }
/** /**
* 红包账户提现 * 红包账户提现页
* @param cookies * @param uid
* @param orderId
* @return * @return
* @throws Exception * @throws Exception
*/ */
public Response getOrderStatus(Map cookies,String orderId) throws Exception { public Response toWithdraw(int uid) throws Exception {
logger.info("请求getOrderStatus"); logger.info("请求toWithdraw");
Map<String,String> map = new HashMap<>();
map.put("orderId",orderId);
Response response = given().cookies(cookies).params(map).post(activityHost+"/walletAccount/getOrderStatus"); Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.dafuwengLogin(uid)).get(activityHost+"/globalReward/toWithdraw");
try{ try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/walletAccount/getOrderStatus接口失败"); Assert.assertEquals(response.jsonPath().getString("success"),"true","/globalReward/toWithdraw接口失败");
}catch(Exception e){ }catch(Exception e){
throw new Exception("/walletAccount/getOrderStatus接口失败,返回信息:"+response.asString()); throw new Exception("/globalReward/toWithdraw接口失败,返回信息:"+response.asString());
}catch(Error er){ }catch(Error er){
throw new Exception("/walletAccount/getOrderStatus接口失败,返回信息:"+response.asString()); throw new Exception("/globalReward/toWithdraw接口失败,返回信息:"+response.asString());
} }
return response; return response;
} }
public Response getOrderStatus2(Map cookies,String orderId) throws Exception {
logger.info("请求getOrderStatus");
Map<String,String> map = new HashMap<>();
map.put("orderId",orderId);
Response response = given().cookies(cookies).params(map).post(activityHost+"/walletAccount/getOrderStatus");
return response;
}
/** /**
* 红包账户提现记录 * 开发者后台红包周期列表
* @param cookies * @param account
* @param appId
* @param periodStatus 2:进行中
* @return * @return
* @throws Exception * @throws Exception
*/ */
public Response walletDetail(Map cookies) throws Exception { public Response periodList(String account,String appId,String periodStatus) throws Exception {
logger.info("请求walletDetail"); logger.info("请求periodList");
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
map.put("pageNo","1"); map.put("periodStatus",periodStatus);
map.put("pageSize","12"); map.put("pageNum","1");
map.put("pageSize","10");
Response response = given().cookies(cookies).params(map).get(activityHost+"/walletAccount/walletDetail"); Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaasNew(account,appId)).params(map).post("http://"+hdHost+"/redpackets/manageTool/periodList");
try{ try{
Assert.assertEquals(response.jsonPath().getString("success"),"true","/walletAccount/walletDetail接口失败"); Assert.assertEquals(response.jsonPath().getString("success"),"true","/globalReward/toWithdraw接口失败");
}catch(Exception e){ }catch(Exception e){
throw new Exception("/walletAccount/walletDetail接口失败,返回信息:"+response.asString()); throw new Exception("/redpackets/manageTool/periodList接口失败,返回信息:"+response.asString());
}catch(Error er){ }catch(Error er){
throw new Exception("/walletAccount/walletDetail接口失败,返回信息:"+response.asString()); throw new Exception("/redpackets/manageTool/periodList接口失败,返回信息:"+response.asString());
} }
return response; return response;
} }
/** /**
* 红包账户修改钱包账户余额后门 * 开发者后台红包周期个数
* @param consumerId * @param account
* @param accountType * @param appId
* @param balanceAmount * @param periodStatus 2:进行中
* @return * @return
* @throws Exception * @throws Exception
*/ */
public void updateConsumerAccount(String consumerId,String accountType,String balanceAmount) throws Exception { public Response periodCount(String account,String appId,String periodStatus) throws Exception {
logger.info("请求修改钱包账户余额后门:updateConsumerAccount"); logger.info("请求periodCount");
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
map.put("consumerId",consumerId); map.put("periodStatus",periodStatus);
map.put("accountType",accountType);
map.put("balanceAmount",balanceAmount); Response response = given().contentType("application/x-www-form-urlencoded;charset=UTF-8").cookies(authorization.hdLoginSaasNew(account,appId)).params(map).post("http://"+hdHost+"/redpackets/manageTool/periodCount");
try{
Response response = given().params(map).get(activityHost+"/aaw/automated/updateConsumerAccount"); Assert.assertEquals(response.jsonPath().getString("success"),"true","/globalReward/toWithdraw接口失败");
// try{ }catch(Exception e){
// Assert.assertEquals(response.jsonPath().getString("success"),"true","/walletAccount/walletDetail接口失败"); throw new Exception("/redpackets/manageTool/periodCount接口失败,返回信息:"+response.asString());
// }catch(Error er){
// }catch(Exception e){ throw new Exception("/redpackets/manageTool/periodCount接口失败,返回信息:"+response.asString());
// throw new Exception("/aaw/automated/updateConsumerAccount接口失败,返回信息:"+response.asString()); }
// }catch(Error er){ return response;
// throw new Exception("/aaw/automated/updateConsumerAccount接口失败,返回信息:"+response.asString());
//
// }
//return response;
} }
} }
...@@ -144,7 +144,7 @@ public class SingleLotteryService { ...@@ -144,7 +144,7 @@ public class SingleLotteryService {
//获取单品抽奖信息 //获取单品抽奖信息
public Response AdminDuibaSingleLottery(String actId) throws Exception { public Response AdminDuibaSingleLottery(String actId) throws Exception {
String url = ManagerHost + "/AdminDuibaSingleLotteryService/edit/"+actId; String url = ManagerHost + "/AdminDuibaSingleLottery/edit/"+actId;
logger.info("请求兑吧管理后台余额url:" + url); logger.info("请求兑吧管理后台余额url:" + url);
Response response = given().cookies(authorization.ssoLogin()).get("http://" + url); Response response = given().cookies(authorization.ssoLogin()).get("http://" + url);
...@@ -161,7 +161,7 @@ public class SingleLotteryService { ...@@ -161,7 +161,7 @@ public class SingleLotteryService {
//兑吧管理后台创建单品抽奖活动 //兑吧管理后台创建单品抽奖活动
public void SingleLottery_create(String title, Map<String,String> incite) throws Exception { public void SingleLottery_create(String title, Map<String,String> incite) throws Exception {
String saveUrl = ManagerHost+"/AdminDuibaSingleLotteryService/create"; String saveUrl = ManagerHost+"/AdminDuibaSingleLottery/create";
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
map.put("title",title); map.put("title",title);
...@@ -202,7 +202,7 @@ public class SingleLotteryService { ...@@ -202,7 +202,7 @@ public class SingleLotteryService {
//兑吧管理后台单品抽奖列表页 //兑吧管理后台单品抽奖列表页
public Response manager_index() throws Exception { public Response manager_index() throws Exception {
String url = ManagerHost+"/AdminDuibaSingleLotteryService/index"; String url = ManagerHost+"/AdminDuibaSingleLottery/index";
Response response=given().cookies(authorization.ssoLogin()).get("http://"+url); Response response=given().cookies(authorization.ssoLogin()).get("http://"+url);
//Response.prettyPrint(); //Response.prettyPrint();
...@@ -218,7 +218,7 @@ public class SingleLotteryService { ...@@ -218,7 +218,7 @@ public class SingleLotteryService {
//兑吧管理后台开启单品抽奖活动 1-开启且可见 //兑吧管理后台开启单品抽奖活动 1-开启且可见
public void changeStatus(String atcId,String val) throws Exception { public void changeStatus(String atcId,String val) throws Exception {
String url = ManagerHost+"/AdminDuibaSingleLotteryService/changeStatus"; String url = ManagerHost+"/AdminDuibaSingleLottery/changeStatus";
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
map.put("id",atcId); map.put("id",atcId);
...@@ -228,7 +228,7 @@ public class SingleLotteryService { ...@@ -228,7 +228,7 @@ public class SingleLotteryService {
Response response = given().cookies(authorization.ssoLogin()).params(map).post("http://" + url); Response response = given().cookies(authorization.ssoLogin()).params(map).post("http://" + url);
try{ try{
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/AdminDuibaSingleLotteryService/changeStatus接口失败"); Assert.assertEquals(response.jsonPath().getString("success"), "true", "/AdminDuibaSingleLottery/changeStatus接口失败");
}catch(Exception e){ }catch(Exception e){
throw new Exception("/AdminDuibaSingleLotteryService/changeStatus接口失败,返回信息:"+response.asString()); throw new Exception("/AdminDuibaSingleLotteryService/changeStatus接口失败,返回信息:"+response.asString());
}catch(Error er){ }catch(Error er){
...@@ -238,7 +238,7 @@ public class SingleLotteryService { ...@@ -238,7 +238,7 @@ public class SingleLotteryService {
//兑吧管理后台删除活动 //兑吧管理后台删除活动
public void delete(String atcId) throws Exception { public void delete(String atcId) throws Exception {
String url = ManagerHost+"/AdminDuibaSingleLotteryService/delete/"+atcId; String url = ManagerHost+"/AdminDuibaSingleLottery/delete/"+atcId;
Response response = given().cookies(authorization.ssoLogin()).post("http://" + url); Response response = given().cookies(authorization.ssoLogin()).post("http://" + url);
......
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