Commit c0956140 authored by 周松波's avatar 周松波

update /sign/contract/save

parent 84b6032d
......@@ -95,39 +95,6 @@ public class ContractSignCommon extends DuibaTestBase{
}
}
public void modifyJoinTime(String actId, String date, String startTime, String endTime) throws Exception{
Map<String, Object> map = new HashMap<>();
map.put("title", "自动化_报名截止时间");
map.put("betCount", "1000");
map.put("bonusType","0");
map.put("betType","2");
map.put("bankerBonus", "10000");
map.put("ruleDesc:", "<p>bao ming&nbsp;截止时间</p>");
map.put("contractCycle","7");
map.put("joinTimeLimit", false);
map.put("fakeLimit", false);
map.put("rankPeriod","1");
map.put("joinTimeStart", startTime);
map.put("joinTimeEnd", endTime);
map.put("joinDeadLine", date);
map.put("actId", actId);
map.put("openStatus", true);
map.put("gradientAmountList","");
map.put("freeJoinLimit", "0");
map.put("enableAmpifyCard",false);
map.put("openType", "0");
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(map));
Response response = given().contentType("application/json;charset=UTF-8").cookies(authorization.ssoLogin()).body(jsonObject).post("https://mng.duibatest.com.cn/newmanager/signContract/save");
response.prettyPrint();
try {
Assert.assertEquals(response.jsonPath().getString("success"), "true", "/signContract/save接口失败");
} catch (Exception e) {
throw new Exception("/signContract/save接口失败,返回信息:" + response.asString());
} catch (Error er) {
throw new Exception("/signContract/save接口失败,返回信息:" + response.asString());
}
}
public void modifyIssuePeriod(String issueId, int num) throws Exception{
String sql = "select start_time,end_time from credits_sign.tb_sign_contract_issue where id=" + issueId;
Map<String, Object> result = jdbc.findSimpleResult(sql);
......
......@@ -357,17 +357,21 @@ public class ContractSign_signTest extends DuibaTestBase {
Response rewardResponse = ContractSignService.getContractRank(actId, 10, 2, uid3);
String status2 = rewardResponse.jsonPath().getString("success");
Assert.assertEquals(status2, "true", "打卡次数排行榜查询失败");
String rank2 = rewardResponse.jsonPath().getString("data.rankList[1]");
String userInfo2 = rewardResponse.jsonPath().getString("data.user");
int userRank2 = rewardResponse.jsonPath().getInt("data.user.rank");
int userAmount2 = rewardResponse.jsonPath().getInt("data.user.amount");
int userId2 = rewardResponse.jsonPath().getInt("data.user.consumerId");
String nickName2 = rewardResponse.jsonPath().getString("data.user.nickName");
Assert.assertEquals(userInfo2,rank2);
Assert.assertEquals(userRank2, 2, "用户收益排名不正确");
//Assert.assertEquals(userAmount2, 6000, "收益金额不正确");
Assert.assertEquals(userId2, 100085019, "consumerId不正确");
Assert.assertEquals(nickName2,"Auto3720","用户名不正确");
int rankNum1 = rewardResponse.jsonPath().getInt("data.rankList[0].rank");
int rankNum2 = rewardResponse.jsonPath().getInt("data.rankList[1].rank");
nickName1 = rewardResponse.jsonPath().getString("data.rankList[0].nickName");
String nickName2 = rewardResponse.jsonPath().getString("data.rankList[1].nickName");
Assert.assertEquals(rankNum1,1,"排行榜第一名显示不正确");
Assert.assertEquals(rankNum2,2,"排行榜第二名显示不正确");
// String userInfo2 = rewardResponse.jsonPath().getString("data.user");
// int userRank2 = rewardResponse.jsonPath().getInt("data.user.rank");
// int userAmount2 = rewardResponse.jsonPath().getInt("data.user.amount");
// int userId2 = rewardResponse.jsonPath().getInt("data.user.consumerId");
String nickName3 = rewardResponse.jsonPath().getString("data.user.nickName");
String arr[] = {nickName1, nickName2};
Assert.assertTrue(isInArrray(arr,nickName3),"用户不在排行榜上");
}
@Test(description = "中奖轮播",priority = 9)
......@@ -389,7 +393,13 @@ public class ContractSign_signTest extends DuibaTestBase {
Assert.assertEquals(nickname1, "Auto3721");
Assert.assertEquals(winCount1, "7000");
}
public static boolean isInArrray(String[] arr,String targetValue){
for(String s:arr){
if(s.equals(targetValue))
return true;
}
return false;
}
public Map<String, String> doJoinResult(String activityId, String betAmount, int uid) throws Exception {
Response doJoinRes = ContractSignService.doJoin(activityId, betAmount, uid);
String contractId = doJoinRes.jsonPath().getString("data.contractId");
......@@ -458,6 +468,8 @@ public class ContractSign_signTest extends DuibaTestBase {
map.put("freeJoinLimit", "0");
map.put("enableAmpifyCard",false);
map.put("openType", "0");
map.put("skinType","0");
map.put("skinId","46");
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(map));
Response response = given().contentType("application/json;charset=UTF-8").cookies(authorization.ssoLogin()).body(jsonObject).post("https://mng.duibatest.com.cn/newmanager/signContract/save");
//response.prettyPrint();
......
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