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

update /sign/contract/save

parent 84b6032d
...@@ -95,39 +95,6 @@ public class ContractSignCommon extends DuibaTestBase{ ...@@ -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{ 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; String sql = "select start_time,end_time from credits_sign.tb_sign_contract_issue where id=" + issueId;
Map<String, Object> result = jdbc.findSimpleResult(sql); Map<String, Object> result = jdbc.findSimpleResult(sql);
......
...@@ -357,17 +357,21 @@ public class ContractSign_signTest extends DuibaTestBase { ...@@ -357,17 +357,21 @@ public class ContractSign_signTest extends DuibaTestBase {
Response rewardResponse = ContractSignService.getContractRank(actId, 10, 2, uid3); Response rewardResponse = ContractSignService.getContractRank(actId, 10, 2, uid3);
String status2 = rewardResponse.jsonPath().getString("success"); String status2 = rewardResponse.jsonPath().getString("success");
Assert.assertEquals(status2, "true", "打卡次数排行榜查询失败"); Assert.assertEquals(status2, "true", "打卡次数排行榜查询失败");
String rank2 = rewardResponse.jsonPath().getString("data.rankList[1]"); int rankNum1 = rewardResponse.jsonPath().getInt("data.rankList[0].rank");
String userInfo2 = rewardResponse.jsonPath().getString("data.user"); int rankNum2 = rewardResponse.jsonPath().getInt("data.rankList[1].rank");
int userRank2 = rewardResponse.jsonPath().getInt("data.user.rank"); nickName1 = rewardResponse.jsonPath().getString("data.rankList[0].nickName");
int userAmount2 = rewardResponse.jsonPath().getInt("data.user.amount"); String nickName2 = rewardResponse.jsonPath().getString("data.rankList[1].nickName");
int userId2 = rewardResponse.jsonPath().getInt("data.user.consumerId"); Assert.assertEquals(rankNum1,1,"排行榜第一名显示不正确");
String nickName2 = rewardResponse.jsonPath().getString("data.user.nickName"); Assert.assertEquals(rankNum2,2,"排行榜第二名显示不正确");
Assert.assertEquals(userInfo2,rank2); // String userInfo2 = rewardResponse.jsonPath().getString("data.user");
Assert.assertEquals(userRank2, 2, "用户收益排名不正确"); // int userRank2 = rewardResponse.jsonPath().getInt("data.user.rank");
//Assert.assertEquals(userAmount2, 6000, "收益金额不正确"); // int userAmount2 = rewardResponse.jsonPath().getInt("data.user.amount");
Assert.assertEquals(userId2, 100085019, "consumerId不正确"); // int userId2 = rewardResponse.jsonPath().getInt("data.user.consumerId");
Assert.assertEquals(nickName2,"Auto3720","用户名不正确"); String nickName3 = rewardResponse.jsonPath().getString("data.user.nickName");
String arr[] = {nickName1, nickName2};
Assert.assertTrue(isInArrray(arr,nickName3),"用户不在排行榜上");
} }
@Test(description = "中奖轮播",priority = 9) @Test(description = "中奖轮播",priority = 9)
...@@ -389,7 +393,13 @@ public class ContractSign_signTest extends DuibaTestBase { ...@@ -389,7 +393,13 @@ public class ContractSign_signTest extends DuibaTestBase {
Assert.assertEquals(nickname1, "Auto3721"); Assert.assertEquals(nickname1, "Auto3721");
Assert.assertEquals(winCount1, "7000"); 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 { public Map<String, String> doJoinResult(String activityId, String betAmount, int uid) throws Exception {
Response doJoinRes = ContractSignService.doJoin(activityId, betAmount, uid); Response doJoinRes = ContractSignService.doJoin(activityId, betAmount, uid);
String contractId = doJoinRes.jsonPath().getString("data.contractId"); String contractId = doJoinRes.jsonPath().getString("data.contractId");
...@@ -458,6 +468,8 @@ public class ContractSign_signTest extends DuibaTestBase { ...@@ -458,6 +468,8 @@ public class ContractSign_signTest extends DuibaTestBase {
map.put("freeJoinLimit", "0"); map.put("freeJoinLimit", "0");
map.put("enableAmpifyCard",false); map.put("enableAmpifyCard",false);
map.put("openType", "0"); map.put("openType", "0");
map.put("skinType","0");
map.put("skinId","46");
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(map)); 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 response = given().contentType("application/json;charset=UTF-8").cookies(authorization.ssoLogin()).body(jsonObject).post("https://mng.duibatest.com.cn/newmanager/signContract/save");
//response.prettyPrint(); //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