Commit c0463881 authored by 赵然's avatar 赵然

zr

parent 0e7d2a57
......@@ -7,21 +7,22 @@ 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.Test;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.*;
import static io.restassured.RestAssured.given;
/**
* Created by mabo on 2018/8/15
*/
public class 种红包条件解锁_AccessTest extends DuibaTestBase{
@Value("${activity.host}")
String activityHost;
@Autowired
SeedRedPacketService seedRedPacketService;
@Autowired
......@@ -66,6 +67,31 @@ public class 种红包条件解锁_AccessTest extends DuibaTestBase{
Assert.assertEquals(landStatus,"3","第四块土地状态校验失败");
}
@Test(description = "第四块土地消耗积分解锁")
public void 第四块土地解锁_未达条件() throws Exception {
//dafuweng登陆获取cookies
Map cookies = authorization.dafuwengLogin(4582);
//调用getLandList接口
Response response = seedRedPacketService.getLandList(cookies,"1","424");
String landStatus = response.jsonPath().getString("data.landList[3].landStatus");
logger.info("第四块土地状态为:未解锁-"+landStatus);
Assert.assertEquals(landStatus,"1","第四块土地状态校验失败");
//调用解锁土地接口
Map<String,String> map = new HashMap<>();
map.put("activityId","1");
map.put("floorId","424");
map.put("landId","4");
map.put("dcm","228.4.2.0");
map.put("dpm","19380.5.424.4");
logger.info("请求unlockLand接口,landId=4");
response = given().cookies(cookies).params(map).get(activityHost+"/seedRedPacket/unlockLand");
Assert.assertEquals(response.jsonPath().getString("success"),"false","/seedRedPacket/seed接口失败");
Assert.assertEquals(response.jsonPath().getString("desc"),"用户地块不是可解锁状态","/seedRedPacket/seed接口失败");
logger.info("用户未达条件,地块不是可解锁状态");
}
@Test(description = "第六块土地兑换一次解锁")
public void 第六块土地解锁() throws Exception {
//dafuweng登陆获取cookies
......
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