Commit 407f668a by xyy

fix case

parent a54a60e0
...@@ -39,24 +39,27 @@ public class TestGetApply extends XMBaseTest { ...@@ -39,24 +39,27 @@ public class TestGetApply extends XMBaseTest {
@Test(description = "获取修改记录详情") @Test(description = "获取修改记录详情")
public void testPageApply() { public void testPageApply() {
//获取修改记录数据
JSONObject body = merchantTools.getApplyPage(); JSONObject body = merchantTools.getApplyPage();
int total = Integer.parseInt(body.getJSONObject("result").getString("total")); int total = Integer.parseInt(body.getJSONObject("result").getString("total"));
//获取第1条修改记录
String applyId = body.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id"); String applyId = body.getJSONObject("result").getJSONArray("records").getJSONObject(0).getString("id");
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
object.put("id", applyId); object.put("id", applyId);
object.put("studioId", xmAppApi.getLoginInfo().getStudioId()); object.put("studioId", xmAppApi.getLoginInfo().getStudioId());
object.put("brandId", xmAppApi.getLoginInfo().getBrandId()); object.put("brandId", xmAppApi.getLoginInfo().getBrandId());
object.put("operatorId", xmAppApi.getLoginInfo().getAdminId()); object.put("operatorId", xmAppApi.getLoginInfo().getAdminId());
//调用请求
xmAppApi.doRequest(RequestType.JSON, params, object.toJSONString(), headers); xmAppApi.doRequest(RequestType.JSON, params, object.toJSONString(), headers);
JSONObject response = xmAppApi.getBodyInJSON(); JSONObject response = xmAppApi.getBodyInJSON();
//若有数据,检验详情里的场馆信息跟品牌信息匹配;若无返回报错
if (total != 0) { if (total != 0) {
Assert.assertEquals(XMJSONPath.readPath(response, "$.message"), "操作成功!"); Assert.assertEquals(XMJSONPath.readPath(response, "$.message"), "操作成功!");
Assert.assertEquals(XMJSONPath.readPath(response, "$.result.applyType"), "BIND"); Assert.assertEquals(XMJSONPath.readPath(response, "$.result.brandId"), xmAppApi.getLoginInfo().getStudioId());
Assert.assertEquals(XMJSONPath.readPath(response, "$.result.openState"), "SUCCESS"); Assert.assertEquals(XMJSONPath.readPath(response, "$.result.studioId"), xmAppApi.getLoginInfo().getStudioId());
} else { } else {
Assert.assertEquals(XMJSONPath.readPath(response, "$.message"), "数据不存在"); Assert.assertEquals(XMJSONPath.readPath(response, "$.message"), "数据不存在");
} }
......
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